基线 SVN r240
SVN-Revision: r240
This commit is contained in:
@@ -0,0 +1,780 @@
|
||||
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 DevExpress.XtraGrid.Views.Grid;
|
||||
using Lskj.Control;
|
||||
using Lskj.Core;
|
||||
using Lskj.Util;
|
||||
using Lskj.Business.Impl;
|
||||
using Lskj.Model;
|
||||
using Lskj.Data;
|
||||
using Lskj.Notice.Properties;
|
||||
using DevExpress.XtraGrid;
|
||||
using Lskj.Business;
|
||||
|
||||
namespace Lskj.Notice
|
||||
{
|
||||
/// <summary>
|
||||
/// 通知界面
|
||||
/// </summary>
|
||||
public partial class FrmMain : BaseForm
|
||||
{
|
||||
string mUserID;
|
||||
string mUserName;
|
||||
string mUserPassword;
|
||||
private bool blink = false;
|
||||
private Icon blank = Resources.blank;
|
||||
private Icon striped = Resources.logo;
|
||||
private bool mouseinform = false;
|
||||
|
||||
private int LastRowCount;//上一次记录的行数
|
||||
private bool FirstEntry=true;//是否是第一次进入
|
||||
/// <summary>
|
||||
/// 语言设置,设置后为true
|
||||
/// </summary>
|
||||
public bool LanguageSettings = false;
|
||||
/// <summary>
|
||||
/// 语言
|
||||
/// </summary>
|
||||
public string Language;
|
||||
/// <summary>
|
||||
/// 语言设置,设置后为true
|
||||
/// </summary>
|
||||
// public bool LanguageSettings = false;
|
||||
|
||||
public FrmMain(string[] args)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.gridView.DoubleClick += new EventHandler(OnGridViewDoubleClick);
|
||||
|
||||
if (args != null && args.Length > 1)
|
||||
{
|
||||
this.mUserID = args[0];
|
||||
this.mUserName = args[1];
|
||||
this.mUserPassword = args[2];
|
||||
}
|
||||
this.tsmiShowWindow.Checked = DBConfig.Instance.NoticeShowWindow;//新消息弹窗
|
||||
this.tsmiFlicker.Checked = DBConfig.Instance.NoticeFlicker;//新消息闪烁
|
||||
this.tsmiExitByMain.Checked = DBConfig.Instance.NoticeExit;//随主系统退出
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:显示窗口</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2019-09-10 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
void ThreadShowFrom()
|
||||
{
|
||||
int x = Screen.PrimaryScreen.WorkingArea.Width - this.Width;
|
||||
int y = Screen.PrimaryScreen.WorkingArea.Height - this.Height;
|
||||
this.SetDesktopLocation(x, y);
|
||||
|
||||
//Point p = new Point(Screen.PrimaryScreen.WorkingArea.Width - this.Width, Screen.PrimaryScreen.WorkingArea.Height - this.Height);
|
||||
//this.PointToClient(p);
|
||||
//this.Location = p;
|
||||
//this.Show();
|
||||
|
||||
//for (int i = 0; i < this.Height; i++)
|
||||
//{
|
||||
// this.Location = new Point(p.X, p.Y - i);
|
||||
// System.Threading.Thread.Sleep(1);
|
||||
//}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:显示普通窗口</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2019-09-10 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
void NormalShowForm()
|
||||
{
|
||||
if (this.WindowState == FormWindowState.Minimized)
|
||||
{
|
||||
this.Activate();
|
||||
this.WindowState = FormWindowState.Normal;
|
||||
this.ShowInTaskbar = true;
|
||||
this.notifyIcon1.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:重新加载表格数据</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2019-09-10 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
void ReloadGridData()
|
||||
{
|
||||
try
|
||||
{
|
||||
DBConfig.Instance.ReadConfig();
|
||||
DBConfig.Instance.CreateConnection();
|
||||
|
||||
ERPInfo.Instance.UserId = DBConfig.Instance.NoticeUserID;
|
||||
ERPInfo.Instance.UserName = DBConfig.Instance.NoticeUserName;
|
||||
ERPInfo.Instance.Password = mUserPassword;
|
||||
mUserName = DBConfig.Instance.NoticeUserName;
|
||||
|
||||
//判断是否存在多语种的情况
|
||||
if (!LanguageSettings)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(ERPInfo.Instance.UserId))
|
||||
{
|
||||
string sql = string.Format("select useLanguage from P_EmployeeTab where EmployeeId='{0}'", ERPInfo.Instance.UserId);
|
||||
this.Language = SqlHelper.ExecuteScalar(sql) + "";
|
||||
if (string.IsNullOrWhiteSpace(this.Language)) this.Language = "中文";
|
||||
ERPInfo.Instance.LanguageName = this.Language;
|
||||
this.LanguageSettings = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
string sqlStr = string.Empty;
|
||||
DataTable data = NoticeImpl.GetNoticeData2(ERPInfo.Instance.UserId,out sqlStr);
|
||||
|
||||
|
||||
int rowCount = data == null ? 0 : data.Rows.Count;
|
||||
|
||||
this.gridControlEx.DataSource = data;
|
||||
this.Text = "您有" + rowCount + "条任务需要处理(提示:双击即可处理).";
|
||||
|
||||
|
||||
|
||||
if (rowCount > 0)
|
||||
{
|
||||
// 开启新消息弹窗
|
||||
if (this.tsmiShowWindow.Checked)
|
||||
{
|
||||
this.NormalShowForm();
|
||||
}
|
||||
// 开启、关闭新消息闪烁
|
||||
if (FirstEntry)
|
||||
{
|
||||
this.blinkTimer.Enabled = this.tsmiFlicker.Checked;
|
||||
FirstEntry = false;
|
||||
}
|
||||
|
||||
|
||||
//开启了闪烁,并且当前数量大于上一次数量,才闪烁
|
||||
if (this.tsmiFlicker.Checked && rowCount > LastRowCount && this.timer3.Enabled)
|
||||
{
|
||||
this.blinkTimer.Enabled = this.tsmiFlicker.Checked;
|
||||
}
|
||||
LastRowCount = rowCount;
|
||||
}
|
||||
else
|
||||
{
|
||||
//this.WindowState = FormWindowState.Minimized;
|
||||
this.blinkTimer.Enabled = false;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 打开基础或单据模块审批模块
|
||||
/// </summary>
|
||||
void OpenAuditControl(DataRow rowItem)
|
||||
{
|
||||
try
|
||||
{
|
||||
bool isCustomNotice = false;
|
||||
string BetweenDLLCoid = string.Empty;
|
||||
String[] AutoParame = rowItem["dllname"].ToString().Split('^');
|
||||
if (AutoParame.Count() >= 4)
|
||||
{
|
||||
rowItem["dllname"] = AutoParame[0];
|
||||
rowItem["keyvalue"] = AutoParame[1];
|
||||
rowItem["modulename"] = AutoParame[2];
|
||||
if (AutoParame[0].Equals("MiniBlink.dll", StringComparison.CurrentCultureIgnoreCase) || AutoParame[0].Equals("Lskj.PubBrower.dll", StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
BetweenDLLCoid = AutoParame[3];
|
||||
}
|
||||
else
|
||||
{
|
||||
rowItem["stepcode"] = AutoParame[3];
|
||||
}
|
||||
isCustomNotice = true;
|
||||
}
|
||||
string[] defaultArgs = string.Format(ModuleArgs.DefaultArgs, rowItem["modulename"] + "", ERPInfo.Instance.UserId, ERPInfo.Instance.UserName, 1, rowItem["moduleid"] + "").Split('~');
|
||||
string[] menuArgs = new string[] { "0", rowItem["moduleid"] + "", rowItem["stepcode"] + "", rowItem["keyvalue"] + "", "0", "0" };
|
||||
string dllName = rowItem["dllname"] + "";
|
||||
dllName = dllName.ToLower();
|
||||
|
||||
switch (dllName)
|
||||
{
|
||||
case "lskj.baseinfo.dll":
|
||||
menuArgs = new string[] { "1", rowItem["moduleid"] + "", rowItem["keyvalue"] + "" };
|
||||
break;
|
||||
case "lskj.pubbillinfo.dll":
|
||||
menuArgs = new string[] { rowItem["moduleid"] + "", rowItem["keyvalue"] + "", rowItem["modulename"] + "", rowItem["stepcode"] + "" };
|
||||
break;
|
||||
case "lskj.pubbill.dll":
|
||||
menuArgs = new string[] { "", rowItem["moduleid"] + "" };
|
||||
break;
|
||||
case "lskj.pubmoduledetail.dll":
|
||||
menuArgs = new string[] { "", rowItem["moduleid"] + "" };
|
||||
break;
|
||||
case "miniblink.dll":
|
||||
menuArgs = new string[] { "", rowItem["keyvalue"] + "", BetweenDLLCoid };
|
||||
break;
|
||||
case "pubbrower.dll":
|
||||
menuArgs = new string[] { "", rowItem["keyvalue"] + "", BetweenDLLCoid };
|
||||
break;
|
||||
case "lskj.pubbrower.dll":
|
||||
menuArgs = new string[] { "", rowItem["keyvalue"] + "", BetweenDLLCoid };
|
||||
break;
|
||||
}
|
||||
if ("2".Equals(rowItem["messid"] + ""))
|
||||
{
|
||||
menuArgs = new string[] { "0", rowItem["moduleid"] + "", rowItem["stepcode"] + "", rowItem["keyvalue"] + "", "1", "0" };
|
||||
}
|
||||
string[] args = defaultArgs.Concat(menuArgs).ToArray();
|
||||
IForm form = FormHelper.LoadDllForm(dllName, args);
|
||||
if (dllName.Equals("miniblink.dll")) form.SubForm.WindowState = FormWindowState.Maximized;
|
||||
if (dllName.Equals("lskj.pubmoduledetail.dll")|| dllName.Equals("lskj.pubbill.dll")) form.SubForm.WindowState = FormWindowState.Maximized;//默认全部最大化
|
||||
|
||||
DialogResult result = form.SubForm.ShowDialog();
|
||||
if (result != DialogResult.OK && ("1".Equals(rowItem["messid"] + "") || "2".Equals(rowItem["messid"] + "")))
|
||||
{
|
||||
//if ("2".Equals(rowItem["messid"] + ""))
|
||||
//{
|
||||
// NoticeImpl.UpdRemindField(rowItem, dllName);
|
||||
//}
|
||||
NoticeImpl.UpeNoticeData(rowItem, isCustomNotice);
|
||||
string sqlStr = string.Empty;
|
||||
DataTable data = NoticeImpl.GetNoticeData2(ERPInfo.Instance.UserId,out sqlStr);
|
||||
int rowCount = data == null ? 0 : data.Rows.Count;
|
||||
this.gridControlEx.DataSource = data;
|
||||
this.Text = "您有" + rowCount + "条任务需要处理(提示:双击即可处理).";
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//MessageUtil.Show(ex);
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:窗户加载</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2019-09-10 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The sender.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
void OnMainLoad(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
DBConfig.Instance.CreateConnection();
|
||||
|
||||
if (!DBConfig.Instance.CreateConnection(DBConfig.Instance.Connection))
|
||||
{
|
||||
MessageUtil.Show(ResourceKeys.ServerAddressFault);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (DelphiHelper.Delphi_Init(new StringBuilder(DBConfig.Instance.GetDelphiConnection(DBConfig.Instance.dephiConnection))) == 0)
|
||||
{
|
||||
MessageUtil.Show(ResourceKeys.UnConnectServer + "[By Delphi]");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!BaseImpl.HasExistsTable("p_systemNoticeSheet"))
|
||||
{
|
||||
NoticeImpl.CreationNoticeTable();
|
||||
}
|
||||
//判断是否存在多语种的情况
|
||||
if (BaseImpl.HasExistsColumn("P_EmployeeTab", "useLanguage"))
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(ERPInfo.Instance.UserId))
|
||||
{
|
||||
string sql = string.Format("select useLanguage from P_EmployeeTab where EmployeeId='{0}'", ERPInfo.Instance.UserId);
|
||||
this.Language = SqlHelper.ExecuteScalar(sql)+"";
|
||||
if (string.IsNullOrWhiteSpace(this.Language)) this.Language = "中文";
|
||||
ERPInfo.Instance.LanguageName = this.Language;
|
||||
this.LanguageSettings = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.LanguageSettings = true;
|
||||
this.Language = "中文";
|
||||
}
|
||||
|
||||
SetDelphiDllParams();
|
||||
this.tsmiFlicker.Checked = DBConfig.Instance.NoticeFlicker;
|
||||
this.tsmiShowWindow.Checked = DBConfig.Instance.NoticeShowWindow;
|
||||
string sqlStr = string.Empty;
|
||||
DataTable data = NoticeImpl.GetNoticeData2(ERPInfo.Instance.UserId,out sqlStr);
|
||||
int rowCount = data == null ? 0 : data.Rows.Count;
|
||||
this.gridControlEx.DataSource = data;
|
||||
this.Text = "您有" + rowCount + "条任务需要处理(提示:双击即可处理).";
|
||||
this.ThreadShowFrom();
|
||||
if (rowCount == 0)
|
||||
this.WindowState = FormWindowState.Minimized;
|
||||
|
||||
if (SystemInfo.Instance.MessageRefreshTime > 0) this.timer3.Interval = SystemInfo.Instance.MessageRefreshTime * 1000;
|
||||
if (SystemInfo.Instance.MessageFlicker) this.tsmiFlicker.Checked = DBConfig.Instance.NoticeFlicker = true;
|
||||
|
||||
this.timer3.Start();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
Lskj.Control.Model.AutoSizeChange.ControllInitializeSize(this);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:重新加载数据</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2019-09-10 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The sender.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
void OnTimerReloadTick(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!mouseinform)
|
||||
{
|
||||
this.ReloadGridData();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:点击打开审批界面</para>
|
||||
/// <para>创建人:王一帆</para>
|
||||
/// <para>创建日期:2020-08-03 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The sender.</param>
|
||||
/// <param name="e">The <see cref="DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs"/> instance containing the event data.</param>
|
||||
void OnGridViewDoubleClick(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
DataRow rowItem = this.gridView.GetFocusedDataRow();
|
||||
|
||||
if (rowItem != null)
|
||||
{
|
||||
//设置第一次点击时间
|
||||
if (rowItem.Table.Columns.Contains("FirstViewTime"))
|
||||
{
|
||||
string tableName = rowItem["TableName"]+"";
|
||||
string id= rowItem["id"]+"";
|
||||
if (tableName.Equals("p_systemMessageTab")&&string.IsNullOrWhiteSpace(rowItem["FirstViewTime"] + ""))
|
||||
{
|
||||
NoticeImpl.UpeNoticeData(tableName, id);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (rowItem["messid"] + "" == "1" && string.IsNullOrWhiteSpace(rowItem["dllname"] + ""))
|
||||
{
|
||||
// 保存小类设置
|
||||
FrmNoticePrompt frmNoticePrompt = new FrmNoticePrompt();
|
||||
frmNoticePrompt.TextBoxObj.Text = BaseImpl.HasExistsTable("p_systemMessageTab") ? rowItem["keyvalue"] + "" : rowItem["Msg"] + "";
|
||||
if (frmNoticePrompt.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
NoticeImpl.UpeNoticeData(rowItem);
|
||||
string sqlStr = string.Empty;
|
||||
DataTable data = NoticeImpl.GetNoticeData2(ERPInfo.Instance.UserId,out sqlStr);
|
||||
int rowCount = data == null ? 0 : data.Rows.Count;
|
||||
this.gridControlEx.DataSource = data;
|
||||
this.Text = "您有" + rowCount + "条任务需要处理(提示:双击即可处理).";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
OpenAuditControl(rowItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:最小化到托盘</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2019-09-10 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The sender.</param>
|
||||
/// <param name="e">The <see cref="FormClosingEventArgs"/> instance containing the event data.</param>
|
||||
void OnMainFormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.WindowState = FormWindowState.Minimized;
|
||||
e.Cancel = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:显示窗口</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2019-09-10 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The sender.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
void OnTsmiShowClick(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.NormalShowForm();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:退出系统</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2019-09-10 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The sender.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
void OnTsmiCloseClick(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (MessageUtil.Show("确定要退出任务监视工具?\r\n退后后将无法收到审批消息.", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
|
||||
{
|
||||
try
|
||||
{
|
||||
notifyIcon1.Dispose();
|
||||
this.Dispose();
|
||||
this.Close();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:窗口最小化时显示图标</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2019-09-10 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The sender.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
void OnFrmMainSizeChanged(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (WindowState == FormWindowState.Minimized)
|
||||
{
|
||||
this.ShowInTaskbar = false;
|
||||
this.notifyIcon1.Visible = true;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:左键点击打开消息列表</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2019-09-10 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The sender.</param>
|
||||
/// <param name="e">The <see cref="MouseEventArgs"/> instance containing the event data.</param>
|
||||
void OnNotifyIconMouseClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (e.Button == System.Windows.Forms.MouseButtons.Left)
|
||||
{
|
||||
this.NormalShowForm();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:闪烁图标</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期: </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The sender.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
void OnBlinkTimerTick(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!blink)
|
||||
{
|
||||
this.notifyIcon1.Icon = striped;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.notifyIcon1.Icon = blank;
|
||||
}
|
||||
blink = !blink;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期: </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
void OnTsmiShowWindowClick(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.tsmiShowWindow.Checked = !this.tsmiShowWindow.Checked;
|
||||
DBConfig.Instance.NoticeShowWindow = this.tsmiShowWindow.Checked;
|
||||
DBConfig.Instance.WriteConfig();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期: </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
void OnTsmiFlickerClick(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.tsmiFlicker.Checked = !this.tsmiFlicker.Checked;
|
||||
DBConfig.Instance.NoticeFlicker = this.tsmiFlicker.Checked;
|
||||
DBConfig.Instance.WriteConfig();
|
||||
blink = false;
|
||||
this.notifyIcon1.Icon = striped;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:随主系统退出</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期: </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The sender.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
void OnTsmiExitByMainClick(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.tsmiExitByMain.Checked = !this.tsmiExitByMain.Checked;
|
||||
DBConfig.Instance.NoticeExit = this.tsmiExitByMain.Checked;
|
||||
DBConfig.Instance.WriteConfig();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:清除所有标识为1的消息</para>
|
||||
/// <para>创建人:王一帆</para>
|
||||
/// <para>创建日期: </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The sender.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
private void OnTsmiCleanAllClick(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
NoticeImpl.UpeNoticeData("1");
|
||||
string sqlStr = string.Empty;
|
||||
DataTable data = NoticeImpl.GetNoticeData2(ERPInfo.Instance.UserId,out sqlStr);
|
||||
int rowCount = data == null ? 0 : data.Rows.Count;
|
||||
this.gridControlEx.DataSource = data;
|
||||
this.Text = "您有" + rowCount + "条任务需要处理(提示:双击即可处理).";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:鼠标进入窗体事件</para>
|
||||
/// <para>创建人:王一帆</para>
|
||||
/// <para>创建日期: </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The sender.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
private void OnTsmiMouseEnter(object sender, EventArgs e)
|
||||
{
|
||||
mouseinform = true;
|
||||
this.blinkTimer.Enabled = false;
|
||||
this.notifyIcon1.Icon = striped;
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:鼠标离开窗体事件</para>
|
||||
/// <para>创建人:王一帆</para>
|
||||
/// <para>创建日期: </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The sender.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
private void OnTsmiMouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
mouseinform = false;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置delphi参数</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-03-12 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
private void SetDelphiDllParams()
|
||||
{
|
||||
try
|
||||
{
|
||||
StringBuilder sb1 = new StringBuilder();
|
||||
sb1.Append(ERPInfo.Instance.UserName);
|
||||
|
||||
StringBuilder sb2 = new StringBuilder();
|
||||
sb2.Append(ERPInfo.Instance.WindowName);
|
||||
|
||||
StringBuilder sb3 = new StringBuilder();
|
||||
sb3.Append(ERPInfo.Instance.SkinName);
|
||||
|
||||
//给delphi库设置参数(用户id、子系统id、操作员名称、计算机名称)
|
||||
DelphiHelper.Delphi_SetParams(Convert.ToInt32(ERPInfo.Instance.UserId), Convert.ToInt32(ERPInfo.Instance.SubSysId), sb1, sb2, sb3);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message, ex.Message);
|
||||
LogHelper.Instance.WriteError(ex);
|
||||
//LogUtil.WriteError("设置delphi参数错误", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user