Ejemplo n.º 1
0
        private void Save()
        {
            try
            {
                if (Check())
                {
                    RefreshUI(RefreshedTypes.ShowProgressBar);//点击保存后显示进度条


                    if (cbContractLevel.SelectedIndex <= 0)//合同级别
                    {
                        Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("STRINGNOTNULL", "CONTRACTLEVEL"));
                        RefreshUI(RefreshedTypes.HideProgressBar);
                        return;
                    }
                    if (actions == FormTypes.New)
                    {
                        InfoObj.CONTRACTTYPEID     = System.Guid.NewGuid().ToString();
                        InfoObj.CREATEUSERID       = Common.CurrentLoginUserInfo.EmployeeID;                //创建人ID
                        InfoObj.CREATEUSERNAME     = Common.CurrentLoginUserInfo.EmployeeName;              //创建人姓名
                        InfoObj.OWNERID            = Common.CurrentLoginUserInfo.EmployeeID;                //所属用户ID
                        InfoObj.OWNERNAME          = Common.CurrentLoginUserInfo.EmployeeName;              //所属用户名
                        InfoObj.OWNERCOMPANYID     = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;    //所属公司ID
                        InfoObj.OWNERDEPARTMENTID  = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; //所属部门ID
                        InfoObj.OWNERPOSTID        = Common.CurrentLoginUserInfo.UserPosts[0].PostID;       //所属岗位ID
                        InfoObj.CREATECOMPANYID    = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;    //创建公司ID
                        InfoObj.CREATEDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; //创建部门ID
                        InfoObj.CREATEPOSTID       = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; //创建岗位ID
                        InfoObj.OWNERNAME          = Common.CurrentLoginUserInfo.EmployeeName;

                        contractClient.ContractTypeAddAsync(InfoObj);
                    }
                    else
                    {
                        InfoObj.UPDATEUSERID   = Common.CurrentLoginUserInfo.EmployeeID;   //修改人ID
                        InfoObj.UPDATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName; //修改人姓名

                        contractClient.UpdateContraTypeAsync(InfoObj);
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.SendException("保存Save函数", "OA", "T_OA_CONTRACTTYPE", "保存合同类型返回错误", ex, ExceptionLevel.Middle, ExceptionType.Error);
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("ERRORINFO"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
            }
        }