private void tsbCheck_Click(object sender, EventArgs e) { if (MessageBox.Show("确定审核该工程更改单!", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) { if (ChangeBillManage.IsExistChangeBillID(txtFileID.Text, txtNewVersionID.Text.Replace("'", "''")) == true) { this.ShowAlertMessage("[文件编号+新版本号]已经存在,不能审核时自动创建,不能审核!"); return; } //更新审核状态 ChangeBillManage.CheckBill(txtGuid.Text, 1, txtFileID.Tag.ToString(), txtNewVersionID.Text); //设置为:已审核 //SetControlEnable(1); txtCheckDate.Text = DateTime.Now.ToString(); txtCheckGuid.Tag = SysParams.UserID; txtCheckGuid.Text = SysParams.UserName; tsbCheck.Enabled = false; tsbUnCheck.Enabled = true; tsbSave.Enabled = false; SetRight(); //写日志 SysLog.AddOperateLog(SysParams.UserName, "工程更改单审核", "审核", SysParams.UserName + "用户审核工程更改单,唯一号:" + txtGuid.Text + ",工程更改单号:" + txtChangeBillID.Text); //刷新列表界面 frmChangeBill.frmchangeBill.LoadData(); } }
//保存 private void btnSave_Click(object sender, EventArgs e) { if (txtChangeBillID.Text.Trim() == "") { this.ShowAlertMessage("请输入工程更改单号!"); txtChangeBillID.Focus(); return; } if (txtFileID.Text.Trim() == "") { this.ShowAlertMessage("请选择文件!"); txtFileID.Focus(); return; } if (dtpChangeBillDate.Text.Trim() == "") { this.ShowAlertMessage("请输入开单日期!"); dtpChangeBillDate.Focus(); return; } if (txtChangePerson.Text.Trim() == "") { this.ShowAlertMessage("请输入更改人!"); txtChangePerson.Focus(); return; } if (txtOldVersionID.Text.Trim() == "") { this.ShowAlertMessage("请输入旧版本!"); txtOldVersionID.Focus(); return; } if (txtNewVersionID.Text.Trim() == "") { this.ShowAlertMessage("请输入新版本!"); txtNewVersionID.Focus(); return; } ChangeBillManage ChangeBillManage = new ChangeBillManage(); //判断当前工程更改编号是否已经存在相同的,如果已经存在则给出提示 if (ChangeBillManage.IsExistChangeBillID(txtChangeBillID.Text.Replace("'", "''"), txtGuid.Text, IsEdit) == true) { this.ShowAlertMessage("你输入的工程更改编号已经存在,请修改后再确定!"); return; } ChangeBill ChangeBill = new ChangeBill(); ChangeBill.ChangeBillGuID = txtGuid.Text.Replace("'", "''"); ChangeBill.ChangeBillID = txtChangeBillID.Text.Replace("'", "''"); ChangeBill.ChangeBillDate = DateTime.Parse(dtpChangeBillDate.Text); ChangeBill.FileGuID = txtFileID.Tag.ToString(); ChangeBill.NewVersionID = txtNewVersionID.Text; if (txtChangePerson.Tag != null) { ChangeBill.ChangePerson = txtChangePerson.Tag.ToString(); } else { ChangeBill.ChangePerson = ""; } ChangeBill.Remark = txtRemark.Text.Trim().Replace("'", "''"); ChangeBill.CreateGuid = txtCreateGuid.Tag.ToString(); ChangeBill.CreateDate = DateTime.Now; ChangeBill.CheckGuid = ""; ChangeBill.CheckDate = DateTime.Parse("1900-01-01"); ChangeBill.CheckGuid = ""; //保存 ChangeBillManage.SaveChangeBill(ChangeBill, lst); //写日志 SysLog.AddOperateLog(SysParams.UserName, "工程更改单数据", "新增或编辑", SysParams.UserName + "用户新增或编辑了工程更改单,工程更改单:" + ChangeBill.ChangeBillGuID + "," + ChangeBill.ChangeBillID + "," + ChangeBill.NewVersionID); IsEdit = true; //刷新 frmChangeBill.frmchangeBill.LoadData(); tsbSave.Enabled = true; tsbCheck.Enabled = true; tsbUnCheck.Enabled = false; SetRight(); this.ShowMessage("保存成功!"); }