示例#1
0
        /// <summary>
        /// 保存
        /// </summary>
        private bool Save()
        {
            bool flag = false;

            try
            {
                RefreshUI(RefreshedTypes.ShowProgressBar);
                List <SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll();
                if (validators.Count > 0)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("REQUIREDFIELDS"));
                    RefreshUI(RefreshedTypes.HideProgressBar);
                    return(false);
                }

                if (FormType == FormTypes.New)
                {
                    clientAtt.AddOvertimeRewardAsync(entOvertimeReward);
                    flag = true;
                }
                else
                {
                    clientAtt.ModifyOvertimeRewardAsync(entOvertimeReward);
                    flag = true;
                }
            }
            catch (Exception ex)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(ex.Message));
                RefreshUI(RefreshedTypes.HideProgressBar);
            }

            return(flag);
        }
        /// <summary>
        /// 保存
        /// </summary>
        public bool SaveMaster(FormTypes FormType)
        {
            bool flag = false;

            try
            {
                List <SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll();
                if (validators.Count > 0)
                {
                    return(false);
                }

                CheckSubmitForm(FormType, out flag);

                if (!flag)
                {
                    return(false);
                }

                if (FormType == FormTypes.New)
                {
                    clientAtt.AddSchedulingTemplateMasterAsync(SchedulingTemplateMaster);
                }
                else
                {
                    clientAtt.ModifySchedulingTemplateMasterAsync(SchedulingTemplateMaster);
                }
            }
            catch (Exception ex)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(ex.Message));
            }

            return(flag);
        }
        private bool Check()
        {
            if (string.IsNullOrEmpty(txtReleaseName.Text.ToString()))
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "RELEASENAME"));
                this.txtReleaseName.Focus();
                return(false);
            }
            if (string.IsNullOrEmpty(txtContent.Text.ToString()))
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "CONTENTDISTRIBUTION"));
                this.txtContent.Focus();
                return(false);
            }

            List <SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll();

            if (validators.Count > 0)
            {
                foreach (var h in validators)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(h.ErrorMessage));
                    return(false);
                }
                RefreshUI(RefreshedTypes.HideProgressBar);//关闭进度条动画
            }
            return(true);
        }
        private bool Check()
        {
            if (this.nudBalanceMonth.Value <= 0)
            {
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("NOTLESSTHANZERO", "PRINTCOPIES"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
                this.nudBalanceMonth.Focus();
                return(false);
            }
            if (string.IsNullOrEmpty(this.ContractTitle.Text.ToString()))
            {
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("PLEASESELECTACONTRACTTOPRINT"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
                this.ContractTitle.Focus();
                return(false);
            }

            List <SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll();

            if (validators.Count > 0)
            {
                foreach (var h in validators)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(h.ErrorMessage));
                    return(false);
                }
                RefreshUI(RefreshedTypes.HideProgressBar);//关闭进度条动画
            }
            return(true);
        }
示例#5
0
        private bool Check()
        {
            if (this.cbModelCode.SelectedIndex <= 0)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "AGENTMODULE"));
                return(false);
            }

            if (this.cbSYSTEMTYPE.SelectedIndex < 0)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "SYSTEMCODE"));
                return(false);
            }

            List <SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll();

            if (validators.Count > 0)
            {
                foreach (var h in validators)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(h.ErrorMessage));
                    return(false);
                }
                RefreshUI(RefreshedTypes.HideProgressBar);
            }
            return(true);
        }
示例#6
0
        /// <summary>
        /// 保存
        /// </summary>
        private bool Save()
        {
            bool flag = false;

            try
            {
                List <SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll();
                if (validators.Count > 0)
                {
                    return(false);
                }

                CheckSubmitForm(out flag);

                if (!flag)
                {
                    return(false);
                }

                if (FormType == FormTypes.New)
                {
                    clientAtt.AddShiftDefineAsync(entShiftDefine);
                }
                else
                {
                    clientAtt.ModifyShiftDefineAsync(entShiftDefine);
                }
            }
            catch (Exception ex)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(ex.Message));
            }

            return(flag);
        }
