public bool Save() { RefreshUI(RefreshedTypes.ProgressBar); if (SetAssignFromLookup()) { List <SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll(); if (string.IsNullOrEmpty(lkSalarySolution.TxtLookUp.Text.Trim())) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "SALARYSOLUTION"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); // Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "SALARYSOLUTION")); RefreshUI(RefreshedTypes.ProgressBar); return(false); } if (cbxObjectType.SelectedIndex <= 0) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "ASSIGNEDOBJECTTYPE"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "ASSIGNEDOBJECTTYPE")); RefreshUI(RefreshedTypes.ProgressBar); return(false); } if (string.IsNullOrEmpty(lkAssignObject.TxtLookUp.Text.Trim())) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "ASSIGNEDOBJECT"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); // Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "ASSIGNEDOBJECT")); RefreshUI(RefreshedTypes.ProgressBar); return(false); } if (Convert.ToDateTime(dpStartDate.Text) > Convert.ToDateTime(dpEndDate.Text)) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERRORSTARTDATEGTENDDATE"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERRORSTARTDATEGTENDDATE")); RefreshUI(RefreshedTypes.ProgressBar); return(false); } if (validators.Count > 0) { //could use the content of the list to show an invalid message summary somehow //MessageBox.Show(validators.Count.ToString() + " invalid validators"); RefreshUI(RefreshedTypes.ProgressBar); return(false); } else { if (FormType == FormTypes.Edit) { SalarySolutionAssignView.SalarySolutionAssign.UPDATEDATE = System.DateTime.Now; SalarySolutionAssignView.SalarySolutionAssign.UPDATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID; client.SalarySolutionAssignUpdateAsync(SalarySolutionAssignView.SalarySolutionAssign); } else { client.SalarySolutionAssignAddAsync(SalarySolutionAssignView.SalarySolutionAssign); } archive.OWNERCOMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; archive.OWNERDEPARTMENTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; archive.OWNERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID; archive.OWNERPOSTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID; archive.CHECKSTATE = Convert.ToInt16(CheckStates.UnSubmit).ToString(); archive.CREATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID; // CopySalaryStandardToArchive(salaryStander);//薪资标准复制到薪资档案中 archive.SALARYARCHIVEID = Guid.NewGuid().ToString(); client.CreateSalaryArchiveAsync(int.Parse(SalarySolutionAssignView.SalarySolutionAssign.ASSIGNEDOBJECTTYPE), SalarySolutionAssignView.SalarySolutionAssign.ASSIGNEDOBJECTID, archive, true); } } else { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("选择的类型不匹配"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("选择的类型不匹配")); RefreshUI(RefreshedTypes.ProgressBar); return(false); } return(true); }