init lserp cs 5.0

This commit is contained in:
cyf
2026-07-10 15:25:05 +08:00
commit 90f3fda86a
3799 changed files with 976868 additions and 0 deletions
@@ -0,0 +1,72 @@
namespace Lskj.Main.sub
{
partial class FrmAbount
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmAbount));
this.picAbout = new System.Windows.Forms.PictureBox();
((System.ComponentModel.ISupportInitialize)(this.picAbout)).BeginInit();
this.SuspendLayout();
//
// picAbout
//
this.picAbout.Dock = System.Windows.Forms.DockStyle.Fill;
this.picAbout.Image = ((System.Drawing.Image)(resources.GetObject("picAbout.Image")));
this.picAbout.Location = new System.Drawing.Point(0, 0);
this.picAbout.Name = "picAbout";
this.picAbout.Size = new System.Drawing.Size(567, 313);
this.picAbout.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.picAbout.TabIndex = 1;
this.picAbout.TabStop = false;
//
// FrmAbount
//
this.Appearance.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Appearance.Options.UseFont = true;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(567, 313);
this.Controls.Add(this.picAbout);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.LookAndFeel.SkinName = "Office 2010 Blue";
this.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Office2003;
this.Name = "FrmAbount";
this.Text = "关于朗速ERP3.0";
this.Load += new System.EventHandler(this.FrmAbount_Load);
((System.ComponentModel.ISupportInitialize)(this.picAbout)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.PictureBox picAbout;
}
}
@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CommonLib.data;
namespace Lskj.Main.sub
{
public partial class FrmAbount : FormBase
{
public FrmAbount()
{
InitializeComponent();
}
private void FrmAbount_Load(object sender, EventArgs e)
{
//picAbout.Image = Image.FromFile("Images/About.jpg");
//this.Width = picAbout.Width;
//this.Height = picAbout.Height;
//this.Left = (Screen.PrimaryScreen.Bounds.Width - this.Width) / 2;
//this.Top = (Screen.PrimaryScreen.Bounds.Height - this.Height) / 2;
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,156 @@
namespace Lskj.Main.sub
{
partial class FrmConfig
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmConfig));
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.txtDBName = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.txtServerName = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.btnTestConnect = new System.Windows.Forms.Button();
this.btnSave = new System.Windows.Forms.Button();
this.btnQuit = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.txtDBName);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.txtServerName);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Location = new System.Drawing.Point(11, 5);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(277, 72);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
//
// txtDBName
//
this.txtDBName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtDBName.Location = new System.Drawing.Point(104, 42);
this.txtDBName.MaxLength = 50;
this.txtDBName.Name = "txtDBName";
this.txtDBName.Size = new System.Drawing.Size(162, 21);
this.txtDBName.TabIndex = 3;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(6, 45);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(65, 12);
this.label2.TabIndex = 2;
this.label2.Text = "数据库名称";
//
// txtServerName
//
this.txtServerName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtServerName.Location = new System.Drawing.Point(104, 14);
this.txtServerName.MaxLength = 50;
this.txtServerName.Name = "txtServerName";
this.txtServerName.Size = new System.Drawing.Size(162, 21);
this.txtServerName.TabIndex = 1;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(6, 17);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(89, 12);
this.label1.TabIndex = 0;
this.label1.Text = "服务器名称或IP";
//
// btnTestConnect
//
this.btnTestConnect.Location = new System.Drawing.Point(12, 83);
this.btnTestConnect.Name = "btnTestConnect";
this.btnTestConnect.Size = new System.Drawing.Size(79, 23);
this.btnTestConnect.TabIndex = 1;
this.btnTestConnect.Text = "测试连接(&T)";
this.btnTestConnect.UseVisualStyleBackColor = true;
this.btnTestConnect.Click += new System.EventHandler(this.btnTestConnect_Click);
//
// btnSave
//
this.btnSave.Location = new System.Drawing.Point(109, 83);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(79, 23);
this.btnSave.TabIndex = 2;
this.btnSave.Text = "保存设置(&S)";
this.btnSave.UseVisualStyleBackColor = true;
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
//
// btnQuit
//
this.btnQuit.Location = new System.Drawing.Point(206, 83);
this.btnQuit.Name = "btnQuit";
this.btnQuit.Size = new System.Drawing.Size(79, 23);
this.btnQuit.TabIndex = 3;
this.btnQuit.Text = "关闭(&Q)";
this.btnQuit.UseVisualStyleBackColor = true;
this.btnQuit.Click += new System.EventHandler(this.btnQuit_Click);
//
// FrmConfig
//
this.Appearance.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Appearance.Options.UseFont = true;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(301, 122);
this.Controls.Add(this.btnQuit);
this.Controls.Add(this.btnSave);
this.Controls.Add(this.btnTestConnect);
this.Controls.Add(this.groupBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.Name = "FrmConfig";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "系统配置";
this.Load += new System.EventHandler(this.FrmConfig_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TextBox txtDBName;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox txtServerName;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btnTestConnect;
private System.Windows.Forms.Button btnSave;
private System.Windows.Forms.Button btnQuit;
}
}
@@ -0,0 +1,78 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using CommonLib;
using CommonLib.data;
using DevExpress.XtraEditors;
namespace Lskj.Main.sub
{
public partial class FrmConfig : XtraForm {
public FrmConfig() {
InitializeComponent();
DevExpress.Skins.SkinManager.EnableFormSkins();
}
private void btnTestConnect_Click(object sender, EventArgs e) {
TestConfig(false);
}
private void btnSave_Click(object sender, EventArgs e) {
TestConfig(true);
}
private void TestConfig(bool bSave) {
if (txtServerName.Text.Trim() == string.Empty) {
MessageBox.Show("请输入服务器名称或IP");
return;
}
if (txtDBName.Text.Trim() == string.Empty) {
MessageBox.Show("请输入数据库名称!");
return;
}
DBConfig.Instance.ServerName = txtServerName.Text.Trim();
DBConfig.Instance.datastr = txtDBName.Text.Trim();
Cursor = Cursors.Hand;
try {
string connectionStr = DBConfig.Instance.GetConStr();
using (SqlConnection conn = new SqlConnection(connectionStr)) {
conn.Open();
conn.Close();
conn.Dispose();
}
if (bSave) {
MessageBox.Show("保存成功,系统需要重启.");
DBConfig.Instance.WriteConfig();
DialogResult = DialogResult.OK;
Close();
}
else {
MessageBox.Show("连接正确.");
}
}
catch (Exception ex) {
MessageBox.Show("连接失败,请确认配置是否正确!");
}
finally {
Cursor = Cursors.Default;
}
}
private void btnQuit_Click(object sender, EventArgs e) {
Close();
}
private void FrmConfig_Load(object sender, EventArgs e) {
txtServerName.Text = DBConfig.Instance.ServerName;
txtDBName.Text = DBConfig.Instance.datastr;
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,65 @@
namespace Lskj.Main.sub
{
partial class FrmDownLoad
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmDownLoad));
this.progressBar1 = new System.Windows.Forms.ProgressBar();
this.SuspendLayout();
//
// progressBar1
//
this.progressBar1.Location = new System.Drawing.Point(0, 0);
this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new System.Drawing.Size(364, 23);
this.progressBar1.TabIndex = 0;
//
// FrmDownLoad
//
this.Appearance.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Appearance.Options.UseFont = true;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(365, 23);
this.ControlBox = false;
this.Controls.Add(this.progressBar1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.LookAndFeel.SkinName = "Office 2010 Blue";
this.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Office2003;
this.Name = "FrmDownLoad";
this.Text = "FrmDownLoad";
this.Load += new System.EventHandler(this.FrmDownLoad_Load);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.ProgressBar progressBar1;
}
}
@@ -0,0 +1,300 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Data.SqlClient;
using CommonLib;
using CommonLib.data;
namespace Lskj.Main.sub
{
/// <summary>
/// 文件更新类
/// </summary>
public partial class FrmDownLoad : FormBase
{
/// <summary>
/// 文件位置下载模式结构
/// </summary>
private class FileLocationData
{
public string Location = "";
public string FileName = "";
public int DownloadModel = 0;
}
//扩展名数据存储列表
private SortedList<string, FileLocationData> extList;
//核心程序更新列表
private SortedList<string, FileLocationData> kernalList;
//主文件名称(为空表示不存在更新)
private string m_MainFileName = "";
public FrmDownLoad()
{
InitializeComponent();
}
private void FrmDownLoad_Load(object sender, EventArgs e)
{
//默认升级失败
DialogResult = System.Windows.Forms.DialogResult.Abort;
if (ERPInfo.Instance.UpdateIP == string.Empty)
return;
extList = new SortedList<string, FileLocationData>();
kernalList = new SortedList<string, FileLocationData>();
string strDir = "\\\\" + ERPInfo.Instance.UpdateIP + "\\update";
//if (false)
// strDir = "D:\\update";
//这里不再继续对路径做存在判断了
//if (Directory.Exists(strDir) == false)
// return;
try
{
this.Text = "";
string strSql = "select FileName,Location,DownloadModel from FileLocationRelationTab";
using (SqlDataReader dr = SqlHelper.ExecuteReader(CommandType.Text, strSql, null))
{
while (dr.Read())
{
FileLocationData data = null;
string strKey = strDir+"\\"+dr["Location"].ToString().Trim() ;
strKey = Path.GetDirectoryName(strKey) +"\\"+ dr["FileName"].ToString().Trim();
if (extList.TryGetValue(strKey, out data) == false)
{
data = new FileLocationData();
extList.Add(strKey, data);
}
data.Location = dr["Location"].ToString().Trim();
data.DownloadModel = int.Parse( dr["DownloadModel"].ToString());
data.FileName = dr["FileName"].ToString().Trim();
}
}
BeginCheckFile(strDir);
//升级成功
DialogResult = System.Windows.Forms.DialogResult.OK;
if (m_MainFileName != "")
{
if (Directory.Exists(PubUtil.AbsolutelyPath + "tempfiles") == false)
Directory.CreateDirectory(PubUtil.AbsolutelyPath + "tempfiles");
StreamWriter sw = new StreamWriter(PubUtil.AbsolutelyPath + "tempfiles/a_12_m_1z.bat", false, System.Text.Encoding.Default);
foreach (string item in kernalList.Keys)
{
sw.WriteLine("@echo off ");
sw.WriteLine(":delcontinue ");
sw.WriteLine(string.Format("del {0} /f /q ", kernalList[item].FileName));
sw.WriteLine(string.Format("if exist {0} goto delcontinue ", kernalList[item].FileName));
sw.WriteLine(":renamecontinue ");
sw.WriteLine(string.Format("rename {0} {1} ", item, kernalList[item].FileName));
sw.WriteLine(string.Format("if not exist {0} goto renamecontinue ", kernalList[item].FileName));
//sw.WriteLine(string.Format("{0} ", PubUtil.AbsolutelyFileName));
}
//sw.WriteLine("@echo off ");
//sw.WriteLine(":delcontinue ");
//sw.WriteLine(string.Format("del {0} /f /q ", PubUtil.AbsolutelyFileName));
//sw.WriteLine(string.Format("if exist {0} goto delcontinue ", PubUtil.AbsolutelyFileName));
//sw.WriteLine(":renamecontinue ");
//sw.WriteLine(string.Format("rename {0} {1} ", m_MainFileName, Path.GetFileName(PubUtil.AbsolutelyFileName)));
//sw.WriteLine(string.Format("if not exist {0} goto renamecontinue ", PubUtil.AbsolutelyFileName));
//sw.WriteLine(string.Format("{0} ", PubUtil.AbsolutelyFileName));
sw.Flush();
sw.Close();
MessageBox.Show("由于系统发现更新了核心程序,因此需要马上关闭系统进入强制更新程序\r\n更新完成后请重新进入系统!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
PubUtil.WinExec(PubUtil.AbsolutelyPath + "tempfiles/a_12_m_1z.bat", 0);
//MessageBox.Show("由于系统发现更新了核心程序,因此需要马上关闭系统进入强制更新程序\r\n更新完成后请重新进入系统!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
//PubUtil.WinExec(PubUtil.AbsolutelyPath + "UpdateXlFile.exe", 0);
//主程序有更新,必须全部关闭并重启
Application.Exit();
}
}
catch (Exception ex)
{
PubUtil.WriteError("升级出错", ex.Message);
MessageBox.Show("升级出错!请重新登录");
}
}
//拷贝成功的数量
private int m_SuccessCount = 0;
//拷贝失败的数量
private int m_FailedCount = 0;
private void BeginCheckFile(string strDir)
{
string filePath = Application.StartupPath;
progressBar1.Minimum = 0;
string strMainFileName = Path.GetFileName(PubUtil.AbsolutelyFileName);
CopyFile(strDir, filePath + "\\", new byte[102400], strMainFileName);
if (m_SuccessCount != 0 || m_FailedCount != 0)
MessageBox.Show(string.Format("更新完毕,{0}个成功,{1}个失败!", m_SuccessCount, m_FailedCount));
}
/// <summary>
///
/// </summary>
/// <param name="srcdir"></param>
/// <param name="desdir"></param>
private void CopyFile(string srcdir, string desdir, byte[] byteData, string strMainFileName)
{
try
{
if (!Directory.Exists(desdir))
{
Directory.CreateDirectory(desdir);
}
//遍历目录
string[] dirNames = Directory.GetDirectories(srcdir);
foreach (string sDir in dirNames)
{
string[] arr = sDir.Split(new string[]{ "\\"},StringSplitOptions.RemoveEmptyEntries);
string strLastPath = arr[arr.Length-1];
CopyFile(sDir, desdir + strLastPath + "\\", byteData, strMainFileName);
}
string[] filenames = Directory.GetFiles(srcdir);// .GetFileSystemEntries(srcdir);
// 遍历所有的文件和目录
foreach (string file in filenames)
{
string strFileName = Path.GetFileName(file);
string dstFileName = "";
FileLocationData data =null;
int DownloadModel = 1;
if (extList.TryGetValue(srcdir + "\\", out data) || extList.TryGetValue(srcdir + "\\" + strFileName, out data))
{
DownloadModel = data.DownloadModel;
dstFileName = desdir + strFileName;
}
else
{
dstFileName = desdir + strFileName;
}
//只有目标文件存在的情况下才比较
if (File.Exists(dstFileName))
{
//文件版本比较模式下不是最新版本不予下载
if (DownloadModel == 1)
{
System.Diagnostics.FileVersionInfo fiSrc = System.Diagnostics.FileVersionInfo.GetVersionInfo(file);
System.Diagnostics.FileVersionInfo fiDst = System.Diagnostics.FileVersionInfo.GetVersionInfo(dstFileName);
if (string.Compare(fiSrc.FileVersion, fiDst.FileVersion) < 1)
{
FileInfo fiSrc1 = new FileInfo(file);
FileInfo fiDst1 = new FileInfo(dstFileName);
if (fiSrc1.LastWriteTime <= fiDst1.LastWriteTime)
continue;
}
}
//按照最后更新时间模式下不是最新文件不予下载
if (DownloadModel == 0)
{
FileInfo fiSrc = new FileInfo(file);
FileInfo fiDst = new FileInfo(dstFileName);
if (fiSrc.LastWriteTime <= fiDst.LastWriteTime)
continue;
}
}
this.Text = Path.GetFileName(file);
//File.Copy(file, srcfileName, true);无法控制进度
//查看下是否主文件有更新
if (((strMainFileName == Path.GetFileName(dstFileName))) ||
(Path.GetFileName(dstFileName).ToLower() == "commonlib.dll")||
(Path.GetFileName(dstFileName).ToLower() == "controllib.dll")||
(Path.GetFileName(dstFileName).ToLower() == "xlpublic.dll")||
(Path.GetFileName(dstFileName).ToLower() == "delphidll.dll")||
(Path.GetFileName(dstFileName).ToLower() == "publiclibrary.dll"))
{
Random rnd = new Random();
dstFileName = Path.GetFileName(dstFileName);
string srcFileName = Path.GetFileName(dstFileName);
dstFileName = rnd.Next(1000000).ToString() + dstFileName;
dstFileName =desdir + dstFileName;
//MessageBox.Show("destFileName:" + dstFileName + "\n\r sourceFile:"+srcFileName);
m_MainFileName = dstFileName;
string strKey = dstFileName;
if (kernalList.TryGetValue(strKey, out data) == false)
{
data = new FileLocationData();
kernalList.Add(strKey, data);
data.FileName = srcFileName;
}
//ontinue;
}
FileStream fsSource = null;
FileStream fsDest = null;
try
{
fsSource = File.OpenRead(file);
progressBar1.Maximum = (int)fsSource.Length;
progressBar1.Value = 0;
fsDest = File.Create(dstFileName);
while (fsSource.Position < fsSource.Length)
{
int pos = (int)fsSource.Position;
int len = fsSource.Read(byteData, 0, byteData.Length);
fsDest.Write(byteData,0, len);
progressBar1.Value = (int)fsSource.Position;
}
m_SuccessCount++;
}
catch (Exception ex)
{
PubUtil.WriteError("升级出错",ex.Message);
m_FailedCount++;
}
finally
{
if (fsSource != null)
fsSource.Close();
if (fsDest != null)
fsDest.Close();
}
}
}
catch (Exception ex)
{
PubUtil.WriteError("文件升级错误" , ex.Message);
}
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,371 @@
namespace Lskj.Main.sub
{
partial class FrmHistoryMessage
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmHistoryMessage));
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.label1 = new System.Windows.Forms.Label();
this.btnClose = new System.Windows.Forms.Button();
this.btnQuery = new System.Windows.Forms.Button();
this.dtEnd = new System.Windows.Forms.DateTimePicker();
this.dtStart = new System.Windows.Forms.DateTimePicker();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.gvNew = new System.Windows.Forms.DataGridView();
this.ReceivedCount = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.EmployeeName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Sex = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.gvHistory = new System.Windows.Forms.DataGridView();
this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.gvNew)).BeginInit();
this.tabPage2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.gvHistory)).BeginInit();
this.SuspendLayout();
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Margin = new System.Windows.Forms.Padding(0);
this.splitContainer1.Name = "splitContainer1";
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.label1);
this.splitContainer1.Panel1.Controls.Add(this.btnClose);
this.splitContainer1.Panel1.Controls.Add(this.btnQuery);
this.splitContainer1.Panel1.Controls.Add(this.dtEnd);
this.splitContainer1.Panel1.Controls.Add(this.dtStart);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.tabControl1);
this.splitContainer1.Size = new System.Drawing.Size(920, 482);
this.splitContainer1.SplitterDistance = 37;
this.splitContainer1.SplitterWidth = 1;
this.splitContainer1.TabIndex = 0;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(127, 17);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(11, 12);
this.label1.TabIndex = 4;
this.label1.Text = "-";
//
// btnClose
//
this.btnClose.Location = new System.Drawing.Point(426, 10);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(75, 23);
this.btnClose.TabIndex = 3;
this.btnClose.Text = "退出";
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// btnQuery
//
this.btnQuery.Location = new System.Drawing.Point(304, 10);
this.btnQuery.Name = "btnQuery";
this.btnQuery.Size = new System.Drawing.Size(75, 23);
this.btnQuery.TabIndex = 2;
this.btnQuery.Text = "查询";
this.btnQuery.UseVisualStyleBackColor = true;
this.btnQuery.Click += new System.EventHandler(this.btnQuery_Click);
//
// dtEnd
//
this.dtEnd.Format = System.Windows.Forms.DateTimePickerFormat.Short;
this.dtEnd.Location = new System.Drawing.Point(144, 10);
this.dtEnd.Name = "dtEnd";
this.dtEnd.Size = new System.Drawing.Size(109, 21);
this.dtEnd.TabIndex = 1;
//
// dtStart
//
this.dtStart.Format = System.Windows.Forms.DateTimePickerFormat.Short;
this.dtStart.Location = new System.Drawing.Point(12, 12);
this.dtStart.Name = "dtStart";
this.dtStart.Size = new System.Drawing.Size(109, 21);
this.dtStart.TabIndex = 0;
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl1.Location = new System.Drawing.Point(0, 0);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(920, 444);
this.tabControl1.TabIndex = 0;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.gvNew);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(912, 418);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "最新消息";
this.tabPage1.UseVisualStyleBackColor = true;
//
// gvNew
//
this.gvNew.AllowUserToAddRows = false;
this.gvNew.AllowUserToDeleteRows = false;
this.gvNew.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.gvNew.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.ReceivedCount,
this.EmployeeName,
this.Sex,
this.Column2,
this.Column3,
this.Column4});
this.gvNew.Dock = System.Windows.Forms.DockStyle.Fill;
this.gvNew.Location = new System.Drawing.Point(3, 3);
this.gvNew.MultiSelect = false;
this.gvNew.Name = "gvNew";
this.gvNew.ReadOnly = true;
this.gvNew.RowTemplate.Height = 23;
this.gvNew.Size = new System.Drawing.Size(906, 412);
this.gvNew.TabIndex = 2;
//
// ReceivedCount
//
this.ReceivedCount.DataPropertyName = "EmployeeId";
this.ReceivedCount.HeaderText = "标志";
this.ReceivedCount.Name = "ReceivedCount";
this.ReceivedCount.ReadOnly = true;
this.ReceivedCount.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.ReceivedCount.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.ReceivedCount.Width = 40;
//
// EmployeeName
//
this.EmployeeName.DataPropertyName = "HintCreator";
this.EmployeeName.HeaderText = "发送人";
this.EmployeeName.MaxInputLength = 100;
this.EmployeeName.Name = "EmployeeName";
this.EmployeeName.ReadOnly = true;
//
// Sex
//
this.Sex.DataPropertyName = "StartTime";
this.Sex.HeaderText = "发送时间";
this.Sex.MaxInputLength = 10;
this.Sex.Name = "Sex";
this.Sex.ReadOnly = true;
//
// Column2
//
this.Column2.DataPropertyName = "HintContent";
this.Column2.HeaderText = "消息内容";
this.Column2.Name = "Column2";
this.Column2.ReadOnly = true;
this.Column2.Width = 300;
//
// Column3
//
this.Column3.DataPropertyName = "SourceTableName";
this.Column3.HeaderText = "关键字";
this.Column3.Name = "Column3";
this.Column3.ReadOnly = true;
//
// Column4
//
this.Column4.DataPropertyName = "LoginAccount";
this.Column4.HeaderText = "接收人";
this.Column4.Name = "Column4";
this.Column4.ReadOnly = true;
//
// tabPage2
//
this.tabPage2.Controls.Add(this.gvHistory);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(912, 418);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "历史消息";
this.tabPage2.UseVisualStyleBackColor = true;
//
// gvHistory
//
this.gvHistory.AllowUserToAddRows = false;
this.gvHistory.AllowUserToDeleteRows = false;
this.gvHistory.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.gvHistory.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.dataGridViewTextBoxColumn1,
this.dataGridViewTextBoxColumn2,
this.dataGridViewTextBoxColumn3,
this.dataGridViewTextBoxColumn4,
this.dataGridViewTextBoxColumn5,
this.dataGridViewTextBoxColumn6,
this.dataGridViewTextBoxColumn7});
this.gvHistory.Dock = System.Windows.Forms.DockStyle.Fill;
this.gvHistory.Location = new System.Drawing.Point(3, 3);
this.gvHistory.MultiSelect = false;
this.gvHistory.Name = "gvHistory";
this.gvHistory.ReadOnly = true;
this.gvHistory.RowTemplate.Height = 23;
this.gvHistory.Size = new System.Drawing.Size(906, 412);
this.gvHistory.TabIndex = 3;
//
// dataGridViewTextBoxColumn1
//
this.dataGridViewTextBoxColumn1.DataPropertyName = "ReceivedCount";
this.dataGridViewTextBoxColumn1.HeaderText = "标志";
this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
this.dataGridViewTextBoxColumn1.ReadOnly = true;
this.dataGridViewTextBoxColumn1.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.dataGridViewTextBoxColumn1.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.dataGridViewTextBoxColumn1.Width = 40;
//
// dataGridViewTextBoxColumn2
//
this.dataGridViewTextBoxColumn2.DataPropertyName = "HintCreator";
this.dataGridViewTextBoxColumn2.HeaderText = "发送人";
this.dataGridViewTextBoxColumn2.MaxInputLength = 100;
this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
this.dataGridViewTextBoxColumn2.ReadOnly = true;
//
// dataGridViewTextBoxColumn3
//
this.dataGridViewTextBoxColumn3.DataPropertyName = "StartTime";
this.dataGridViewTextBoxColumn3.HeaderText = "发送时间";
this.dataGridViewTextBoxColumn3.MaxInputLength = 10;
this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
this.dataGridViewTextBoxColumn3.ReadOnly = true;
//
// dataGridViewTextBoxColumn4
//
this.dataGridViewTextBoxColumn4.DataPropertyName = "DeleteTime";
this.dataGridViewTextBoxColumn4.HeaderText = "查阅时间";
this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
this.dataGridViewTextBoxColumn4.ReadOnly = true;
//
// dataGridViewTextBoxColumn5
//
this.dataGridViewTextBoxColumn5.DataPropertyName = "HintContent";
this.dataGridViewTextBoxColumn5.HeaderText = "消息内容";
this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5";
this.dataGridViewTextBoxColumn5.ReadOnly = true;
this.dataGridViewTextBoxColumn5.Width = 300;
//
// dataGridViewTextBoxColumn6
//
this.dataGridViewTextBoxColumn6.DataPropertyName = "SourceTableName";
this.dataGridViewTextBoxColumn6.HeaderText = "关键字";
this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
this.dataGridViewTextBoxColumn6.ReadOnly = true;
//
// dataGridViewTextBoxColumn7
//
this.dataGridViewTextBoxColumn7.DataPropertyName = "LoginAccount";
this.dataGridViewTextBoxColumn7.HeaderText = "接收人";
this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7";
this.dataGridViewTextBoxColumn7.ReadOnly = true;
//
// FrmHistoryMessage
//
this.Appearance.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Appearance.Options.UseFont = true;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(920, 482);
this.Controls.Add(this.splitContainer1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.LookAndFeel.SkinName = "Office 2010 Blue";
this.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Office2003;
this.Name = "FrmHistoryMessage";
this.Text = "消息查询";
this.Load += new System.EventHandler(this.FrmHistoryMessage_Load);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel1.PerformLayout();
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.gvNew)).EndInit();
this.tabPage2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.gvHistory)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.Button btnQuery;
private System.Windows.Forms.DateTimePicker dtEnd;
private System.Windows.Forms.DateTimePicker dtStart;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.DataGridView gvNew;
private System.Windows.Forms.DataGridView gvHistory;
private System.Windows.Forms.DataGridViewCheckBoxColumn ReceivedCount;
private System.Windows.Forms.DataGridViewTextBoxColumn EmployeeName;
private System.Windows.Forms.DataGridViewTextBoxColumn Sex;
private System.Windows.Forms.DataGridViewTextBoxColumn Column2;
private System.Windows.Forms.DataGridViewTextBoxColumn Column3;
private System.Windows.Forms.DataGridViewTextBoxColumn Column4;
private System.Windows.Forms.DataGridViewCheckBoxColumn dataGridViewTextBoxColumn1;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn3;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn4;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn5;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn6;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn7;
}
}
@@ -0,0 +1,64 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CommonLib;
using System.Data.SqlClient;
using CommonLib.data;
namespace Lskj.Main.sub
{
public partial class FrmHistoryMessage : FormBase
{
public FrmHistoryMessage()
{
InitializeComponent();
}
private void btnQuery_Click(object sender, EventArgs e)
{
try
{
string strSql = "";
if (this.tabControl1.SelectedIndex == 0)
{
strSql = string.Format(@"select * from P_MsgHintEmployeeTab a WITH (nolock) join P_MessageHintTab b WITH (nolock)
on a.messageid=b.messageid where ((LoginAccount='{0}') or (LoginAccount='{0}')) and starttime>='{1}'
and starttime<'{2}' order by starttime",ERPInfo.Instance.EmployeeName,dtStart.Value,dtEnd.Value);
DataSet dsNew = SqlHelper.ExecuteDataSet(CommandType.Text, strSql, "P_MsgHintEmployeeTab", null);
gvNew.DataSource = dsNew.Tables[0];
}
else
{
strSql = string.Format(@"select * from P_h_MsgHintEmployeeTab a WITH (nolock) join P_h_MessageHintTab b WITH (nolock)
on a.messageid=b.messageid where ((LoginAccount='{0}') or (LoginAccount='{0}'))
and starttime>='{1}' and starttime<'{2}' order by starttime", ERPInfo.Instance.EmployeeName, dtStart.Value, dtEnd.Value);
DataSet dsHistory = SqlHelper.ExecuteDataSet(CommandType.Text, strSql, "P_h_MsgHintEmployeeTab", null);
gvHistory.DataSource = dsHistory.Tables[0];
}
}
catch (Exception ex)
{
PubUtil.WriteError("查询记录出错!",ex.Message);
}
}
private void FrmHistoryMessage_Load(object sender, EventArgs e)
{
gvNew.AutoGenerateColumns = false;
gvHistory.AutoGenerateColumns = false;
btnQuery_Click(null, null);
}
private void btnClose_Click(object sender, EventArgs e)
{
Close();
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,232 @@
namespace Lskj.Main.sub
{
partial class FrmMessage
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmMessage));
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label1 = new System.Windows.Forms.Label();
this.panelContainer = new System.Windows.Forms.Panel();
this.btnClose = new System.Windows.Forms.Button();
this.btnDelAll = new System.Windows.Forms.Button();
this.btnDelSelected = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.menuDelSelect = new System.Windows.Forms.ToolStripMenuItem();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
this.splitContainer2.Panel1.SuspendLayout();
this.splitContainer2.Panel2.SuspendLayout();
this.splitContainer2.SuspendLayout();
this.groupBox1.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
this.SuspendLayout();
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Margin = new System.Windows.Forms.Padding(0);
this.splitContainer1.Name = "splitContainer1";
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.splitContainer2);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.btnClose);
this.splitContainer1.Panel2.Controls.Add(this.btnDelAll);
this.splitContainer1.Panel2.Controls.Add(this.btnDelSelected);
this.splitContainer1.Panel2.Controls.Add(this.label2);
this.splitContainer1.Panel2MinSize = 30;
this.splitContainer1.Size = new System.Drawing.Size(456, 349);
this.splitContainer1.SplitterDistance = 318;
this.splitContainer1.SplitterWidth = 1;
this.splitContainer1.TabIndex = 0;
//
// splitContainer2
//
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer2.Location = new System.Drawing.Point(0, 0);
this.splitContainer2.Name = "splitContainer2";
this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer2.Panel1
//
this.splitContainer2.Panel1.Controls.Add(this.groupBox1);
//
// splitContainer2.Panel2
//
this.splitContainer2.Panel2.Controls.Add(this.panelContainer);
this.splitContainer2.Size = new System.Drawing.Size(456, 318);
this.splitContainer2.SplitterDistance = 26;
this.splitContainer2.TabIndex = 0;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox1.Location = new System.Drawing.Point(0, 0);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(456, 26);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 11);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(197, 12);
this.label1.TabIndex = 18;
this.label1.Text = " 选 | 内容";
//
// panelContainer
//
this.panelContainer.AutoScroll = true;
this.panelContainer.BackColor = System.Drawing.SystemColors.Window;
this.panelContainer.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panelContainer.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelContainer.Location = new System.Drawing.Point(0, 0);
this.panelContainer.Margin = new System.Windows.Forms.Padding(0);
this.panelContainer.Name = "panelContainer";
this.panelContainer.Size = new System.Drawing.Size(456, 288);
this.panelContainer.TabIndex = 20;
//
// btnClose
//
this.btnClose.Location = new System.Drawing.Point(367, 4);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(75, 23);
this.btnClose.TabIndex = 3;
this.btnClose.Text = "退出";
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// btnDelAll
//
this.btnDelAll.Location = new System.Drawing.Point(275, 4);
this.btnDelAll.Name = "btnDelAll";
this.btnDelAll.Size = new System.Drawing.Size(75, 23);
this.btnDelAll.TabIndex = 2;
this.btnDelAll.Text = "全部删除";
this.btnDelAll.UseVisualStyleBackColor = true;
this.btnDelAll.Click += new System.EventHandler(this.btnDelAll_Click);
//
// btnDelSelected
//
this.btnDelSelected.Location = new System.Drawing.Point(184, 4);
this.btnDelSelected.Name = "btnDelSelected";
this.btnDelSelected.Size = new System.Drawing.Size(75, 23);
this.btnDelSelected.TabIndex = 1;
this.btnDelSelected.Text = "删除选中";
this.btnDelSelected.UseVisualStyleBackColor = true;
this.btnDelSelected.Click += new System.EventHandler(this.btnDelSelected_Click);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(3, 9);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(161, 12);
this.label2.TabIndex = 0;
this.label2.Text = "注:红色条目可双击关联模块";
//
// contextMenuStrip1
//
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuDelSelect});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(147, 26);
//
// menuDelSelect
//
this.menuDelSelect.Name = "menuDelSelect";
this.menuDelSelect.Size = new System.Drawing.Size(146, 22);
this.menuDelSelect.Text = "删除选中明细";
this.menuDelSelect.Click += new System.EventHandler(this.menuDelSelect_Click);
//
// FrmMessage
//
this.Appearance.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Appearance.Options.UseFont = true;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(456, 349);
this.Controls.Add(this.splitContainer1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.LookAndFeel.SkinName = "Office 2010 Blue";
this.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Office2003;
this.Name = "FrmMessage";
this.ShowInTaskbar = false;
this.Text = "消息提醒";
this.TopMost = true;
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmMessage_FormClosing);
this.Load += new System.EventHandler(this.FrmMessage_Load);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.Panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.splitContainer2.Panel1.ResumeLayout(false);
this.splitContainer2.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
this.splitContainer2.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.contextMenuStrip1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.SplitContainer splitContainer2;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.Button btnDelAll;
private System.Windows.Forms.Button btnDelSelected;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Panel panelContainer;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem menuDelSelect;
}
}
@@ -0,0 +1,230 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ControlLib.com;
using CommonLib;
using CommonLib.data;
namespace Lskj.Main.sub
{
public partial class FrmMessage : FormBase
{
private static FrmMessage _instance = null;
private FrmMessage()
{
InitializeComponent();
}
public static FrmMessage Instance
{
get {
if (_instance == null)
_instance = new FrmMessage();
return _instance;
}
}
//=============================================================================================================
//主界面上的消息标签
public Label MessageButton;
//消息数
public int MessageCount = 0;
/// <summary>
/// 更新消息数
/// </summary>
/// <param name="dec"></param>
public void UpdateMessageCount(int dec)
{
MessageCount += dec;
if(MessageButton!=null)
MessageButton.Text = "消息:" + MessageCount.ToString();
}
private void FrmMessage_Load(object sender, EventArgs e)
{
//初始化位置
this.Top = Screen.PrimaryScreen.Bounds.Height-this.Height-35;
this.Left = Screen.PrimaryScreen.Bounds.Width-this.Width-2;
}
/// <summary>
/// 添加一条消息
/// </summary>
/// <param name="MessageId"></param>
/// <param name="strInfo"></param>
public void AddItem(int MessageId, string strInfo)
{
SingleSelecter item = new SingleSelecter();
item.SetInfo(MessageId, strInfo);
panelContainer.Controls.Add(item);
item.ContextMenuStrip = this.contextMenuStrip1;
item.LblInfo.DoubleClick += new EventHandler(onItemDoubleClick);
item.LblInfo.Click += new EventHandler(onItemClick);
//if (panelContainer.Controls.Count % 2 == 1)
// item.BackColor = Color.LightSlateGray;
//else
// item.BackColor = Color.White;
Reset();
UpdateMessageCount(1);
}
//增加和删除后重新将panel中的控件排位置
private void Reset()
{
int startY = 0;
for (int i = 0; i < panelContainer.Controls.Count; i++)
{
Control c = panelContainer.Controls[i];
c.Top = startY;
startY += c.Height;
}
}
//删除选中
private void btnDelSelected_Click(object sender, EventArgs e)
{
for(int i=0;i<panelContainer.Controls.Count;)
{
Control c = panelContainer.Controls[i];
SingleSelecter item = (SingleSelecter)c;
if(item!=null && item.Checked)
{
DelMessage0("用户删除信息", item.MessageId);
panelContainer.Controls.Remove(c);
}
else
i++;
}
Reset();
}
//删除所有
private void btnDelAll_Click(object sender, EventArgs e)
{
SqlHelper.ExecuteNonQuery(CommandType.Text, "insert P_H_MsgHintEmployeeTab select *,getdate() from P_MsgHintEmployeeTab where LoginAccount='" + ERPInfo.Instance.OperatorName + "'", null);
SqlHelper.ExecuteNonQuery(CommandType.Text, "delete P_MsgHintEmployeeTab where LoginAccount='" + ERPInfo.Instance.OperatorName + "'", null);
SqlHelper.ExecuteNonQuery(CommandType.Text, "insert P_H_MessageHintTab select *,getdate() from P_MessageHintTab where messageid not in (select messageid from P_H_MessageHintTab)", null);
SqlHelper.ExecuteNonQuery(CommandType.Text, "DELETE P_MessageHintTab where messageid not in(select messageid from P_MsgHintEmployeeTab)", null);
UpdateMessageCount(-MessageCount);
panelContainer.Controls.Clear();
Close();
}
//关闭消息窗体
private void btnClose_Click(object sender, EventArgs e)
{
//这里该怎么处理消息了
//UpdateMessageCount(-MessageCount);
//panelContainer.Controls.Clear();
this.Close();
}
//弹出菜单删除选择项
private void menuDelSelect_Click(object sender, EventArgs e)
{
foreach (Control c in panelContainer.Controls)
{
SingleSelecter item = (SingleSelecter)c;
if (item != null && item.Selected)
{
DelMessage0("用户删除信息", item.MessageId);
panelContainer.Controls.Remove(c);
Reset();
UpdateMessageCount(-1);
return;
}
}
}
//单击到某个容器则修改selected状态
private void onItemClick(object sender, EventArgs e)
{
Label lbl = (Label)sender;
SingleSelecter item = (SingleSelecter)lbl.Parent;
foreach (Control c in panelContainer.Controls)
{
SingleSelecter item1 = (SingleSelecter)c;
if (item1 != null)
item1.Selected = false;
}
item.Selected = true;
}
//双击弹出其他操作窗口
private void onItemDoubleClick(object sender, EventArgs e)
{
Label lbl = (Label)sender;
SingleSelecter item = (SingleSelecter)lbl.Parent;
//string strInfo = item.LblInfo.Text;
//MessageBox.Show(strInfo);
string DllFileName = item.DllName;//除了库名还应提供是delphi还是c#标志
if (DllFileName!="")
{
this.Hide();
//Gtime4id = 1;
//string NewModelFlag = "";
//PubUtil.LoadDll(DllFileName, NewModelFlag);
PubUtil.LoadDelphiDll(PubUtil.AbsolutelyPath + "lib/" + DllFileName, DllFileName, DllFileName, DllFileName, "OK", 100, "");
//rightstr(node.Values[3], 12)
//Gtime4id := 0;
this.Show();
}
}
/// <summary>
/// 查阅消息后处理
/// </summary>
/// <param name="SysMessage"></param>
/// <param name="messageid"></param>
private void DelMessage0(string SysMessage, int messageid)
{
try
{
string strSql = string.Format("update P_MessageHintTab set HintType=0 where HintType=1 and messageid='{0}'", messageid);
SqlHelper.ExecuteNonQuery(CommandType.Text, strSql, null);
// MgePackageDel.messageid := messageid;
// MgePackageDel.SqlValue := IntToStr(messageid) + '|';
// MgePackageDel.LoginAccounts := GOperatorname;
// MgePackageDel.Remark := SysMessage;
// MgePackageDel.OpWay := 4;
// MgePackageDel.ADOSP := pr_MessageHintop;
// PubleUnit.MessAgeMge.FDeleteMessage(MgePackageDel);
}
catch (Exception ex)
{
PubUtil.WriteError("查阅消息后处理出错" , ex.Message);
}
}
/// <summary>
/// 是否可以释放窗体
/// </summary>
public bool CanClose = false;
private void FrmMessage_FormClosing(object sender, FormClosingEventArgs e)
{
if (!CanClose && e.CloseReason == CloseReason.UserClosing)
{
e.Cancel = true;
this.Hide();
}
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,208 @@
namespace Lskj.Main.sub
{
partial class FrmRelogin
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
ControlLib.inh.SearcherPropertyCollector searcherPropertyCollector1 = new ControlLib.inh.SearcherPropertyCollector();
ControlLib.inh.TFieldPropertyData tFieldPropertyData1 = new ControlLib.inh.TFieldPropertyData();
ControlLib.inh.TFieldPropertyData tFieldPropertyData2 = new ControlLib.inh.TFieldPropertyData();
ControlLib.inh.TFieldPropertyData tFieldPropertyData3 = new ControlLib.inh.TFieldPropertyData();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmRelogin));
this.btnQuit = new System.Windows.Forms.Button();
this.btnLogin = new System.Windows.Forms.Button();
this.txtPassword = new System.Windows.Forms.TextBox();
this.lblPwd = new System.Windows.Forms.Label();
this.lblName = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.txtUserName = new ControlLib.inh.AutoSearcher();
this.chkLogin = new DevExpress.XtraEditors.CheckEdit();
((System.ComponentModel.ISupportInitialize)(this.chkLogin.Properties)).BeginInit();
this.SuspendLayout();
//
// btnQuit
//
this.btnQuit.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnQuit.Location = new System.Drawing.Point(236, 152);
this.btnQuit.Name = "btnQuit";
this.btnQuit.Size = new System.Drawing.Size(75, 23);
this.btnQuit.TabIndex = 14;
this.btnQuit.Text = "退出(&Q)";
this.btnQuit.UseVisualStyleBackColor = true;
this.btnQuit.Click += new System.EventHandler(this.btnQuit_Click);
//
// btnLogin
//
this.btnLogin.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnLogin.Location = new System.Drawing.Point(131, 152);
this.btnLogin.Name = "btnLogin";
this.btnLogin.Size = new System.Drawing.Size(94, 23);
this.btnLogin.TabIndex = 13;
this.btnLogin.Text = "重新登陆(&L)";
this.btnLogin.UseVisualStyleBackColor = true;
this.btnLogin.Click += new System.EventHandler(this.btnLogin_Click);
//
// txtPassword
//
this.txtPassword.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtPassword.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtPassword.Location = new System.Drawing.Point(105, 65);
this.txtPassword.MaxLength = 50;
this.txtPassword.Name = "txtPassword";
this.txtPassword.PasswordChar = '*';
this.txtPassword.Size = new System.Drawing.Size(206, 23);
this.txtPassword.TabIndex = 12;
//
// lblPwd
//
this.lblPwd.AutoSize = true;
this.lblPwd.BackColor = System.Drawing.Color.Transparent;
this.lblPwd.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblPwd.Location = new System.Drawing.Point(29, 68);
this.lblPwd.Name = "lblPwd";
this.lblPwd.Size = new System.Drawing.Size(63, 14);
this.lblPwd.TabIndex = 11;
this.lblPwd.Text = "登陆密码";
//
// lblName
//
this.lblName.AutoSize = true;
this.lblName.BackColor = System.Drawing.Color.Transparent;
this.lblName.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblName.Location = new System.Drawing.Point(29, 31);
this.lblName.Name = "lblName";
this.lblName.Size = new System.Drawing.Size(63, 14);
this.lblName.TabIndex = 9;
this.lblName.Text = "用户名称";
//
// label1
//
this.label1.AutoSize = true;
this.label1.ForeColor = System.Drawing.Color.Brown;
this.label1.Location = new System.Drawing.Point(30, 122);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(167, 12);
this.label1.TabIndex = 15;
this.label1.Text = "注意:点退出按钮退出ERP系统";
this.label1.Visible = false;
//
// txtUserName
//
this.txtUserName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtUserName.IsEmpet = false;
this.txtUserName.Location = new System.Drawing.Point(105, 30);
this.txtUserName.MaxLength = 50;
this.txtUserName.Name = "txtUserName";
this.txtUserName.SearchControlPanel = null;
searcherPropertyCollector1.ConvertToChineseSpell = true;
tFieldPropertyData1.FieldCaption = "ID";
tFieldPropertyData1.FieldName = "EmployeeId";
tFieldPropertyData1.FieldWidth = 2000;
tFieldPropertyData1.ShowColumn = true;
tFieldPropertyData2.FieldCaption = "工号";
tFieldPropertyData2.FieldName = "LoginAccount";
tFieldPropertyData2.FieldWidth = 2000;
tFieldPropertyData2.ShowColumn = true;
tFieldPropertyData3.FieldCaption = "姓名";
tFieldPropertyData3.FieldName = "EmployeeName";
tFieldPropertyData3.FieldWidth = 2000;
tFieldPropertyData3.ShowColumn = true;
searcherPropertyCollector1.FieldPropertyList = new ControlLib.inh.TFieldPropertyData[] {
tFieldPropertyData1,
tFieldPropertyData2,
tFieldPropertyData3};
searcherPropertyCollector1.InitSQL = null;
searcherPropertyCollector1.KeyField = "EmployeeId";
searcherPropertyCollector1.QueryField = "EmployeeName";
searcherPropertyCollector1.QuerySQL = "select EmployeeId,LoginAccount,EmployeeName from P_EmployeeTab WHERE sign=0 and U" +
"seFlag=1";
searcherPropertyCollector1.RemarkField = "";
searcherPropertyCollector1.ReturnMaxCount = 2000;
searcherPropertyCollector1.ReturnValueField = "EmployeeId";
searcherPropertyCollector1.SearchMatchWay = ControlLib.inh.TSearchMatchWay.swFuzzy;
searcherPropertyCollector1.ShowFormHeight = 230;
searcherPropertyCollector1.ShowFormWidth = 230;
searcherPropertyCollector1.SQL = "select top 2000 employeeid,loginaccount,employeename from p_employeetab where si" +
"gn=0 and useflag=1";
this.txtUserName.searcherPropertyCollector = searcherPropertyCollector1;
this.txtUserName.Size = new System.Drawing.Size(206, 21);
this.txtUserName.TabIndex = 16;
//
// chkLogin
//
this.chkLogin.Location = new System.Drawing.Point(103, 92);
this.chkLogin.Name = "chkLogin";
this.chkLogin.Properties.Appearance.Font = new System.Drawing.Font("微软雅黑", 10F);
this.chkLogin.Properties.Appearance.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(85)))), ((int)(((byte)(85)))), ((int)(((byte)(85)))));
this.chkLogin.Properties.Appearance.Options.UseFont = true;
this.chkLogin.Properties.Appearance.Options.UseForeColor = true;
this.chkLogin.Properties.Caption = "强制登录";
this.chkLogin.Size = new System.Drawing.Size(85, 25);
this.chkLogin.TabIndex = 18;
//
// FrmRelogin
//
this.Appearance.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Appearance.Options.UseFont = true;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(351, 196);
this.Controls.Add(this.chkLogin);
this.Controls.Add(this.txtUserName);
this.Controls.Add(this.label1);
this.Controls.Add(this.btnQuit);
this.Controls.Add(this.btnLogin);
this.Controls.Add(this.txtPassword);
this.Controls.Add(this.lblPwd);
this.Controls.Add(this.lblName);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.LookAndFeel.SkinName = "Office 2010 Blue";
this.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Office2003;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FrmRelogin";
this.Text = "系统登陆";
this.Load += new System.EventHandler(this.FrmRelogin_Load);
((System.ComponentModel.ISupportInitialize)(this.chkLogin.Properties)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button btnQuit;
private System.Windows.Forms.Button btnLogin;
private System.Windows.Forms.TextBox txtPassword;
private System.Windows.Forms.Label lblPwd;
private System.Windows.Forms.Label lblName;
private System.Windows.Forms.Label label1;
private ControlLib.inh.AutoSearcher txtUserName;
private DevExpress.XtraEditors.CheckEdit chkLogin;
}
}
@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CommonLib;
using Lskj.Main.App_Code;
namespace Lskj.Main.sub
{
public partial class FrmRelogin : FrmLoginBase
{
public FrmRelogin()
{
InitializeComponent();
}
private void btnLogin_Click(object sender, EventArgs e)
{
string strEmployeeId = txtUserName.ReturnValue.ToString();
string strPwd = txtPassword.Text;
bool qzLogin = chkLogin.Checked;
if (Login(strEmployeeId, strPwd, txtUserName.Text.Trim(), qzLogin))
{
ERPInfo.Instance.ExitResult = ENUMCloseAction.caRelogin;
Close();
}
}
private void btnQuit_Click(object sender, EventArgs e)
{
//ERPInfo.Instance.ExitResult = ENUMCloseAction.caClose;
Close();
}
private void FrmRelogin_Load(object sender, EventArgs e)
{
}
}
}
File diff suppressed because it is too large Load Diff