📄 mianfrom.cs
字号:
System.Net.WebClient myWebClient = new System.Net.WebClient();
myWebClient.DownloadFile("http://218.92.102.27/GzWeb/UpdateFiles/Update.xml",UpdateFilePath);
myWebClient.DownloadFile("http://218.92.102.27/GzWeb/UpdateFiles/GzglClientUpdate.exe",Application.StartupPath + "\\GzglClientUpdate.exe");
}
catch
{
MessageBox.Show("未能连接到有效的更新服务器!");
}
#endregion
//声明一个程序信息类
System.Diagnostics.ProcessStartInfo Info = new System.Diagnostics.ProcessStartInfo();
//设置外部程序名
Info.FileName = "GzglClientUpdate.exe";
//设置外部程序的启动参数(命令行参数)为test.txt
Info.Arguments = "test.txt";
//设置外部程序工作目录为 C:\
Info.WorkingDirectory = Application.StartupPath + "\\";
//声明一个程序类
System.Diagnostics.Process Proc ;
try
{
//启动外部程序
Proc = System.Diagnostics.Process.Start(Info);
Application.Exit();
}
catch
{
MessageBox.Show("启动更新程序失败!");
}
}
#endregion
break;
case 8 ://关于
Contacts cc = new Contacts ();
cc.ShowDialog ();
cc.Dispose ();
break;
case 9 ://关于
frmAbout frm = new frmAbout ();
frm.ShowDialog ();
frm.Dispose ();
break;
}
}
/// <summary>
/// 主菜单消息
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void MainMenu_Click(object sender, System.EventArgs e)
{
#region 系统管理
if(sender==miInit)//系统初始化
{
DialogResult result = MessageBox.Show(this, "是否系统初始化", "初始化数据会清空所有数据!", MessageBoxButtons.YesNo,
MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
if(result == DialogResult.Yes)
{
conn.ExecDelete("OrgBase","");//机构
conn.ExecDelete("Person","");//人员
conn.ExecDelete("Person_GZ","");//工资
conn.ExecDelete("Person_GZBase","");
conn.ExecDelete("Person_JC","");
conn.ExecDelete("Person_JX","");
conn.ExecDelete("Person_KH","");
conn.ExecDelete("Person_Other","");
conn.ExecDelete("Person_RZ","");
conn.ExecDelete("Person_SY","");
conn.ExecDelete("Person_XL","");
conn.ExecDelete("Person_ZZ","");
conn.ExecDelete("YWItem","");
MessageBox.Show("清除数据成功!");
}
}
if(sender==miBackUp)//系统备份
{
}
if(sender==miRev)//系统还原
{
}
if(sender==miChangePwd)//修改密码
{
ChangePwd cp = new ChangePwd();
cp.ShowDialog();
cp.Dispose();
}
if(sender==miSystemConfig)
{
frmSystemConfig fsc = new frmSystemConfig();
fsc.ShowDialog();
fsc.Dispose();
}
if(sender==miExit)//退出
{
Application.Exit();
}
#endregion
#region 单位
else if(sender==miOrgBase)//获取数据
{
ChangeView(ViewType.OrgBase);
barLeft.Groups["Group1"].Selected = true;
}
#endregion
#region 人员
else if(sender==miPersonList)//获取数据
{
ChangeView(ViewType.PersonList);
barLeft.Groups["Group2"].Selected = true;
}
#endregion
#region 业务
else if(sender==miTaoGai)//获取数据
{
ChangeView(ViewType.TaoGai);
}
#endregion
#region 数据管理
else if(sender==miGetData)//获取数据
{
frmGetData fgd = new frmGetData();
fgd.ShowDialog ();
fgd.Dispose ();
}
else if(sender==miUpdateData)//上报数据
{
frmDataUpdate fdu = new frmDataUpdate();
fdu.ShowDialog ();
fdu.Dispose ();
}
else if(sender==miReceiveData)//接收数据
{
}
else if(sender==miCheckData)//检查数据
{
}
#endregion
else if(sender==miAppUpdate)
{
#region 打开更新程序
DialogResult result = MessageBox.Show(this, "是否要强制更新程序?", "更新程序!", MessageBoxButtons.YesNo,
MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
if(result == DialogResult.Yes)
{
string UpdatePath = Application.StartupPath + "\\Update";
string UpdateFilePath = UpdatePath + "\\Update.xml";
#region 下载更新文件
try
{
System.Net.WebClient myWebClient = new System.Net.WebClient();
myWebClient.DownloadFile("http://218.92.102.27/GzWeb/UpdateFiles/Update.xml",UpdateFilePath);
myWebClient.DownloadFile("http://218.92.102.27/GzWeb/UpdateFiles/GzglClientUpdate.exe",Application.StartupPath + "\\GzglClientUpdate.exe");
}
catch
{
MessageBox.Show("未能连接到有效的更新服务器!");
}
#endregion
//声明一个程序信息类
System.Diagnostics.ProcessStartInfo Info = new System.Diagnostics.ProcessStartInfo();
//设置外部程序名
Info.FileName = "GzglClientUpdate.exe";
//设置外部程序的启动参数(命令行参数)为test.txt
Info.Arguments = "test.txt";
//设置外部程序工作目录为 C:\
Info.WorkingDirectory = Application.StartupPath + "\\";
//声明一个程序类
System.Diagnostics.Process Proc ;
try
{
//启动外部程序
Proc = System.Diagnostics.Process.Start(Info);
Application.Exit();
}
catch
{
MessageBox.Show("启动更新程序失败!");
}
}
#endregion
}
else if(sender==miAbout)//关于
{
frmAbout frm = new frmAbout();
frm.ShowDialog ();
frm.Dispose ();
}
}
private void barLeft_ItemClick(object sender, Janus.Windows.ButtonBar.ItemEventArgs e)
{
#region 单位管理
if(e.Item.Text =="单位信息")
{
ChangeView(ViewType.OrgBaseIE);
orgbaseie.GoUrl("","0");
ShowText("当前栏目:单位信息");
}
#endregion
#region 人员管理
if(e.Item.Text =="人员列表")
{
ChangeView(ViewType.PersonIE);
personie.GoUrl("","0");
ShowText("当前栏目:人员列表");
}
#endregion
#region 业务
if(e.Item.Text =="所有业务")
{
ChangeView(ViewType.NetOfficeIE);
netofficeie.GoUrl("","0");
ShowText("当前栏目:业务-所有业务");
}
if(e.Item.Text =="工资套改")
{
ChangeView(ViewType.NetOfficeIE);
netofficeie.GoUrl("","10");
ShowText("当前栏目:业务-工资套改");
}
if(e.Item.Text =="试用期")
{
ChangeView(ViewType.NetOfficeIE);
netofficeie.GoUrl("","1");
ShowText("当前栏目:业务-试用期");
}
if(e.Item.Text =="转正定级")
{
ChangeView(ViewType.NetOfficeIE);
netofficeie.GoUrl("","2");
ShowText("当前栏目:业务-转正定级");
}
if(e.Item.Text =="职务变动")
{
ChangeView(ViewType.NetOfficeIE);
netofficeie.GoUrl("","7");
ShowText("当前栏目:业务-职务变动");
}
if(e.Item.Text =="同性质单位调动")
{
ChangeView(ViewType.NetOfficeIE);
netofficeie.GoUrl("","5");
ShowText("当前栏目:业务-同性质单位调动");
}
if(e.Item.Text =="退休")
{
ChangeView(ViewType.NetOfficeIE);
netofficeie.GoUrl("","6");
ShowText("当前栏目:业务-退休");
}
if(e.Item.Text =="系统外单位调入")
{
ChangeView(ViewType.NetOfficeIE);
netofficeie.GoUrl("","9");
ShowText("当前栏目:业务-系统外单位调入");
}
if(e.Item.Text =="晋升学历")
{
ChangeView(ViewType.NetOfficeIE);
netofficeie.GoUrl("","11");
ShowText("当前栏目:业务-晋升学历");
}
if(e.Item.Text =="正常晋升")
{
ChangeView(ViewType.NetOfficeIE);
netofficeie.GoUrl("","3");
ShowText("当前栏目:业务-正常晋升");
}
if(e.Item.Text =="考核结果")
{
ChangeView(ViewType.NetOfficeIE);
netofficeie.GoUrl("","12");
ShowText("当前栏目:业务-考核结果");
}
if(e.Item.Text =="人员出库")
{
ChangeView(ViewType.NetOfficeIE);
netofficeie.GoUrl("","13");
ShowText("当前栏目:业务-人员出库");
}
if(e.Item.Text =="浮转固")
{
ChangeView(ViewType.NetOfficeIE);
netofficeie.GoUrl("","14");
ShowText("当前栏目:业务-浮转固");
}
if(e.Item.Text =="退伍战士")
{
ChangeView(ViewType.NetOfficeIE);
netofficeie.GoUrl("","15");
ShowText("当前栏目:业务-退伍战士");
}
if(e.Item.Text =="变动工资序列")
{
ChangeView(ViewType.NetOfficeIE);
netofficeie.GoUrl("","16");
ShowText("当前栏目:业务-变动工资序列");
}
if(e.Item.Text =="绩效工资")
{
ChangeView(ViewType.NetOfficeIE);
netofficeie.GoUrl("","17");
ShowText("当前栏目:业务-绩效工资");
}
if(e.Item.Text =="保留津贴")
{
ChangeView(ViewType.NetOfficeIE);
netofficeie.GoUrl("","18");
ShowText("当前栏目:业务-保留津贴");
}
if(e.Item.Text =="遗属补助")
{
ChangeView(ViewType.NetOfficeIE);
netofficeie.GoUrl("","21");
ShowText("当前栏目:业务-遗属补助");
}
if(e.Item.Text =="退休后单位调动")
{
ChangeView(ViewType.NetOfficeIE);
netofficeie.GoUrl("","20");
ShowText("当前栏目:业务-退休后单位调动");
}
if(e.Item.Text =="高定低定")
{
ChangeView(ViewType.NetOfficeIE);
netofficeie.GoUrl("","19");
ShowText("当前栏目:业务-高定低定");
}
if(e.Item.Text =="增加比例")
{
ChangeView(ViewType.NetOfficeIE);
netofficeie.GoUrl("","22");
ShowText("当前栏目:业务-增加比例");
}
#endregion
#region 审核
if(e.Item.Text =="业务审核")
{
ChangeView(ViewType.ZGBMIE);
zgbmie.GoUrl("","0");
ShowText("当前栏目:业务审核");
}
#endregion
#region 公务员处
if(e.Item.Text =="考核管理")
{
ChangeView(ViewType.NetOfficeIE_GWY);
netofficeie_gwy.GoUrl("","A001");
ShowText("当前栏目:业务:公务员处--考核管理");
}
#endregion
#region 职称处
if(e.Item.Text =="专技职务聘任备案")
{
ChangeView(ViewType.NetOfficeIE_ZCGL);
netofficeie_zcgl.GoUrl("","ZCSB");
ShowText("当前栏目:业务:职称处--专技职务聘任备案");
}
#endregion
else if(e.Item.Text =="标准表效验")
{
ChangeView(ViewType.DataIn);
}
}
#endregion
private void menuItem3_Click(object sender, System.EventArgs e)
{
//声明一个程序信息类
System.Diagnostics.ProcessStartInfo Info = new System.Diagnostics.ProcessStartInfo();
//设置外部程序名
Info.FileName = "工资管理软件网上操作说明.doc";
//设置外部程序的启动参数(命令行参数)为test.txt
Info.Arguments = "test.txt";
//设置外部程序工作目录为 C:\
Info.WorkingDirectory = Application.StartupPath + "\\";
//声明一个程序类
System.Diagnostics.Process Proc ;
try
{
//启动外部程序
Proc = System.Diagnostics.Process.Start(Info);
}
catch
{
MessageBox.Show("打开帮助文档失败!");
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -