Exemplo n.º 1
0
        void DepartmentDictionaryForms_Loaded(object sender, RoutedEventArgs e)
        {
            #region 新增
            if (FormType == FormTypes.Browse || FormType == FormTypes.Audit)
            {
                EnableControl();
            }
            #endregion
            if (FormType == FormTypes.New)
            {
                DepartmentDictionary = new T_HR_DEPARTMENTDICTIONARY();
                createUserName       = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName;
                DepartmentDictionary.DEPARTMENTDICTIONARYID = Guid.NewGuid().ToString();
                DepartmentDictionary.CHECKSTATE             = Convert.ToInt32(CheckStates.UnSubmit).ToString();
                SetToolBar();
            }
            else
            {
                RefreshUI(RefreshedTypes.ShowProgressBar);
                client.GetDepartmentDictionaryByIdAsync(departmentdictid);
            }

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