private void ViewConTemp_Load(object sender, EventArgs e) { try { Templete temp = new Templete(); temp = _sc.GetContractTemplate(Id); this.ConTempName.Text = temp.Name.ToString(); this.Column1.Text = temp.ColumnNames[0].ToString(); this.Column2.Text = temp.ColumnNames[1].ToString(); this.Column3.Text = temp.ColumnNames[2].ToString(); this.Column4.Text = temp.ColumnNames[3].ToString(); this.Column5.Text = temp.ColumnNames[4].ToString(); this.Sign1.Text = temp.SignDatas[0].SignInfo.ToString(); this.Sign2.Text = temp.SignDatas[1].SignInfo.ToString(); this.Sign3.Text = temp.SignDatas[2].SignInfo.ToString(); this.Sign4.Text = temp.SignDatas[3].SignInfo.ToString(); this.Sign5.Text = temp.SignDatas[4].SignInfo.ToString(); this.Sign6.Text = temp.SignDatas[5].SignInfo.ToString(); this.Sign7.Text = temp.SignDatas[6].SignInfo.ToString(); this.Sign8.Text = temp.SignDatas[7].SignInfo.ToString(); this.SignPer1.Text = temp.SignDatas[0].SignEmployee.Name.ToString(); this.SignPer2.Text = temp.SignDatas[1].SignEmployee.Name.ToString(); this.SignPer3.Text = temp.SignDatas[2].SignEmployee.Name.ToString(); this.SignPer4.Text = temp.SignDatas[3].SignEmployee.Name.ToString(); this.SignPer5.Text = temp.SignDatas[4].SignEmployee.Name.ToString(); this.SignPer6.Text = temp.SignDatas[5].SignEmployee.Name.ToString(); this.SignPer7.Text = temp.SignDatas[6].SignEmployee.Name.ToString(); this.SignPer8.Text = temp.SignDatas[7].SignEmployee.Name.ToString(); } catch { MessageBox.Show("加载数据失败!"); Logging.AddLog("查看模板详细信息失败!"); if (MessageBox.Show("好吧,我们的程序出现点问题需要重新启动\n点击\"确定\"重启\n点击\"取消\"退出程序?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) { Application.Restart(); } else { Application.Exit(); } } }
/// <summary> /// 保存为新模版 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonSaveNew_Click(object sender, EventArgs e) { if (this.CheckIntegrity() == false) { return; } Templete temp = new Templete(); SignatureTemplate signtemp1 = new SignatureTemplate(); SignatureTemplate signtemp2 = new SignatureTemplate(); SignatureTemplate signtemp3 = new SignatureTemplate(); SignatureTemplate signtemp4 = new SignatureTemplate(); SignatureTemplate signtemp5 = new SignatureTemplate(); SignatureTemplate signtemp6 = new SignatureTemplate(); SignatureTemplate signtemp7 = new SignatureTemplate(); SignatureTemplate signtemp8 = new SignatureTemplate(); SignatureTemplate signtemp9 = new SignatureTemplate(); SignatureTemplate signtemp10 = new SignatureTemplate(); SignatureTemplate signtemp11 = new SignatureTemplate(); SignatureTemplate signtemp12 = new SignatureTemplate(); List <string> list = new List <string>(); List <SignatureTemplate> tlist = new List <SignatureTemplate>(); temp.Name = this.ConTempName.Text.ToString(); list.Add(this.Column1.Text.ToString()); list.Add(this.Column2.Text.ToString()); list.Add(this.Column3.Text.ToString()); list.Add(this.Column4.Text.ToString()); list.Add(this.Column5.Text.ToString()); temp.ColumnNames = list; signtemp1.SignInfo = this.Sign1.Text.ToString(); Employee emp1 = new Employee(); emp1.Name = this.SignPer1.SelectedText; emp1.Id = Convert.ToInt32(this.SignPer1.SelectedValue.ToString()); Department dep1 = new Department(); dep1.Id = Convert.ToInt32(this.SignDep1.SelectedValue.ToString()); dep1.Name = this.SignDep1.SelectedText; emp1.Department = dep1; signtemp1.SignEmployee = emp1; signtemp1.SignLevel = Convert.ToInt32(this.Sign1Level.SelectedItem.ToString()); tlist.Add(signtemp1); signtemp2.SignInfo = this.Sign2.Text.ToString(); Employee emp2 = new Employee(); emp2.Name = this.SignPer2.SelectedText; emp2.Id = Convert.ToInt32(this.SignPer2.SelectedValue.ToString()); Department dep2 = new Department(); dep2.Id = Convert.ToInt32(this.SignDep2.SelectedValue.ToString()); dep2.Name = this.SignDep2.SelectedText; emp2.Department = dep2; signtemp2.SignEmployee = emp2; signtemp2.SignLevel = Convert.ToInt32(this.Sign2Level.SelectedItem.ToString()); tlist.Add(signtemp2); signtemp3.SignInfo = this.Sign3.Text.ToString(); Employee emp3 = new Employee(); emp3.Name = this.SignPer3.SelectedText; emp3.Id = Convert.ToInt32(this.SignPer3.SelectedValue.ToString()); Department dep3 = new Department(); dep3.Id = Convert.ToInt32(this.SignDep3.SelectedValue.ToString()); dep3.Name = this.SignDep3.SelectedText; emp3.Department = dep3; signtemp3.SignEmployee = emp3; signtemp3.SignLevel = Convert.ToInt32(this.Sign3Level.SelectedItem.ToString()); tlist.Add(signtemp3); signtemp4.SignInfo = this.Sign4.Text.ToString(); Employee emp4 = new Employee(); emp4.Name = this.SignPer4.SelectedText; emp4.Id = Convert.ToInt32(this.SignPer4.SelectedValue.ToString()); Department dep4 = new Department(); dep4.Id = Convert.ToInt32(this.SignDep4.SelectedValue.ToString()); dep4.Name = this.SignDep4.SelectedText; emp4.Department = dep4; signtemp4.SignEmployee = emp4; signtemp4.SignLevel = Convert.ToInt32(this.Sign4Level.SelectedItem.ToString()); tlist.Add(signtemp4); signtemp5.SignInfo = this.Sign5.Text.ToString(); Employee emp5 = new Employee(); emp5.Name = this.SignPer5.SelectedText; emp5.Id = Convert.ToInt32(this.SignPer5.SelectedValue.ToString()); Department dep5 = new Department(); dep5.Id = Convert.ToInt32(this.SignDep5.SelectedValue.ToString()); dep5.Name = this.SignDep5.SelectedText; emp5.Department = dep5; signtemp5.SignEmployee = emp5; signtemp5.SignLevel = Convert.ToInt32(this.Sign5Level.SelectedItem.ToString()); tlist.Add(signtemp5); signtemp6.SignInfo = this.Sign6.Text.ToString(); Employee emp6 = new Employee(); emp6.Name = this.SignPer6.SelectedText; emp6.Id = Convert.ToInt32(this.SignPer6.SelectedValue.ToString()); Department dep6 = new Department(); dep6.Id = Convert.ToInt32(this.SignDep6.SelectedValue.ToString()); dep6.Name = this.SignDep6.SelectedText; emp6.Department = dep6; signtemp6.SignEmployee = emp6; signtemp6.SignLevel = Convert.ToInt32(this.Sign6Level.SelectedItem.ToString()); tlist.Add(signtemp6); signtemp7.SignInfo = this.Sign7.Text.ToString(); Employee emp7 = new Employee(); emp7.Name = this.SignPer7.SelectedText; emp7.Id = Convert.ToInt32(this.SignPer7.SelectedValue.ToString()); Department dep7 = new Department(); dep7.Id = Convert.ToInt32(this.SignDep4.SelectedValue.ToString()); dep7.Name = this.SignDep7.SelectedText; emp7.Department = dep7; signtemp7.SignEmployee = emp7; signtemp7.SignLevel = Convert.ToInt32(this.Sign7Level.SelectedItem.ToString()); tlist.Add(signtemp7); signtemp8.SignInfo = this.Sign8.Text.ToString(); Employee emp8 = new Employee(); emp8.Name = this.SignPer8.SelectedText; emp8.Id = Convert.ToInt32(this.SignPer8.SelectedValue.ToString()); Department dep8 = new Department(); dep8.Id = Convert.ToInt32(this.SignDep8.SelectedValue.ToString()); dep8.Name = this.SignDep8.SelectedText; emp8.Department = dep8; signtemp8.SignEmployee = emp8; signtemp8.SignLevel = Convert.ToInt32(this.Sign8Level.SelectedItem.ToString()); tlist.Add(signtemp8); signtemp9.SignInfo = this.Sign9.Text.ToString(); Employee emp9 = new Employee(); emp9.Name = this.SignPer9.SelectedText; emp9.Id = Convert.ToInt32(this.SignPer9.SelectedValue.ToString()); Department dep9 = new Department(); dep9.Id = Convert.ToInt32(this.SignDep9.SelectedValue.ToString()); dep9.Name = this.SignDep9.SelectedText; emp9.Department = dep9; signtemp9.SignEmployee = emp9; signtemp9.SignLevel = Convert.ToInt32(this.Sign9Level.SelectedItem.ToString()); tlist.Add(signtemp9); signtemp10.SignInfo = this.Sign10.Text.ToString(); Employee emp10 = new Employee(); emp10.Name = this.SignPer10.SelectedText; emp10.Id = Convert.ToInt32(this.SignPer10.SelectedValue.ToString()); Department dep10 = new Department(); dep10.Id = Convert.ToInt32(this.SignDep10.SelectedValue.ToString()); dep10.Name = this.SignDep10.SelectedText; emp10.Department = dep10; signtemp10.SignEmployee = emp10; signtemp10.SignLevel = Convert.ToInt32(this.Sign10Level.SelectedItem.ToString()); tlist.Add(signtemp10); signtemp11.SignInfo = this.Sign11.Text.ToString(); Employee emp11 = new Employee(); emp11.Name = this.SignPer11.SelectedText; emp11.Id = Convert.ToInt32(this.SignPer11.SelectedValue.ToString()); Department dep11 = new Department(); dep11.Id = Convert.ToInt32(this.SignDep11.SelectedValue.ToString()); dep11.Name = this.SignDep11.SelectedText; emp11.Department = dep11; signtemp11.SignEmployee = emp11; signtemp11.SignLevel = Convert.ToInt32(this.Sign11Level.SelectedItem.ToString()); tlist.Add(signtemp11); signtemp12.SignInfo = this.Sign12.Text.ToString(); Employee emp12 = new Employee(); emp12.Name = this.SignPer12.SelectedText; emp12.Id = Convert.ToInt32(this.SignPer12.SelectedValue.ToString()); Department dep12 = new Department(); dep12.Id = Convert.ToInt32(this.SignDep12.SelectedValue.ToString()); dep12.Name = this.SignDep12.SelectedText; emp12.Department = dep12; signtemp12.SignEmployee = emp12; signtemp12.SignLevel = Convert.ToInt32(this.Sign12Level.SelectedItem.ToString()); tlist.Add(signtemp12); temp.Type = 21; temp.SignDatas = tlist; string result = _sc.AddConTemplete(temp); if (result == Response.INSERT_CONTRACT_TEMPLATE_SUCCESS.ToString()) { MessageBox.Show("保存为新模板" + this.ConTempName.Text + "成功!"); this.DialogResult = DialogResult.OK; } else { MessageBox.Show("保存为新模板!"); } this.Close(); }
private void EditConTemp_Load(object sender, EventArgs e) { BindDepartment(UserHelper.DepList); //绑定部门信息 try { Templete temp = new Templete(); temp = _sc.GetContractTemplate(Id); this.ConTempName.Text = temp.Name.ToString(); this.Column1.Text = temp.ColumnNames[0].ToString(); this.Column2.Text = temp.ColumnNames[1].ToString(); this.Column3.Text = temp.ColumnNames[2].ToString(); this.Column4.Text = temp.ColumnNames[3].ToString(); this.Column5.Text = temp.ColumnNames[4].ToString(); this.Sign1.Text = temp.SignDatas[0].SignInfo.ToString(); this.Sign2.Text = temp.SignDatas[1].SignInfo.ToString(); this.Sign3.Text = temp.SignDatas[2].SignInfo.ToString(); this.Sign4.Text = temp.SignDatas[3].SignInfo.ToString(); this.Sign5.Text = temp.SignDatas[4].SignInfo.ToString(); this.Sign6.Text = temp.SignDatas[5].SignInfo.ToString(); this.Sign7.Text = temp.SignDatas[6].SignInfo.ToString(); this.Sign8.Text = temp.SignDatas[7].SignInfo.ToString(); this.Sign9.Text = temp.SignDatas[8].SignInfo.ToString(); this.Sign10.Text = temp.SignDatas[9].SignInfo.ToString(); this.Sign11.Text = temp.SignDatas[10].SignInfo.ToString(); this.Sign12.Text = temp.SignDatas[11].SignInfo.ToString(); this.SignDep1.SelectedValue = temp.SignDatas[0].SignEmployee.Department.Id; this.SignDep2.SelectedValue = temp.SignDatas[1].SignEmployee.Department.Id; this.SignDep3.SelectedValue = temp.SignDatas[2].SignEmployee.Department.Id; this.SignDep4.SelectedValue = temp.SignDatas[3].SignEmployee.Department.Id; this.SignDep5.SelectedValue = temp.SignDatas[4].SignEmployee.Department.Id; this.SignDep6.SelectedValue = temp.SignDatas[5].SignEmployee.Department.Id; this.SignDep7.SelectedValue = temp.SignDatas[6].SignEmployee.Department.Id; this.SignDep8.SelectedValue = temp.SignDatas[7].SignEmployee.Department.Id; this.SignDep9.SelectedValue = temp.SignDatas[8].SignEmployee.Department.Id; this.SignDep10.SelectedValue = temp.SignDatas[9].SignEmployee.Department.Id; this.SignDep11.SelectedValue = temp.SignDatas[10].SignEmployee.Department.Id; this.SignDep12.SelectedValue = temp.SignDatas[11].SignEmployee.Department.Id; this.SignPer1.SelectedValue = temp.SignDatas[0].SignEmployee.Id; this.SignPer2.SelectedValue = temp.SignDatas[1].SignEmployee.Id; this.SignPer3.SelectedValue = temp.SignDatas[2].SignEmployee.Id; this.SignPer4.SelectedValue = temp.SignDatas[3].SignEmployee.Id; this.SignPer5.SelectedValue = temp.SignDatas[4].SignEmployee.Id; this.SignPer6.SelectedValue = temp.SignDatas[5].SignEmployee.Id; this.SignPer7.SelectedValue = temp.SignDatas[6].SignEmployee.Id; this.SignPer8.SelectedValue = temp.SignDatas[7].SignEmployee.Id; this.SignPer9.SelectedValue = temp.SignDatas[8].SignEmployee.Id; this.SignPer10.SelectedValue = temp.SignDatas[9].SignEmployee.Id; this.SignPer11.SelectedValue = temp.SignDatas[10].SignEmployee.Id; this.SignPer12.SelectedValue = temp.SignDatas[11].SignEmployee.Id; this.Sign1Level.SelectedItem = temp.SignDatas[0].SignLevel.ToString(); this.Sign2Level.SelectedItem = temp.SignDatas[1].SignLevel.ToString(); this.Sign3Level.SelectedItem = temp.SignDatas[2].SignLevel.ToString(); this.Sign4Level.SelectedItem = temp.SignDatas[3].SignLevel.ToString(); this.Sign5Level.SelectedItem = temp.SignDatas[4].SignLevel.ToString(); this.Sign6Level.SelectedItem = temp.SignDatas[5].SignLevel.ToString(); this.Sign7Level.SelectedItem = temp.SignDatas[6].SignLevel.ToString(); this.Sign8Level.SelectedItem = temp.SignDatas[7].SignLevel.ToString(); this.Sign9Level.SelectedItem = temp.SignDatas[8].SignLevel.ToString(); this.Sign10Level.SelectedItem = temp.SignDatas[9].SignLevel.ToString(); this.Sign11Level.SelectedItem = temp.SignDatas[10].SignLevel.ToString(); this.Sign12Level.SelectedItem = temp.SignDatas[11].SignLevel.ToString(); this.View1.SelectedIndex = temp.SignDatas[0].CanView; this.View2.SelectedIndex = temp.SignDatas[1].CanView; this.View3.SelectedIndex = temp.SignDatas[2].CanView; this.View4.SelectedIndex = temp.SignDatas[3].CanView; this.View5.SelectedIndex = temp.SignDatas[4].CanView; this.View6.SelectedIndex = temp.SignDatas[5].CanView; this.View7.SelectedIndex = temp.SignDatas[6].CanView; this.View8.SelectedIndex = temp.SignDatas[7].CanView; this.View9.SelectedIndex = temp.SignDatas[8].CanView; this.View10.SelectedIndex = temp.SignDatas[9].CanView; this.View11.SelectedIndex = temp.SignDatas[10].CanView; this.View12.SelectedIndex = temp.SignDatas[11].CanView; this.Download1.SelectedIndex = temp.SignDatas[0].CanDownload; this.Download2.SelectedIndex = temp.SignDatas[1].CanDownload; this.Download3.SelectedIndex = temp.SignDatas[2].CanDownload; this.Download4.SelectedIndex = temp.SignDatas[3].CanDownload; this.Download5.SelectedIndex = temp.SignDatas[4].CanDownload; this.Download6.SelectedIndex = temp.SignDatas[5].CanDownload; this.Download7.SelectedIndex = temp.SignDatas[6].CanDownload; this.Download8.SelectedIndex = temp.SignDatas[7].CanDownload; this.Download9.SelectedIndex = temp.SignDatas[8].CanDownload; this.Download10.SelectedIndex = temp.SignDatas[9].CanDownload; this.Download11.SelectedIndex = temp.SignDatas[10].CanDownload; this.Download12.SelectedIndex = temp.SignDatas[11].CanDownload; } catch { MessageBox.Show("加载数据失败!"); Logging.AddLog("修改模板时加载模板信息失败!"); // 重启应用程序 if (MessageBox.Show("好吧,我们的程序出现点问题需要重新启动\n点击\"确定\"重启\n点击\"取消\"退出程序?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) { Application.Restart(); } else { Application.Exit(); } } }
private void button1_Click(object sender, EventArgs e) { if (this.CheckIntegrity() == false) { return; } Templete temp = new Templete(); SignatureTemplate signtemp1 = new SignatureTemplate(); SignatureTemplate signtemp2 = new SignatureTemplate(); SignatureTemplate signtemp3 = new SignatureTemplate(); SignatureTemplate signtemp4 = new SignatureTemplate(); SignatureTemplate signtemp5 = new SignatureTemplate(); SignatureTemplate signtemp6 = new SignatureTemplate(); SignatureTemplate signtemp7 = new SignatureTemplate(); SignatureTemplate signtemp8 = new SignatureTemplate(); SignatureTemplate signtemp9 = new SignatureTemplate(); SignatureTemplate signtemp10 = new SignatureTemplate(); SignatureTemplate signtemp11 = new SignatureTemplate(); SignatureTemplate signtemp12 = new SignatureTemplate(); List <string> list = new List <string>(); List <SignatureTemplate> tlist = new List <SignatureTemplate>(); temp.Name = this.ConTempName.Text.ToString(); list.Add(this.Column1.Text.ToString()); list.Add(this.Column2.Text.ToString()); list.Add(this.Column3.Text.ToString()); list.Add(this.Column4.Text.ToString()); list.Add(this.Column5.Text.ToString()); temp.ColumnNames = list; signtemp1.SignInfo = this.Sign1.Text.ToString(); Employee emp1 = new Employee(); emp1.Name = this.SignPer1.SelectedText; emp1.Id = Convert.ToInt32(this.SignPer1.SelectedValue.ToString()); Department dep1 = new Department(); dep1.Id = Convert.ToInt32(this.SignDep1.SelectedValue.ToString()); dep1.Name = this.SignDep1.SelectedText; emp1.Department = dep1; signtemp1.SignEmployee = emp1; signtemp1.SignLevel = Convert.ToInt32(this.Sign1Level.SelectedItem.ToString()); signtemp1.CanView = this.View1.SelectedIndex; signtemp1.CanDownload = this.Download1.SelectedIndex; tlist.Add(signtemp1); signtemp2.SignInfo = this.Sign2.Text.ToString(); Employee emp2 = new Employee(); emp2.Name = this.SignPer2.SelectedText; emp2.Id = Convert.ToInt32(this.SignPer2.SelectedValue.ToString()); Department dep2 = new Department(); dep2.Id = Convert.ToInt32(this.SignDep2.SelectedValue.ToString()); dep2.Name = this.SignDep2.SelectedText; emp2.Department = dep2; signtemp2.SignEmployee = emp2; signtemp2.SignLevel = Convert.ToInt32(this.Sign2Level.SelectedItem.ToString()); signtemp2.CanView = this.View2.SelectedIndex; signtemp2.CanDownload = this.Download2.SelectedIndex; tlist.Add(signtemp2); signtemp3.SignInfo = this.Sign3.Text.ToString(); Employee emp3 = new Employee(); emp3.Name = this.SignPer3.SelectedText; emp3.Id = Convert.ToInt32(this.SignPer3.SelectedValue.ToString()); Department dep3 = new Department(); dep3.Id = Convert.ToInt32(this.SignDep3.SelectedValue.ToString()); dep3.Name = this.SignDep3.SelectedText; emp3.Department = dep3; signtemp3.SignEmployee = emp3; signtemp3.SignLevel = Convert.ToInt32(this.Sign3Level.SelectedItem.ToString()); signtemp3.CanView = this.View3.SelectedIndex; signtemp3.CanDownload = this.Download3.SelectedIndex; tlist.Add(signtemp3); signtemp4.SignInfo = this.Sign4.Text.ToString(); Employee emp4 = new Employee(); emp4.Name = this.SignPer4.SelectedText; emp4.Id = Convert.ToInt32(this.SignPer4.SelectedValue.ToString()); Department dep4 = new Department(); dep4.Id = Convert.ToInt32(this.SignDep4.SelectedValue.ToString()); dep4.Name = this.SignDep4.SelectedText; emp4.Department = dep4; signtemp4.SignEmployee = emp4; signtemp4.SignLevel = Convert.ToInt32(this.Sign4Level.SelectedItem.ToString()); signtemp4.CanView = this.View4.SelectedIndex; signtemp4.CanDownload = this.Download4.SelectedIndex; tlist.Add(signtemp4); signtemp5.SignInfo = this.Sign5.Text.ToString(); Employee emp5 = new Employee(); emp5.Name = this.SignPer5.SelectedText; emp5.Id = Convert.ToInt32(this.SignPer5.SelectedValue.ToString()); Department dep5 = new Department(); dep5.Id = Convert.ToInt32(this.SignDep5.SelectedValue.ToString()); dep5.Name = this.SignDep5.SelectedText; emp5.Department = dep5; signtemp5.SignEmployee = emp5; signtemp5.SignLevel = Convert.ToInt32(this.Sign5Level.SelectedItem.ToString()); signtemp5.CanView = this.View5.SelectedIndex; signtemp5.CanDownload = this.Download5.SelectedIndex; tlist.Add(signtemp5); signtemp6.SignInfo = this.Sign6.Text.ToString(); Employee emp6 = new Employee(); emp6.Name = this.SignPer6.SelectedText; emp6.Id = Convert.ToInt32(this.SignPer6.SelectedValue.ToString()); Department dep6 = new Department(); dep6.Id = Convert.ToInt32(this.SignDep6.SelectedValue.ToString()); dep6.Name = this.SignDep6.SelectedText; emp6.Department = dep6; signtemp6.SignEmployee = emp6; signtemp6.SignLevel = Convert.ToInt32(this.Sign6Level.SelectedItem.ToString()); signtemp6.CanView = this.View6.SelectedIndex; signtemp6.CanDownload = this.Download6.SelectedIndex; tlist.Add(signtemp6); signtemp7.SignInfo = this.Sign7.Text.ToString(); Employee emp7 = new Employee(); emp7.Name = this.SignPer7.SelectedText; emp7.Id = Convert.ToInt32(this.SignPer7.SelectedValue.ToString()); Department dep7 = new Department(); dep7.Id = Convert.ToInt32(this.SignDep7.SelectedValue.ToString()); dep7.Name = this.SignDep7.SelectedText; emp7.Department = dep7; signtemp7.SignEmployee = emp7; signtemp7.SignLevel = Convert.ToInt32(this.Sign7Level.SelectedItem.ToString()); signtemp7.CanView = this.View7.SelectedIndex; signtemp7.CanDownload = this.Download7.SelectedIndex; tlist.Add(signtemp7); signtemp8.SignInfo = this.Sign8.Text.ToString(); Employee emp8 = new Employee(); emp8.Name = this.SignPer8.SelectedText; emp8.Id = Convert.ToInt32(this.SignPer8.SelectedValue.ToString()); Department dep8 = new Department(); dep8.Id = Convert.ToInt32(this.SignDep8.SelectedValue.ToString()); dep8.Name = this.SignDep8.SelectedText; emp8.Department = dep8; signtemp8.SignEmployee = emp8; signtemp8.SignLevel = Convert.ToInt32(this.Sign8Level.SelectedItem.ToString()); signtemp8.CanView = this.View8.SelectedIndex; signtemp8.CanDownload = this.Download8.SelectedIndex; tlist.Add(signtemp8); signtemp9.SignInfo = this.Sign9.Text.ToString(); Employee emp9 = new Employee(); emp9.Name = this.SignPer9.SelectedText; emp9.Id = Convert.ToInt32(this.SignPer9.SelectedValue.ToString()); Department dep9 = new Department(); dep9.Id = Convert.ToInt32(this.SignDep9.SelectedValue.ToString()); dep9.Name = this.SignDep9.SelectedText; emp9.Department = dep9; signtemp9.SignEmployee = emp9; signtemp9.SignLevel = Convert.ToInt32(this.Sign9Level.SelectedItem.ToString()); signtemp9.CanView = this.View9.SelectedIndex; signtemp9.CanDownload = this.Download9.SelectedIndex; tlist.Add(signtemp9); signtemp10.SignInfo = this.Sign10.Text.ToString(); Employee emp10 = new Employee(); emp10.Name = this.SignPer10.SelectedText; emp10.Id = Convert.ToInt32(this.SignPer10.SelectedValue.ToString()); Department dep10 = new Department(); dep10.Id = Convert.ToInt32(this.SignDep10.SelectedValue.ToString()); dep10.Name = this.SignDep10.SelectedText; emp10.Department = dep10; signtemp10.SignEmployee = emp10; signtemp10.SignLevel = Convert.ToInt32(this.Sign10Level.SelectedItem.ToString()); signtemp10.CanView = this.View10.SelectedIndex; signtemp10.CanDownload = this.Download10.SelectedIndex; tlist.Add(signtemp10); signtemp11.SignInfo = this.Sign11.Text.ToString(); Employee emp11 = new Employee(); emp11.Name = this.SignPer11.SelectedText; emp11.Id = Convert.ToInt32(this.SignPer11.SelectedValue.ToString()); Department dep11 = new Department(); dep11.Id = Convert.ToInt32(this.SignDep11.SelectedValue.ToString()); dep11.Name = this.SignDep11.SelectedText; emp11.Department = dep11; signtemp11.SignEmployee = emp11; signtemp11.SignLevel = Convert.ToInt32(this.Sign11Level.SelectedItem.ToString()); signtemp11.CanView = this.View11.SelectedIndex; signtemp11.CanDownload = this.Download11.SelectedIndex; tlist.Add(signtemp11); signtemp12.SignInfo = this.Sign12.Text.ToString(); Employee emp12 = new Employee(); emp12.Name = this.SignPer12.SelectedText; emp12.Id = Convert.ToInt32(this.SignPer12.SelectedValue.ToString()); Department dep12 = new Department(); dep12.Id = Convert.ToInt32(this.SignDep12.SelectedValue.ToString()); dep12.Name = this.SignDep12.SelectedText; emp12.Department = dep12; signtemp12.SignEmployee = emp12; signtemp12.SignLevel = Convert.ToInt32(this.Sign12Level.SelectedItem.ToString()); signtemp12.CanView = this.View12.SelectedIndex; signtemp12.CanDownload = this.Download12.SelectedIndex; tlist.Add(signtemp12); temp.Type = 21; temp.SignDatas = tlist; temp.TempId = Id; string result = _sc.ModifyContractTemplate(temp); if (result == Response.MODIFY_CONTRACT_TEMPLATE_SUCCESS.ToString()) { MessageBox.Show("修改模板成功!", "提示", MessageBoxButtons.OK); this.DialogResult = DialogResult.OK; } else if (result == "服务器连接中断") { MessageBox.Show("服务器连接中断,修改失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { MessageBox.Show("修改失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } this.Close(); }
private void btn_Save_Click(object sender, EventArgs e) { if (this.CheckIntegrity() == false) { return; } Templete temp = new Templete(); SignatureTemplate signtemp1 = new SignatureTemplate(); SignatureTemplate signtemp2 = new SignatureTemplate(); SignatureTemplate signtemp3 = new SignatureTemplate(); SignatureTemplate signtemp4 = new SignatureTemplate(); SignatureTemplate signtemp5 = new SignatureTemplate(); SignatureTemplate signtemp6 = new SignatureTemplate(); SignatureTemplate signtemp7 = new SignatureTemplate(); SignatureTemplate signtemp8 = new SignatureTemplate(); SignatureTemplate signtemp9 = new SignatureTemplate(); SignatureTemplate signtemp10 = new SignatureTemplate(); List <string> list = new List <string>(); List <SignatureTemplate> tlist = new List <SignatureTemplate>(); //原来此处有断点 // 会签单的名称 temp.Name = this.ConTempName.Text.ToString(); temp.Type = Type; // 添加前5行的会签单基本信息 list.Add(this.Column1.Text.ToString()); list.Add(this.Column2.Text.ToString()); list.Add(this.Column3.Text.ToString()); list.Add(this.Column4.Text.ToString()); list.Add(this.Column5.Text.ToString()); list.Add(this.Column6.Text.ToString()); temp.ColumnNames = list; /// 添加后10个签字人的信息基本信息 signtemp1.SignInfo = this.Sign1.Text.ToString(); Employee emp1 = new Employee(); emp1.Name = this.SignPer1.SelectedText; emp1.Id = Convert.ToInt32(this.SignPer1.SelectedValue.ToString()); Department dep1 = new Department(); dep1.Id = Convert.ToInt32(this.SignDep1.SelectedValue.ToString()); dep1.Name = this.SignDep1.SelectedText; emp1.Department = dep1; signtemp1.SignEmployee = emp1; signtemp1.SignLevel = Convert.ToInt32(this.Sign1Level.SelectedItem.ToString()); signtemp1.CanView = this.View1.SelectedIndex; signtemp1.CanDownload = this.Download1.SelectedIndex; tlist.Add(signtemp1); signtemp2.SignInfo = this.Sign2.Text.ToString(); Employee emp2 = new Employee(); emp2.Name = this.SignPer2.SelectedText; emp2.Id = Convert.ToInt32(this.SignPer2.SelectedValue.ToString()); Department dep2 = new Department(); dep2.Id = Convert.ToInt32(this.SignDep2.SelectedValue.ToString()); dep2.Name = this.SignDep2.SelectedText; emp2.Department = dep2; signtemp2.SignEmployee = emp2; signtemp2.SignLevel = Convert.ToInt32(this.Sign2Level.SelectedItem.ToString()); signtemp2.CanView = this.View2.SelectedIndex; signtemp2.CanDownload = this.Download2.SelectedIndex; tlist.Add(signtemp2); signtemp3.SignInfo = this.Sign3.Text.ToString(); Employee emp3 = new Employee(); emp3.Name = this.SignPer3.SelectedText; emp3.Id = Convert.ToInt32(this.SignPer3.SelectedValue.ToString()); Department dep3 = new Department(); dep3.Id = Convert.ToInt32(this.SignDep3.SelectedValue.ToString()); dep3.Name = this.SignDep3.SelectedText; emp3.Department = dep3; signtemp3.SignEmployee = emp3; signtemp3.SignLevel = Convert.ToInt32(this.Sign3Level.SelectedItem.ToString()); signtemp3.CanView = this.View3.SelectedIndex; signtemp3.CanDownload = this.Download3.SelectedIndex; tlist.Add(signtemp3); signtemp4.SignInfo = this.Sign4.Text.ToString(); Employee emp4 = new Employee(); emp4.Name = this.SignPer4.SelectedText; emp4.Id = Convert.ToInt32(this.SignPer4.SelectedValue.ToString()); Department dep4 = new Department(); dep4.Id = Convert.ToInt32(this.SignDep4.SelectedValue.ToString()); dep4.Name = this.SignDep4.SelectedText; emp4.Department = dep4; signtemp4.SignEmployee = emp4; signtemp4.SignLevel = Convert.ToInt32(this.Sign4Level.SelectedItem.ToString()); signtemp4.CanView = this.View4.SelectedIndex; signtemp4.CanDownload = this.Download4.SelectedIndex; tlist.Add(signtemp4); signtemp5.SignInfo = this.Sign5.Text.ToString(); Employee emp5 = new Employee(); emp5.Name = this.SignPer5.SelectedText; emp5.Id = Convert.ToInt32(this.SignPer5.SelectedValue.ToString()); Department dep5 = new Department(); dep5.Id = Convert.ToInt32(this.SignDep5.SelectedValue.ToString()); dep5.Name = this.SignDep5.SelectedText; emp5.Department = dep5; signtemp5.SignEmployee = emp5; signtemp5.SignLevel = Convert.ToInt32(this.Sign5Level.SelectedItem.ToString()); signtemp5.CanView = this.View5.SelectedIndex; signtemp5.CanDownload = this.Download5.SelectedIndex; tlist.Add(signtemp5); signtemp6.SignInfo = this.Sign6.Text.ToString(); Employee emp6 = new Employee(); emp6.Name = this.SignPer6.SelectedText; emp6.Id = Convert.ToInt32(this.SignPer6.SelectedValue.ToString()); Department dep6 = new Department(); dep6.Id = Convert.ToInt32(this.SignDep6.SelectedValue.ToString()); dep6.Name = this.SignDep6.SelectedText; emp6.Department = dep6; signtemp6.SignEmployee = emp6; signtemp6.SignLevel = Convert.ToInt32(this.Sign6Level.SelectedItem.ToString()); signtemp6.CanView = this.View6.SelectedIndex; signtemp6.CanDownload = this.Download6.SelectedIndex; tlist.Add(signtemp6); signtemp7.SignInfo = this.Sign7.Text.ToString(); Employee emp7 = new Employee(); emp7.Name = this.SignPer7.SelectedText; emp7.Id = Convert.ToInt32(this.SignPer7.SelectedValue.ToString()); Department dep7 = new Department(); dep7.Id = Convert.ToInt32(this.SignDep7.SelectedValue.ToString()); dep7.Name = this.SignDep7.SelectedText; emp7.Department = dep7; signtemp7.SignEmployee = emp7; signtemp7.SignLevel = Convert.ToInt32(this.Sign7Level.SelectedItem.ToString()); signtemp7.CanView = this.View7.SelectedIndex; signtemp7.CanDownload = this.Download7.SelectedIndex; tlist.Add(signtemp7); signtemp8.SignInfo = this.Sign8.Text.ToString(); Employee emp8 = new Employee(); emp8.Name = this.SignPer8.SelectedText; emp8.Id = Convert.ToInt32(this.SignPer8.SelectedValue.ToString()); Department dep8 = new Department(); dep8.Id = Convert.ToInt32(this.SignDep8.SelectedValue.ToString()); dep8.Name = this.SignDep8.SelectedText; emp8.Department = dep8; signtemp8.SignEmployee = emp8; signtemp8.SignLevel = Convert.ToInt32(this.Sign8Level.SelectedItem.ToString()); signtemp8.CanView = this.View8.SelectedIndex; signtemp8.CanDownload = this.Download8.SelectedIndex; tlist.Add(signtemp8); signtemp9.SignInfo = this.Sign9.Text.ToString(); Employee emp9 = new Employee(); emp9.Name = this.SignPer9.SelectedText; emp9.Id = Convert.ToInt32(this.SignPer9.SelectedValue.ToString()); Department dep9 = new Department(); dep9.Id = Convert.ToInt32(this.SignDep9.SelectedValue.ToString()); dep9.Name = this.SignDep9.SelectedText; emp9.Department = dep9; signtemp9.SignEmployee = emp9; signtemp9.SignLevel = Convert.ToInt32(this.Sign9Level.SelectedItem.ToString()); signtemp9.CanView = this.View9.SelectedIndex; signtemp9.CanDownload = this.Download9.SelectedIndex; tlist.Add(signtemp9); signtemp10.SignInfo = this.Sign10.Text.ToString(); Employee emp10 = new Employee(); emp10.Name = this.SignPer10.SelectedText; emp10.Id = Convert.ToInt32(this.SignPer10.SelectedValue.ToString()); Department dep10 = new Department(); dep10.Id = Convert.ToInt32(this.SignDep10.SelectedValue.ToString()); dep10.Name = this.SignDep10.SelectedText; emp10.Department = dep10; signtemp10.SignEmployee = emp10; signtemp10.SignLevel = Convert.ToInt32(this.Sign10Level.SelectedItem.ToString()); signtemp10.CanView = this.View10.SelectedIndex; signtemp10.CanDownload = this.Download10.SelectedIndex; tlist.Add(signtemp10); temp.SignDatas = tlist; //原来此处有断点 string result = _sc.AddConTemplete(temp); if (result == Response.INSERT_CONTRACT_TEMPLATE_SUCCESS.ToString()) { MessageBox.Show("添加模板" + this.ConTempName.Text + "成功!"); } else { MessageBox.Show("添加模板失败!"); } this.Close(); }
//保存模版按钮 private void btn_SaveInsideContemp_Click(object sender, EventArgs e) { if (this.CheckIntegrity() == false) { return; } Templete temp = new Templete(); //签字人信息 SignatureTemplate signtemp1 = new SignatureTemplate(); SignatureTemplate signtemp2 = new SignatureTemplate(); SignatureTemplate signtemp3 = new SignatureTemplate(); SignatureTemplate signtemp4 = new SignatureTemplate(); SignatureTemplate signtemp5 = new SignatureTemplate(); SignatureTemplate signtemp6 = new SignatureTemplate(); SignatureTemplate signtemp7 = new SignatureTemplate(); SignatureTemplate signtemp8 = new SignatureTemplate(); //list用于存储6个栏目的信息 List <string> list = new List <string>(); //tlist用于存储8个签字人的信息 List <SignatureTemplate> tlist = new List <SignatureTemplate>(); // 会签单的名称 temp.Name = this.ConTempName.Text.ToString(); //会签单的类型 temp.Type = Type; // 添加会签单6个栏目基本信息 list.Add(this.Column1.Text.ToString()); list.Add(this.Column2.Text.ToString()); list.Add(this.Column3.Text.ToString()); list.Add(this.Column4.Text.ToString()); list.Add(this.Column5.Text.ToString()); list.Add(this.Column6.Text.ToString()); //存到Templete_Inside的public List<String> ColumnNames集合中 temp.ColumnNames = list; /// 添加后8行的签字人的信息基本信息 signtemp1.SignInfo = this.Sign1.Text.ToString(); Employee emp1 = new Employee(); emp1.Name = this.SignPer1.SelectedText; emp1.Id = Convert.ToInt32(this.SignPer1.SelectedValue.ToString()); Department dep1 = new Department(); dep1.Id = Convert.ToInt32(this.SignDep1.SelectedValue.ToString()); dep1.Name = this.SignDep1.SelectedText; emp1.Department = dep1; signtemp1.SignEmployee = emp1; signtemp1.SignLevel = Convert.ToInt32(this.Sign1Level.SelectedItem.ToString()); signtemp1.CanView = this.View1.SelectedIndex; signtemp1.CanDownload = this.Download1.SelectedIndex; tlist.Add(signtemp1); signtemp2.SignInfo = this.Sign2.Text.ToString(); Employee emp2 = new Employee(); emp2.Name = this.SignPer2.SelectedText; emp2.Id = Convert.ToInt32(this.SignPer2.SelectedValue.ToString()); Department dep2 = new Department(); dep2.Id = Convert.ToInt32(this.SignDep2.SelectedValue.ToString()); dep2.Name = this.SignDep2.SelectedText; emp2.Department = dep2; signtemp2.SignEmployee = emp2; signtemp2.SignLevel = Convert.ToInt32(this.Sign2Level.SelectedItem.ToString()); signtemp2.CanView = this.View2.SelectedIndex; signtemp2.CanDownload = this.Download2.SelectedIndex; tlist.Add(signtemp2); signtemp3.SignInfo = this.Sign3.Text.ToString(); Employee emp3 = new Employee(); emp3.Name = this.SignPer3.SelectedText; emp3.Id = Convert.ToInt32(this.SignPer3.SelectedValue.ToString()); Department dep3 = new Department(); dep3.Id = Convert.ToInt32(this.SignDep3.SelectedValue.ToString()); dep3.Name = this.SignDep3.SelectedText; emp3.Department = dep3; signtemp3.SignEmployee = emp3; signtemp3.SignLevel = Convert.ToInt32(this.Sign3Level.SelectedItem.ToString()); signtemp3.CanView = this.View3.SelectedIndex; signtemp3.CanDownload = this.Download3.SelectedIndex; tlist.Add(signtemp3); signtemp4.SignInfo = this.Sign4.Text.ToString(); Employee emp4 = new Employee(); emp4.Name = this.SignPer4.SelectedText; emp4.Id = Convert.ToInt32(this.SignPer4.SelectedValue.ToString()); Department dep4 = new Department(); dep4.Id = Convert.ToInt32(this.SignDep4.SelectedValue.ToString()); dep4.Name = this.SignDep4.SelectedText; emp4.Department = dep4; signtemp4.SignEmployee = emp4; signtemp4.SignLevel = -1; signtemp4.CanView = this.View4.SelectedIndex; signtemp4.CanDownload = this.Download4.SelectedIndex; tlist.Add(signtemp4); signtemp5.SignInfo = this.Sign5.Text.ToString(); Employee emp5 = new Employee(); emp5.Name = this.SignPer5.SelectedText; emp5.Id = Convert.ToInt32(this.SignPer5.SelectedValue.ToString()); Department dep5 = new Department(); dep5.Id = Convert.ToInt32(this.SignDep5.SelectedValue.ToString()); dep5.Name = this.SignDep5.SelectedText; emp5.Department = dep5; signtemp5.SignEmployee = emp5; signtemp5.SignLevel = Convert.ToInt32(this.Sign5Level.SelectedItem.ToString()); signtemp5.CanView = this.View5.SelectedIndex; signtemp5.CanDownload = this.Download5.SelectedIndex; tlist.Add(signtemp5); signtemp6.SignInfo = this.Sign6.Text.ToString(); Employee emp6 = new Employee(); emp6.Name = this.SignPer6.SelectedText; emp6.Id = Convert.ToInt32(this.SignPer6.SelectedValue.ToString()); Department dep6 = new Department(); dep6.Id = Convert.ToInt32(this.SignDep6.SelectedValue.ToString()); dep6.Name = this.SignDep6.SelectedText; emp6.Department = dep6; signtemp6.SignEmployee = emp6; signtemp6.SignLevel = Convert.ToInt32(this.Sign6Level.SelectedItem.ToString()); signtemp6.CanView = this.View6.SelectedIndex; signtemp6.CanDownload = this.Download6.SelectedIndex; tlist.Add(signtemp6); signtemp7.SignInfo = this.Sign7.Text.ToString(); Employee emp7 = new Employee(); emp7.Name = this.SignPer7.SelectedText; emp7.Id = Convert.ToInt32(this.SignPer7.SelectedValue.ToString()); Department dep7 = new Department(); dep7.Id = Convert.ToInt32(this.SignDep7.SelectedValue.ToString()); dep7.Name = this.SignDep7.SelectedText; emp7.Department = dep7; signtemp7.SignEmployee = emp7; signtemp7.SignLevel = Convert.ToInt32(this.Sign7Level.SelectedItem.ToString()); signtemp7.CanView = this.View7.SelectedIndex; signtemp7.CanDownload = this.Download7.SelectedIndex; tlist.Add(signtemp7); signtemp8.SignInfo = this.Sign8.Text.ToString(); Employee emp8 = new Employee(); emp8.Name = this.SignPer8.SelectedText; emp8.Id = Convert.ToInt32(this.SignPer8.SelectedValue.ToString()); Department dep8 = new Department(); dep8.Id = Convert.ToInt32(this.SignDep8.SelectedValue.ToString()); dep8.Name = this.SignDep8.SelectedText; emp8.Department = dep8; signtemp8.SignEmployee = emp8; signtemp8.SignLevel = Convert.ToInt32(this.Sign8Level.SelectedItem.ToString()); signtemp8.CanView = this.View8.SelectedIndex; signtemp8.CanDownload = this.Download8.SelectedIndex; tlist.Add(signtemp8); //将签字人信息存在Templete_Inside的public List<SignatureTemplate> SignDatas集合中 temp.SignDatas = tlist; //将封装好的信息打包发给Socket传给服务器存入数据库 string result = _sc.AddConTemplete(temp); if (result == Response.INSERT_CONTRACT_TEMPLATE_SUCCESS.ToString()) { MessageBox.Show("添加内河模板" + this.ConTempName.Text + "成功!"); } else { MessageBox.Show("添加内河模板失败!"); } this.Close(); }
//提交按钮 private void btn_Submit_Click(object sender, EventArgs e) //提交会签单信息 { //全部空不为空 if (this.pName.Text.Trim() != "" && this.xmName.Text.Trim() != "" && this.Column4Info.Text.Trim() != "" && this.Column5Info.Text.Trim() != "" && this.Column4InfoAmountInWords.Text.Trim() != "" && this.Column5InfoAmountInWords.Text.Trim() != "" && this.label3.Text.Trim() != "" && this.IdNo.Text.Trim() != "") { if (MessageBox.Show("您确定要提交所填方案吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { HDJContractWithWorkload hdj = new HDJContractWithWorkload(); hdj.Name = this.ConTempName.Text; hdj.SubmitEmployee = UserHelper.UserInfo; Templete temp = new Templete(); temp.TempId = UserHelper.SelectedTemp.TempId; hdj.ConTemp = temp; hdj.Id = this.IdDepartShortCall.Text.ToString() + this.IdCategory.Text.ToString() + this.IdYear.Text.ToString() + this.IdFlag.Text.ToString() + this.IdNo.Text.Trim(); string workloadStr = ""; List <ContractWorkload> worklist = new List <ContractWorkload>(); //工作量的控件数目 int num = (this.ProjectPanel.Controls.Count - 1) / 6; // modify by gatieme @ 2016-01-22 23:48 // 修复了无工作量集合也能提交会签单的BG... if (num <= 0) { MessageBox.Show("会签单的工作量集合为空, 无法提交!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } for (int i = 1; i <= num; i++) { ComboBox item = (ComboBox)this.ProjectPanel.Controls["Item_" + i.ToString()]; TextBox work = (TextBox)this.ProjectPanel.Controls["WorkNum_" + i.ToString()]; TextBox expense = (TextBox)this.ProjectPanel.Controls["Expense_" + i.ToString()]; ContractWorkload workload = new ContractWorkload(); workload.ContractId = hdj.Id; ContractItem it = new ContractItem(); it.ProjectId = Convert.ToInt32(this.xmName.SelectedValue); it.Id = Convert.ToInt32(item.SelectedValue); it.Item = item.Text.ToString(); workload.Item = it; if (work.Text.Trim() == "" || expense.Text.Trim() == "") { MessageBox.Show("请将工作量填写完整!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } // 判断工作量中是否有重复的数据 workload.Work = Convert.ToDouble(work.Text.Trim()); workload.Expense = Convert.ToDouble(expense.Text.Trim()); //一个会签单多个item的话就通过最后以为判别 如:省界专2016001(1、2、3) 就是这单有3项item workload.Id = hdj.Id + it.Id.ToString(); // modify by gatieme @ 2016-01-22 // 修复了工作量可以重复的BUG... if (worklist.Where(o => o.Item.Id == it.Id).ToList().Count > 0) { MessageBox.Show("工作量有重复的!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } worklist.Add(workload); workloadStr += workload.Item.Item + " 工作量 : " + workload.Work.ToString() + " 投资额 : " + workload.Expense.ToString() + "\r\n"; } hdj.WorkLoads = worklist; List <String> list = new List <string>(); list.Add(this.pName.Text.ToString()); // 工程名称 list.Add(this.xmName.Text.ToString()); // 项目名称 list.Add(workloadStr); string currMoney = this.Column4Info.Text.ToString() + " " + this.Column4InfoAmountInWords.Text.ToString(); string totalMoney = this.Column5Info.Text.ToString() + " " + this.Column5InfoAmountInWords.Text.ToString(); list.Add(currMoney); list.Add(totalMoney); hdj.ColumnDatas = list; //将编号 和 栏目1-5的数据 存入数据库hdjcontract表中 string result = _sc.InsertHDJContract(hdj); //成功就清空 if (result == Response.INSERT_HDJCONTRACT_SUCCESS.ToString()) { this.pName.Text = ""; this.xmName.Text = ""; this.Column4Info.Text = ""; this.Column5Info.Text = ""; this.IdNo.Text = ""; for (int i = 1; i <= num; i++) { ComboBox item = (ComboBox)this.ProjectPanel.Controls["Item_" + i.ToString()]; TextBox work = (TextBox)this.ProjectPanel.Controls["WorkNum_" + i.ToString()]; Label workdsc = (Label)this.ProjectPanel.Controls["WorkDsc_" + i.ToString()]; TextBox expense = (TextBox)this.ProjectPanel.Controls["Expense_" + i.ToString()]; Label expensedsc = (Label)this.ProjectPanel.Controls["ExpenseDsc_" + i.ToString()]; Button b = (Button)this.ProjectPanel.Controls["Delete_" + i.ToString()]; this.ProjectPanel.Controls.Remove(item); this.ProjectPanel.Controls.Remove(work); this.ProjectPanel.Controls.Remove(workdsc); this.ProjectPanel.Controls.Remove(expense); this.ProjectPanel.Controls.Remove(expensedsc); this.ProjectPanel.Controls.Remove(b); item.Dispose(); work.Dispose(); workdsc.Dispose(); expense.Dispose(); expensedsc.Dispose(); b.Dispose(); } this.ProjectPanel.Height = this.ProjectPanel.Height - 34 * num; MessageBox.Show("提交成功!", "提示", MessageBoxButtons.OK); // 2015-07-03 11:25 提交成功后应该刷新一下待签字结构体 if (HDJContract.GetIsOnlineFromContractId(hdj.Id) == false) { MessageBox.Show("您提交了一份离线审批单子, 将直接完成签字,且无法修改!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } //返回ok进行刷新 this.DialogResult = DialogResult.OK; } //提交失败 else if (result == "服务器连接中断") { MessageBox.Show("服务器连接中断,提交失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (result == Response.INSERT_HDJCONTRACT_EXIST.ToString()) { MessageBox.Show("该会签单编号已经存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { MessageBox.Show("提交失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } } else { MessageBox.Show("请将所有空白处填完!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
public SubmintContempJHLX(int contempId, SignSocketClient sc) : this() { _sc = sc; //下拉框传过来的选中的模版id ContempId = contempId; try { // Templete temp = new Templete(); //SOCKET查询 界河例行模版 temp = _sc.GetContractTemplateJHLX(ContempId); if (temp != null) { UserHelper.SelectedTemp = temp; } this.ConTempName.Text = temp.Name.ToString(); this.Column1.Text = temp.ColumnNames[0].ToString(); this.Column2.Text = temp.ColumnNames[1].ToString(); this.Column3.Text = temp.ColumnNames[2].ToString(); this.Column4.Text = temp.ColumnNames[3].ToString(); this.Column5.Text = temp.ColumnNames[4].ToString(); this.Column6.Text = temp.ColumnNames[5].ToString(); this.Sign1.Text = temp.SignDatas[0].SignInfo.ToString(); this.Sign2.Text = temp.SignDatas[1].SignInfo.ToString(); this.Sign3.Text = temp.SignDatas[2].SignInfo.ToString(); this.Sign4.Text = temp.SignDatas[3].SignInfo.ToString(); this.Sign5.Text = temp.SignDatas[4].SignInfo.ToString(); this.Sign6.Text = temp.SignDatas[5].SignInfo.ToString(); this.Sign7.Text = temp.SignDatas[6].SignInfo.ToString(); this.Sign8.Text = temp.SignDatas[7].SignInfo.ToString(); this.Sign9.Text = temp.SignDatas[8].SignInfo.ToString(); this.Sign10.Text = temp.SignDatas[9].SignInfo.ToString(); this.SignPer1.Text = temp.SignDatas[0].SignEmployee.Name.ToString(); this.SignPer2.Text = temp.SignDatas[1].SignEmployee.Name.ToString(); this.SignPer3.Text = temp.SignDatas[2].SignEmployee.Name.ToString(); this.SignPer4.Text = temp.SignDatas[3].SignEmployee.Name.ToString(); this.SignPer5.Text = temp.SignDatas[4].SignEmployee.Name.ToString(); this.SignPer6.Text = temp.SignDatas[5].SignEmployee.Name.ToString(); this.SignPer7.Text = temp.SignDatas[6].SignEmployee.Name.ToString(); this.SignPer8.Text = temp.SignDatas[7].SignEmployee.Name.ToString(); this.SignPer9.Text = temp.SignDatas[8].SignEmployee.Name.ToString(); this.SignPer10.Text = temp.SignDatas[9].SignEmployee.Name.ToString(); } catch { MessageBox.Show("加载数据失败!"); Logging.AddLog("提交界河专项模板详细信息失败!"); if (MessageBox.Show("好吧,我们的程序出现点问题需要重新启动\n点击\"确定\"重启\n点击\"取消\"退出程序?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) { Application.Restart(); } else { Application.Exit(); } } }