Esempio n. 1
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="isCloseForm"></param>
        public void AddToClose(bool isCloseForm)
        {
            RefreshUI(RefreshedTypes.ShowProgressBar);
            if (!SMT.SaaS.FrameworkUI.Common.Utility.CheckDataIsValid(Group1))
            {
                needsubmit = false;
                RefreshUI(RefreshedTypes.HideProgressBar);
                return;
            }
            else if (cbxDepartmentType.SelectedIndex < 0)
            {
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CAUTION"), Utility.GetResourceStr("STRINGNOTNULL", "DEPARTMENTTYPE"),
                                               Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
                cbxDepartmentType.Focus();
                RefreshUI(RefreshedTypes.HideProgressBar);
                return;
            }
            else
            {
                string strMsg = "";
                DepartmentDictionary.DEPARTMENTTYPE = (cbxDepartmentType.SelectedItem as SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY).DICTIONARYVALUE.ToString();
                if (FormTypes.New == this.FormType)
                {
                    DepartmentDictionary.CREATEDATE = System.DateTime.Now;
                    ///TODO增加操作人
                    DepartmentDictionary.CREATEUSERID      = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                    DepartmentDictionary.OWNERCOMPANYID    = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                    DepartmentDictionary.OWNERDEPARTMENTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                    DepartmentDictionary.OWNERPOSTID       = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID;
                    DepartmentDictionary.OWNERID           = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                    DepartmentDictionary.EDITSTATE         = Convert.ToInt32(EditStates.UnActived).ToString();
                    client.DepartmentDictionaryAddAsync(this.DepartmentDictionary, strMsg);
                }
                else
                {
                    DepartmentDictionary.UPDATEDATE = System.DateTime.Now;
                    ///TODO增加修改人
                    DepartmentDictionary.UPDATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;

                    client.DepartmentDictionaryUpdateAsync(this.DepartmentDictionary, strMsg, "Edit");
                }
            }
        }