示例#7
0
        public void DoAction(string actionType)
        {
            string errorString = Check();

            if (errorString != null)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(errorString));
                return;
            }

            List <SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll();

            foreach (var h in validators)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(h.ErrorMessage));
                return;
            }

            RefreshUI(RefreshedTypes.ShowProgressBar);
            switch (actionType)
            {
            case "0":
                refreshType = RefreshedTypes.All;
                Save();
                break;

            case "1": refreshType = RefreshedTypes.CloseAndReloadData;
                Save();
                break;
            }
        }
示例#8
0
        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            List <SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll();

            if (validators.Count > 0)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), validators.Count.ToString() + " invalid validators");
            }
            else
            {
                if (FormType == SMT.SaaS.FrameworkUI.FormTypes.New)
                {
                    RelationPost.CREATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                    RelationPost.CREATEDATE   = DateTime.Now;
                    RelationPost.T_HR_POST    = Post;
                    client.RelationPostAddAsync(RelationPost);
                }
                else
                {
                    RelationPost.UPDATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                    RelationPost.UPDATEDATE   = DateTime.Now;
                    client.RelationPostUpdateAsync(RelationPost);
                }
            }
        }
示例#9
0
        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");
                RefreshUI(RefreshedTypes.ProgressBar);
                return(false);
            }
            else
            {
                if (FormType == FormTypes.Edit)
                {
                    performanceRewardRecord.UPDATEDATE   = System.DateTime.Now;
                    performanceRewardRecord.UPDATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;

                    client.PerformanceRewardRecordUpdateAsync(performanceRewardRecord);
                }
                else
                {
                    RefreshUI(RefreshedTypes.ProgressBar);
                }
            }
            return(true);
        }
示例#10
0
        //检查
        private bool Check()
        {
            List <SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll();

            if (validators.Count > 0)
            {
                foreach (var h in validators)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(h.ErrorMessage));
                    return(false);
                }
            }
            // 发布
            if (issuanceExtOrgObj.Count == 0)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SELECTFIRST", "DISTRBUTEOBJECT"));
                return(false);
            }
            if (cbDepCity.SelectedIndex < 1)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SELECTFIRST", "SATISFACTIONANSWERGROUP"));
                return(false);
            }

            return(true);
        }
示例#11
0
        public bool Save()
        {
            RefreshUI(RefreshedTypes.ProgressBar);
            List <SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll();

            if (validators.Count > 0)
            {
                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
                {
                    //area.T_OA_TRAVELSOLUTIONS=
                    area.OWNERCOMPANYID    = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                    area.OWNERDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                    area.OWNERPOSTID       = Common.CurrentLoginUserInfo.UserPosts[0].PostID;
                    area.OWNERID           = Common.CurrentLoginUserInfo.EmployeeID;

                    client.AreaCategoryADDAsync(area, TravelSolutionsId, Common.CurrentLoginUserInfo.UserPosts[0].CompanyID);
                }
            }
            return(true);
        }
示例#12
0
        // add by zl
        private bool Check()
        {
            List <SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll();

            if (validators.Count > 0)
            {
                foreach (var h in validators)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(h.ErrorMessage));
                    return(false);
                }
                RefreshUI(RefreshedTypes.HideProgressBar);
            }

            string strCostDate = string.Empty;

            strCostDate = this.dpCostDate.Text.ToString();
            if (string.IsNullOrEmpty(strCostDate))
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "CostDateTime"));
                return(false);
            }

            return(true);
        }
        private bool Check()
        {
            List <SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll();

            if (validators.Count > 0)
            {
                foreach (var h in validators)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(h.ErrorMessage));
                    return(false);
                }
            }

            string strDPDate = string.Empty;

            strDPDate = this.dpDate.Text.ToString();
            if (string.IsNullOrEmpty(strDPDate))
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "ACCIDENTDATE"));
                return(false);
            }


            return(true);
        }
