Esempio n. 1
0
        void PostDictionaryForms_Loaded(object sender, RoutedEventArgs e)
        {
            #region 新增
            if (FormType == FormTypes.Browse || FormType == FormTypes.Audit)
            {
                EnableControl();
            }
            #endregion
            if (FormType == FormTypes.New)
            {
                PostDictionary = new T_HR_POSTDICTIONARY();
                PostDictionary.POSTDICTIONARYID = Guid.NewGuid().ToString();
                PostDictionary.CHECKSTATE       = Convert.ToInt32(CheckStates.UnSubmit).ToString();
                createUserName = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName;
                client.GetDepartmentDictionaryAllAsync();
                SetToolBar();
            }
            else
            {
                RefreshUI(RefreshedTypes.ShowProgressBar);
                client.GetPostDictionaryByIdAsync(postdictionaryid);
            }

            //Load事件之后,加载完后获取到父控件
            EntityBrowser entBrowser = this.FindParentByType <EntityBrowser>();
            entBrowser.BtnSaveSubmit.Click -= new RoutedEventHandler(entBrowser.btnSubmit_Click);
            entBrowser.BtnSaveSubmit.Click += new RoutedEventHandler(BtnSaveSubmit_Click);
        }