public bool Save() { RefreshUI(RefreshedTypes.ProgressBar); List <SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll(); 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"); // Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), validators.Count.ToString() + " invalid validators"); RefreshUI(RefreshedTypes.ProgressBar); return(false); } else { if (FormType == FormTypes.Edit) { area.UPDATEDATE = System.DateTime.Now; area.UPDATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID; client.AreaCategoryUpdateAsync(area); } else { client.AreaCategoryADDAsync(area); } } return(true); }
public void Save() { RefreshUI(RefreshedTypes.ShowProgressBar); List <SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll(); if (validators.Count > 0) { //could use the content of the list to show an invalid message summary somehow // Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), validators.Count.ToString() + " invalid validators"); RefreshUI(RefreshedTypes.HideProgressBar); return; } else { citys.Clear(); string[] codes = citycode.Split(','); foreach (string code in codes) { if (!string.IsNullOrEmpty(code)) { T_HR_AREACITY temp = new T_HR_AREACITY(); temp.AREACITYID = Guid.NewGuid().ToString(); temp.T_HR_AREADIFFERENCE = new T_HR_AREADIFFERENCE(); temp.T_HR_AREADIFFERENCE.AREADIFFERENCEID = area.AREADIFFERENCEID; temp.CITY = code; citys.Add(temp); } } if (FormType == FormTypes.Edit) { area.UPDATEDATE = System.DateTime.Now; area.UPDATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID; client.AreaCategoryUpdateAsync(area); } else { client.AreaCategoryADDAsync(area); } } }