示例#14
0
        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);
        }
示例#15
0
        private void Save()
        {
            List <SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll();

            if (FormType == FormTypes.Edit)
            {
                KPIRecordComplain.UPDATEDATE = System.DateTime.Now;
                //client.CompainRecordUpdateAsync(KPIRecordComplain);
            }
            else
            {
                RefreshUI(RefreshedTypes.ProgressBar);


                //KPIRecordComplain.CHECKSTATE = "0";
                //KPIRecordComplain.CREATEDATE = System.DateTime.Now;
                //KPIRecordComplain.OWNERCOMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                //KPIRecordComplain.OWNERDEPARTMENTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                //KPIRecordComplain.OWNERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                //KPIRecordComplain.OWNERPOSTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID;
                //KPIRecordComplain.CREATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                //KPIRecordComplain.CREATECOMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                //KPIRecordComplain.CREATEDEPARTMENTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                //KPIRecordComplain.CREATEPOSTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID;
            }
        }
示例#16
0
        //private void SetFormDefailValue(T_OA_VEHICLE defaultInfo)
        //{
        //    txtCarModel.Text = defaultInfo.VEHICLEMODEL;
        //    txtCompanyID.Text = defaultInfo.COMPANYID;
        //    txtVehicleAssetId.Text = defaultInfo.ASSETID;
        //    txtVehicleAssetId.IsReadOnly = true;
        //    txtVIN.Text = defaultInfo.VIN;
        //    dpBuyDate.Text = defaultInfo.BUYDATE.ToShortDateString();
        //    txtPrice.Text = defaultInfo.BUYPRICE.ToString();
        //    txtINITIALRANGE.Text = defaultInfo.INITIALRANGE.ToString();
        //    txtINTERVALRANGE.Text = defaultInfo.INTERVALRANGE.ToString();
        //    txtMAINTAINCOMPANY.Text = defaultInfo.MAINTAINCOMPANY;
        //    txtMAINTAINTEL.Text = defaultInfo.MAINTAINTEL;
        //    txtMAINTENANCECYCLE.Text = defaultInfo.MAINTENANCECYCLE.ToString();
        //    txtMAINTENANCEREMIND.Text = defaultInfo.MAINTENANCEREMIND.ToString();
        //    txtSEATQUANTITY.Text = defaultInfo.SEATQUANTITY.ToString();
        //    txtVEHICLEBRANDS.Text = defaultInfo.VEHICLEBRANDS;
        //    txtVEHICLETYPE.Text = defaultInfo.VEHICLETYPE;
        //    txtWEIGHT.Text = defaultInfo.WEIGHT.ToString();
        //    if (defaultInfo.VEHICLEFLAG.Trim() == null)
        //    {
        //        cmbUserFlag.SelectedIndex = -1;
        //    }
        //    else
        //    {
        //        if (defaultInfo.VEHICLEFLAG.Trim() == "1")
        //        {
        //            cmbUserFlag.SelectedIndex = 1;
        //        }
        //        else
        //        {
        //            cmbUserFlag.SelectedIndex = 0;
        //        }
        //    }
        //}

        //验证
        private bool Check()
        {
            List <SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll();

            if (validators.Count > 0)
            {
                foreach (var h in validators)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(h.ErrorMessage));
                    return(false);
                }
            }

            if (this.cmbUserFlag.SelectedIndex <= 0)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "UseFlag"));
                this.cmbUserFlag.Focus();
                return(false);
            }

            if (dpBuyDate.Text == null || dpBuyDate.Text == "")
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("BuyDate"));
                return(false);
            }
            return(true);
        }
