/// <summary> /// 修改按钮处理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnModify_Click(object sender, EventArgs e) { B_HSEdit l_BusReceiveEdit = null; if (String.IsNullOrEmpty(txtDocumentNo.Text.TrimEnd())) { ValidateUtility.ShowMsgBox(this.Page, FS.ADIM.OA.BLL.Common.Utility.MessageType.VbExclamation, "请先选择一条收文记录!"); return; } if (!VerifyEditField()) { ValidateUtility.ShowMsgBox(this.Page, FS.ADIM.OA.BLL.Common.Utility.MessageType.VbCritical, "表单验证失败"); return; } l_BusReceiveEdit = new B_HSEdit(); l_BusReceiveEdit.ID = Convert.ToInt32(txtRegisterID.Text); if (l_BusReceiveEdit.CreateDate == DateTime.MinValue) { ValidateUtility.ShowMsgBox(this.Page, FS.ADIM.OA.BLL.Common.Utility.MessageType.VbCritical, "当前收文登记信息已经被删除,不能做修改动作!"); return; } PopulateEntity(l_BusReceiveEdit); if (l_BusReceiveEdit.Save()) { ValidateUtility.ShowMsgBox(this.Page, FS.ADIM.OA.BLL.Common.Utility.MessageType.VbInformation, "保存成功"); PopulateEditField(l_BusReceiveEdit); LoadRegisterList(); } }
/// <summary> /// 新增按钮处理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnAddNew_Click(object sender, EventArgs e) { B_HSEdit l_BusReceiveEdit = null; //表单的合法性验证 if (!VerifyEditField()) { ValidateUtility.ShowMsgBox(this.Page, FS.ADIM.OA.BLL.Common.Utility.MessageType.VbCritical, "表单验证失败"); return; } l_BusReceiveEdit = new B_HSEdit(); PopulateEntity(l_BusReceiveEdit); l_BusReceiveEdit.DocumentNo = B_ReceiveID.GenerateReceiveNo(DateTime.Now.Year.ToString(), TemplateName); if (l_BusReceiveEdit.Save()) { JScript.ShowMsgBox(Page, "新增成功", false); PopulateEditField(l_BusReceiveEdit); LoadRegisterList(); } }