Example #1
0
        /// <summary>
        /// 保存
        /// </summary>
        private void Save()
        {
            //处理页面验证
            List <SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll();

            if (!SMT.SaaS.FrameworkUI.Common.Utility.CheckDataIsValid(Group1))
            {
                RefreshUI(RefreshedTypes.HideProgressBar);
                return;
            }
            else
            {
                RefreshUI(RefreshedTypes.ShowProgressBar);
                Complain.UPDATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                Complain.UPDATEDATE   = DateTime.Now;

                if (FormType == FormTypes.New)
                {
                    //提出申诉
                    Complain.COMPLAINREMARK = txtComplainReason.Text.Trim();

                    //所属
                    Complain.CREATECOMPANYID    = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                    Complain.CREATEDEPARTMENTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                    Complain.CREATEPOSTID       = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID;
                    Complain.OWNERID            = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                    Complain.OWNERCOMPANYID     = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                    Complain.OWNERDEPARTMENTID  = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                    Complain.OWNERPOSTID        = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID;

                    Complain.CREATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                    Complain.CREATEDATE   = DateTime.Now;

                    client.AddKPIRecordComplainAsync(Complain);
                }
                // 1s 冉龙军
                //else if(FormType == FormTypes.Edit)
                else if (FormType == FormTypes.Audit)
                // 1e
                {
                    Complain.REVIEWERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                    Complain.UPDATEDATE = DateTime.Now;
                    try
                    {
                        if (txtAppraisalScore.Text.Trim() == "")
                        {
                            //审核通过或者未填
                            if (txtAppraisalScore.IsEnabled == true)
                            {
                                //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("NOFOUNDSCORE"));
                                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("NOFOUNDSCORE"),
                                                               Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                                return;
                            }
                        }
                        else
                        {
                            //Complain.REVIEWSCORE = int.Parse(txtAppraisalScore.Text.Trim());
                            // 1s 冉龙军
                            Complain.REVIEWSCORE = int.Parse(txtAppraisalScore.Text.Trim());
                            // 1e
                        }
                    }
                    catch (Exception ex)
                    {
                        //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(ex.Message));
                        ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERRORINFO"),
                                                       Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                        return;
                    }
                    Complain.REVIEWREMARK = txtAppraisalRemark.Text.Trim();
                    client.UpdateKPIRecordComplainAsync(Complain);
                }
                else
                {
                    RefreshUI(RefreshedTypes.HideProgressBar);
                }
            }
        }