示例#17
0
        /// <summary>
        /// 保存
        /// </summary>
        private bool Save()
        {
            bool flag = false;

            try
            {
                List <SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll();
                if (validators.Count > 0)
                {
                    return(false);
                }

                CheckSubmitForm(out flag);

                if (!flag)
                {
                    return(false);
                }
                if (rbWomen.IsChecked == true)
                {
                    entLeaveTypeSet.SEXRESTRICT = "0";
                }
                if (rbMan.IsChecked == true)
                {
                    entLeaveTypeSet.SEXRESTRICT = "1";
                }
                if (rbNoLimit.IsChecked == true)
                {
                    entLeaveTypeSet.SEXRESTRICT = "2";
                }
                if (FormType == FormTypes.New)
                {
                    //如果最小值是0.5获取到的值是0
                    if (nudMaxDays.Value > 0)
                    {
                        if (entLeaveTypeSet.MAXDAYS == 0)
                        {
                            entLeaveTypeSet.MAXDAYS = decimal.Round((decimal)nudMaxDays.Value, 2); //(decimal)nudMaxDays.Value;
                        }
                    }
                    clientAtt.AddLeaveTypeSetAsync(entLeaveTypeSet);
                }
                else
                {
                    entLeaveTypeSet.MAXDAYS = decimal.Round((decimal)entLeaveTypeSet.MAXDAYS, 2);
                    clientAtt.ModifyLeaveTypeSetAsync(entLeaveTypeSet);
                }

                loadbar.Start();
            }
            catch (Exception ex)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(ex.Message));
            }

            return(flag);
        }
        private bool Check()
        {
            string StrStart = string.Empty;
            string StrEnd   = string.Empty;

            StrStart = dateREPAIRDATE.Text.ToString();   //送修时间
            StrEnd   = dateRETRIEVEDATE.Text.ToString(); //取回时间
            DateTime DtStart = new DateTime();
            DateTime DtEnd   = new DateTime();

            if (!string.IsNullOrEmpty(StrStart) && !string.IsNullOrEmpty(StrEnd))
            {
                DtStart = System.Convert.ToDateTime(StrStart);
                DtEnd   = System.Convert.ToDateTime(StrEnd);
                if (DtEnd < DtStart)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CANNOTBELESSTHANTHEREPAIRTIME", "RETRIEVEDATE"));
                    return(false);
                }
            }

            if (string.IsNullOrEmpty(StrStart))
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "REPAIRDATE"));
                return(false);
            }

            if (string.IsNullOrEmpty(StrEnd))
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "RETRIEVEDATE"));
                return(false);
            }

            List <SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll();

            if (validators.Count > 0)
            {
                foreach (var h in validators)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(h.ErrorMessage));
                    return(false);
                }
            }
            bool b = (bool)ckbHasFee.IsChecked;

            if (b)
            {
                if (!CheckInputIsDecimal(txtFee.Text.Trim()))
                {
                    Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("IsDouble", "RepairFees"));
                    return(false);
                }
            }
            return(true);
        }
示例#19
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <returns></returns>
        private bool Save()
        {
            List <SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll();

            if (validators.Count > 0)
            {
                return(false);
            }


            if (!string.IsNullOrEmpty(txtTerminateRemark.Text))
            {
                cancelLeave.REMARK = txtTerminateRemark.Text;
            }

            if (cancelLeave.STARTDATETIME == null || cancelLeave.ENDDATETIME == null)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CANCELLEAVEDATEREQUIRED"));
                return(false);
            }

            if (cancelLeave.LEAVEDAYS == null && cancelLeave.LEAVEHOURS == null)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CANCELLEAVEDATEREQUIRED"));
                return(false);
            }
            if (cancelLeave.LEAVEDAYS <= 0 && cancelLeave.LEAVEHOURS <= 0)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), "销假天数和销假时长不能读为0");
                return(false);
            }
            if (cancelLeave.TOTALHOURS <= 0)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), "销假总时长不能读为0");
                return(false);
            }
            if (FormType == FormTypes.New)
            {
                client.EmployeeCancelLeaveAddAsync(cancelLeave);
            }
            else
            {
                cancelLeave.UPDATEDATE   = System.DateTime.Now;
                cancelLeave.UPDATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;

                client.EmployeeCancelLeaveUpdateAsync(cancelLeave);
            }

            return(true);
        }
