예제 #1
0
        public bool Save()
        {
            RefreshUI(RefreshedTypes.ProgressBar);
            SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY postLevel = cbPostLevel.SelectedItem as SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY;

            //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");
            //}
            //else
            //{
            if (postLevel == null || postLevel.DICTIONARYNAME == "空")
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "POSTLEVEL"));
                RefreshUI(RefreshedTypes.ProgressBar);
                return(false);
            }
            allowance.T_HR_AREADIFFERENCE.AREADIFFERENCEID = (cbArea.SelectedItem as T_HR_AREADIFFERENCE).AREADIFFERENCEID;
            allowance.POSTLEVEL = (cbPostLevel.SelectedItem as SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY).DICTIONARYVALUE.ToString();
            if (FormType == FormTypes.Edit)
            {
                allowance.UPDATEDATE   = System.DateTime.Now;
                allowance.UPDATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;

                client.AreaAllowanceUpdateAsync(allowance);
            }
            else
            {
                client.AreaAllowanceADDAsync(allowance);
            }
            return(true);
            //}
        }