private bool Save() { if (string.IsNullOrEmpty(lkEmployeeName.TxtLookUp.Text)) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CAUTION"), "请选择待办接收人,请确认!", Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); RefreshUI(RefreshedTypes.HideProgressBar); return(false); } if (systemSetting == null) { systemSetting = new T_HR_SYSTEMSETTING(); systemSetting.SYSTEMSETTINGID = Guid.NewGuid().ToString(); systemSetting.MODELTYPE = "0"; systemSetting.PARAMETERNAME = ContactDay.Value.ToString(); systemSetting.PARAMETERVALUE = EntryDay.Value.ToString(); systemSetting.OWNERCOMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; var employee = lkEmployeeName.DataContext as T_HR_EMPLOYEE; systemSetting.OWNERID = employee.EMPLOYEEID; client.AddSystemParamSetAsync(systemSetting); } else { systemSetting.PARAMETERNAME = ContactDay.Value.ToString(); systemSetting.PARAMETERVALUE = EntryDay.Value.ToString(); var employee = lkEmployeeName.DataContext as T_HR_EMPLOYEE; systemSetting.OWNERID = employee.EMPLOYEEID; client.SystemParamSetUpdateAsync(systemSetting); } return(true); }
public void Save() { //List<SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll(); //if (validators.Count > 0) //{ // // MessageBox.Show(validators.Count.ToString() + " invalid validators"); //} SystemSetting.MODELTYPE = (cbxmodetype.SelectedIndex - 1).ToString(); SystemSetting.MODELVALUE = tbmodetypevalue.Text; SystemSetting.PARAMETERNAME = txtparamname.Text; SystemSetting.PARAMETERVALUE = txtparamvalue.Text; if (SystemSetting.MODELTYPE == "4") { SystemSetting.PARAMETERVALUE = SMT.SaaS.FrameworkUI.Common.Utility.Encrypt(SystemSetting.PARAMETERVALUE); } SystemSetting.REMARK = txtremark.Text; RefreshUI(RefreshedTypes.ProgressBar); if (FormType == FormTypes.Edit) { SystemSetting.UPDATEDATE = System.DateTime.Now; client.SystemParamSetUpdateAsync(SystemSetting, systemSettingPost); } else { SystemSetting.CREATEDATE = System.DateTime.Now; SystemSetting.OWNERCOMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; SystemSetting.OWNERDEPARTMENTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; SystemSetting.OWNERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID; SystemSetting.OWNERPOSTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID; SystemSetting.CREATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID; SystemSetting.CREATECOMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; SystemSetting.CREATEDEPARTMENTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; SystemSetting.CREATEPOSTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID; client.AddSystemParamSetAsync(SystemSetting); } }