示例#20
0
        private void Save()
        {
            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");
            }
            else
            {
                //承接人
                //OrganizationWS.V_EMPLOYEEPOST employee = lkEmployeeName.DataContext as OrganizationWS.V_EMPLOYEEPOST;
                //Evection.REPLACEPEOPLE = employee.T_HR_EMPLOYEE.EMPLOYEEID;
                //if (FormType == FormTypes.Edit)
                //{
                //    //如果状态为审核通过,修改时,则修改状态为审核中
                //    if (Evection.CHECKSTATE == Convert.ToInt32(CheckStates.Approved).ToString())
                //    {
                //        Evection.CHECKSTATE = Convert.ToInt32(CheckStates.Approving).ToString();
                //    }
                //    Evection.UPDATEDATE = System.DateTime.Now;
                //    Evection.UPDATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;

                //    client.EmployeeEvectionRecordUpdateAsync(Evection);
                //}
                //else
                //{
                //    //所属员工
                //    Evection.OWNERCOMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                //    Evection.OWNERDEPARTMENTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                //    Evection.OWNERPOSTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID;
                //    Evection.OWNERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;

                //    //添加人所属部门ID
                //    Evection.CREATEPOSTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID;
                //    Evection.CREATEDEPARTMENTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                //    Evection.CREATECOMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                //    //出差记录只能本人申请请
                //    Evection.EMPLOYEEID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                //    Evection.EMPLOYEENAME = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName;
                //    Evection.EMPLOYEECODE = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeCode;

                //    Evection.CHECKSTATE = Convert.ToInt32(CheckStates.UnSubmit).ToString();
                //    Evection.CREATECOMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                //    Evection.CREATEDATE = DateTime.Now;
                client.EmployeeEvectionRecordAddAsync(Evection);
                //}
            }
        }
示例#21
0
        private bool CheckPriority()
        {
            List <SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll();

            if (validators.Count > 0)
            {
                foreach (var h in validators)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(h.ErrorMessage));
                    return(false);
                }
            }
            return(true);
        }
示例#22
0
        private bool Check()
        {
            List <SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll();

            if (validators.Count > 0)
            {
                foreach (var h in validators)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(h.ErrorMessage));
                    return(false);
                }
                RefreshUI(RefreshedTypes.HideProgressBar);
            }
            //add by zl
            string StrStart = string.Empty;
            string StrEnd   = string.Empty;

            StrStart = this.dateREPAIRDATE.Text.ToString();
            StrEnd   = this.dateRETRIEVEDATE.Text.ToString();
            DateTime DtStart = new DateTime();
            DateTime DtEnd   = new DateTime();

            if (!string.IsNullOrEmpty(StrStart) && !string.IsNullOrEmpty(StrEnd))
            {
                DtStart = System.Convert.ToDateTime(StrStart);
                DtEnd   = System.Convert.ToDateTime(StrEnd);
                if (DtEnd < DtStart)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CANNOTBELESSTHANTHEREPAIRTIME", "RETRIEVEDATE"));
                    return(false);
                }
            }

            if (string.IsNullOrEmpty(StrStart))
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "REPAIRDATE"));
                return(false);
            }

            if (string.IsNullOrEmpty(StrEnd))
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "RETRIEVEDATE"));
                return(false);
            }

            //end

            return(true);
        }
示例#23
0
 private bool Check()//UI数据验证
 {
     List<SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll();
     if (validators.Count > 0)
     {
         foreach (var info in validators)
         {
             ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(info.ErrorMessage),
                 Utility.GetResourceStr("CONFIRM"), MessageIcon.Information);
             return false;
         }
        
     }
     return true;
 }
