Example #1
0
        /// <summary>
        /// 生成薪资体系表
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnCreatSalarySystem_Click(object sender, RoutedEventArgs e)
        {
            if (salarySystemSelected == null)
            {
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SELECTSALARYSYSTEM"),
                                               Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SELECTSALARYSYSTEM"));
                return;
            }
            if (salarySystemSelected.CHECKSTATE != Convert.ToInt32(CheckStates.Approved).ToString())
            {
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SALARYSYSTEMUNAPPROVED"),
                                               Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SALARYSYSTEMUNAPPROVED"));
                return;
            }
            ///判断
            if (cbSalaryLevelA.SelectedIndex <= 0)
            {
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "STARTSALARYLEVEL"),
                                               Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "STARTSALARYLEVEL"));
                cbSalaryLevelA.Focus();
                return;
            }
            if (cbSalaryLevelB.SelectedIndex <= 0)
            {
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "ENDSALARYLEVEL"),
                                               Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "ENDSALARYLEVEL"));
                cbSalaryLevelB.Focus();
                return;
            }
            if ((cbSalaryLevelB.SelectedItem as T_SYS_DICTIONARY).DICTIONARYVALUE < (cbSalaryLevelA.SelectedItem as T_SYS_DICTIONARY).DICTIONARYVALUE)
            {
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "STARTSALARYLEVELBIG"),
                                               Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STARTSALARYLEVELBIG"));
                return;
            }
            string        Result          = "";
            ComfirmWindow com             = new ComfirmWindow();
            int           lowSalaryLevel  = Convert.ToInt32((cbSalaryLevelB.SelectedItem as T_SYS_DICTIONARY).DICTIONARYVALUE);
            int           highSalaryLevel = Convert.ToInt32((cbSalaryLevelA.SelectedItem as T_SYS_DICTIONARY).DICTIONARYVALUE);
            string        systemID        = salarySystemSelected.SALARYSYSTEMID;

            com.OnSelectionBoxClosed += (objects, result) =>
            {
                salarySystemSelected.STARTSALARYLEVEL = highSalaryLevel;
                salarySystemSelected.ENDSALARYLEVEL   = lowSalaryLevel;
                loadbar.Start();
                client.SalarySystemUpdateAsync(salarySystemSelected);
                client.GenerateSalaryLevelAsync(lowSalaryLevel, highSalaryLevel, systemID, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID);
            };
            com.SelectionBox(Utility.GetResourceStr("SALARYSYSTEMSET"), Utility.GetResourceStr("SALARYSYSTEMDESC"), ComfirmWindow.confirmation, Result);
        }