示例#24
0
        private bool Check()
        {
            List <SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll();

            if (validators.Count > 0)
            {
                foreach (var h in validators)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(h.ErrorMessage));
                    return(false);
                }
                RefreshUI(RefreshedTypes.HideProgressBar);//关闭进度条动画
            }
            return(true);
        }
示例#25
0
        public void Save()
        {
            RefreshUI(RefreshedTypes.ProgressBar);
            //ValidationHelper.ValidateProperty<T_HR_EMPLOYEE>(Employee);
            List <SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll();

            //T_SYS_DICTIONARY performanceCategory = cbPerformanceCategory.SelectedItem as T_SYS_DICTIONARY;
            //T_SYS_DICTIONARY calculateType = cbCalculateType.SelectedItem as 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");
                RefreshUI(RefreshedTypes.ProgressBar);
            }
            else
            {
                if (cbPerformanceCategory.SelectedIndex <= 0)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "PERFORMANCECATEGORY"));
                    RefreshUI(RefreshedTypes.ProgressBar);
                    return;
                }
                if (cbCalculateType.SelectedIndex <= 0)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "CALCULATETYPE"));
                    RefreshUI(RefreshedTypes.ProgressBar);
                    return;
                }
                if (string.IsNullOrEmpty(txtPerformanceCapital.Text.Trim()))
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "PERFORMANCECAPITAL"));
                    RefreshUI(RefreshedTypes.ProgressBar);
                    return;
                }
                if (FormType == FormTypes.Edit)
                {
                    PerformanceRewardSet.UPDATEDATE   = System.DateTime.Now;
                    PerformanceRewardSet.UPDATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;

                    client.PerformanceRewardSetUpdateAsync(PerformanceRewardSet);
                }
                else
                {
                    client.PerformanceRewardSetAddAsync(PerformanceRewardSet);
                }
            }
        }
示例#26
0
        private bool CheckDocTypeTemplate()
        {
            List <SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll();

            if (validators.Count > 0)
            {
                foreach (var h in validators)
                {
                    //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(h.ErrorMessage));
                    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(h.ErrorMessage),
                                                   Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                    return(false);
                }
            }
            return(true);
        }
示例#27
0
        /// <summary>
        /// 保存
        /// </summary>
        private bool Save()
        {
            bool flag = false;

            try
            {
                List <SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll();
                if (validators.Count > 0)
                {
                    return(false);
                }

                CheckSubmitForm(out flag);

                if (!flag)
                {
                    return(false);
                }

                if (FormType == FormTypes.New)
                {
                    if (aanudLeaveDays.Value > 0)
                    {
                        if (entFreeLeaveDaySet.LEAVEDAYS == 0)
                        {
                            entFreeLeaveDaySet.LEAVEDAYS = decimal.Round((decimal)aanudLeaveDays.Value, 2);
                        }
                        else
                        {
                            entFreeLeaveDaySet.LEAVEDAYS = decimal.Round((decimal)entFreeLeaveDaySet.LEAVEDAYS, 2);
                        }
                    }
                    clientAtt.AddFreeLeaveDaySetAsync(entFreeLeaveDaySet);
                }
                else
                {
                    entFreeLeaveDaySet.LEAVEDAYS = decimal.Round((decimal)aanudLeaveDays.Value, 2);
                    clientAtt.ModifyFreeLeaveDaySetAsync(entFreeLeaveDaySet);
                }
            }
            catch (Exception ex)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(ex.Message));
            }

            return(flag);
        }
示例#28
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            //判断数据不能为空
            //if (string.IsNullOrEmpty(txtBlackName.Text.Trim()))
            //{
            //    Utility.ShowCustomMessage(MessageTypes.Caution, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("NAMEISNOTNULL"));
            //    txtBlackName.Focus();
            //    return;
            //}
            //if (string.IsNullOrEmpty(txtCardNumber.Text.Trim()))
            //{
            //    Utility.ShowCustomMessage(MessageTypes.Caution, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("IDCARDNUMBERNOTNULL"));
            //    txtCardNumber.Focus();
            //    return;
            //}
            //if (string.IsNullOrEmpty(dpcBeginDate.Text.Trim()))
            //{
            //    Utility.ShowCustomMessage(MessageTypes.Caution, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("BEGINDATENOTNULL"));
            //    dpcBeginDate.Focus();
            //    return;
            //}
            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");
            }
            else
            {
                if (FormType == FormTypes.New)
                {
                    BlackList.CREATEDATE   = DateTime.Now;
                    BlackList.CREATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                    client.BlackListAddAsync(BlackList);
                }
                else
                {
                    BlackList.UPDATEDATE   = DateTime.Now;
                    BlackList.UPDATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                    string strMsg = "";
                    client.BlackListUpdateAsync(BlackList, strMsg);
                }
            }
        }
示例#29
0
        private bool Check()
        {
            string tbxTemplateName = "";  //合同模板

            if (string.IsNullOrEmpty(this.tbxTemplateName.Text.ToString()))
            {
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("STRINGNOTNULL", "OATEMPLATENAME"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);//模板名称
                this.tbxTemplateName.Focus();
                return(false);
            }
            else
            {
                tbxTemplateName = this.tbxTemplateName.Text.ToString();
            }
            if (this.tbxContractText.GetRichTextbox().Xaml == "")
            {
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("STRINGNOTNULL", "THECONTRACT"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);//合同内容
                this.tbxContractText.Focus();
                return(false);
            }
            if (string.IsNullOrEmpty(this.tbxContractTitle.Text.ToString()))
            {
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("STRINGNOTNULL", "TEMPLATETITLE"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);//标题
                this.tbxContractTitle.Focus();
                return(false);
            }
            if (cbContractLevel.SelectedIndex <= 0)//合同级别
            {
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("STRINGNOTNULL", "CONTRACTLEVEL"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
                this.cbContractLevel.Focus();
                return(false);
            }

            List <SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll();

            if (validators.Count > 0)
            {
                foreach (var h in validators)
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(h.ErrorMessage));
                    return(false);
                }
                RefreshUI(RefreshedTypes.HideProgressBar);//关闭进度条动画
            }
            return(true);
        }
示例#30
0
        private void Save()
        {
            //处理页面验证
            List <SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll();

            RefreshUI(RefreshedTypes.ShowProgressBar);
            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");
                //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "RANDOMGROUPNAME"));
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CAUTION"), Utility.GetResourceStr("STRINGNOTNULL", "RANDOMGROUPNAME"),
                                               Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
                RefreshUI(RefreshedTypes.HideProgressBar);
            }
            else
            {
                //抽查组
                RandomGroup.RANDOMGROUPNAME = txtRandomGroupName.Text.Trim();
                RandomGroup.GROUPREMARK     = txtRandomGroupDesc.Text.Trim();
                RandomGroup.UPDATEUSERID    = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                RandomGroup.UPDATEDATE      = DateTime.Now;
                string strMsg = string.Empty;
                if (FormType == FormTypes.Edit)
                {
                    client.UpdateRandomGroupAsync(RandomGroup, strMsg);
                }
                else if (FormType == FormTypes.New)
                {
                    //所属
                    RandomGroup.CREATECOMPANYID    = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                    RandomGroup.CREATEDEPARTMENTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                    RandomGroup.CREATEPOSTID       = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID;
                    RandomGroup.OWNERCOMPANYID     = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                    RandomGroup.OWNERDEPARTMENTID  = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                    RandomGroup.OWNERPOSTID        = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID;
                    RandomGroup.OWNERID            = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;

                    RandomGroup.CREATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                    RandomGroup.CREATEDATE   = DateTime.Now;
                    client.AddRandomGroupAsync(RandomGroup, strMsg);
                }
            }
        }