示例#1
0
        void client_GetEmployeeContractByIDCompleted(object sender, GetEmployeeContractByIDCompletedEventArgs e)
        {
            if (e.Error != null && e.Error.Message != "")
            {
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERRORINFO"),
                                               Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                RefreshUI(RefreshedTypes.HideProgressBar);
            }
            else
            {
                if (e.Result == null)
                {
                    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("NOTFOUND"),
                                                   Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                    RefreshUI(RefreshedTypes.HideProgressBar);
                    return;
                }
                EmployeeContract = e.Result;
                Utility.InitFileLoad("EmployeeContract", EmployeeContract.EMPLOYEECONTACTID, FormType, uploadFile);
                EmployeePost = EmployeeContract.T_HR_EMPLOYEE.T_HR_EMPLOYEEPOST.Where(t => t.ISAGENCY == "0").FirstOrDefault();

                if (e.Result.CHECKSTATE != Convert.ToInt32(CheckStates.UnSubmit).ToString())
                {
                    EnabledControl();
                }
                //ctrFile.Load_fileData(EmployeeContract.EMPLOYEECONTACTID);
                //if(employeeContract.CHECKSTATE )
                if (!string.IsNullOrEmpty(EmployeeContract.CREATEUSERID))
                {
                    if (EmployeeContract.CHECKSTATE == Convert.ToInt32(CheckStates.Approved).ToString() ||
                        EmployeeContract.CHECKSTATE == Convert.ToInt32(CheckStates.UnApproved).ToString())
                    {
                        RefreshUI(RefreshedTypes.AuditInfo);
                        SetToolBar();
                        RefreshUI(RefreshedTypes.HideProgressBar);
                    }
                    else
                    {
                        System.Collections.ObjectModel.ObservableCollection <string> CreateUserIDs = new System.Collections.ObjectModel.ObservableCollection <string>();
                        CreateUserIDs.Add(EmployeeContract.CREATEUSERID);
                        client.GetEmployeeToEngineAsync(CreateUserIDs);
                    }
                }
                else
                {
                    EmployeeContract.CREATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                    createUserName = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName;
                    RefreshUI(RefreshedTypes.AuditInfo);
                    SetToolBar();
                    RefreshUI(RefreshedTypes.HideProgressBar);
                }
            }
        }
示例#2
0
        void client_GetEmployeeContractByIDCompleted(object sender, GetEmployeeContractByIDCompletedEventArgs e)
        {
          
            
            if (e.Error != null && e.Error.Message != "")
            {
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERRORINFO"),
               Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                RefreshUI(RefreshedTypes.HideProgressBar);
            }
            else
            {
                
                if (e.Result == null)
                {
                    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("NOTFOUND"),
               Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                    RefreshUI(RefreshedTypes.HideProgressBar);
                    return;
                }
                EmployeeContract = e.Result;
                Utility.InitFileLoad("EmployeeContract", EmployeeContract.EMPLOYEECONTACTID, FormType, uploadFile);
                EmployeePost = EmployeeContract.T_HR_EMPLOYEE.T_HR_EMPLOYEEPOST.Where(t => t.ISAGENCY == "0").FirstOrDefault();

                if (e.Result.CHECKSTATE != Convert.ToInt32(CheckStates.UnSubmit).ToString())
                {
                    EnabledControl();
                }
                //ctrFile.Load_fileData(EmployeeContract.EMPLOYEECONTACTID);
                //if(employeeContract.CHECKSTATE )
                if (!string.IsNullOrEmpty(EmployeeContract.CREATEUSERID))
                {
                    if (EmployeeContract.CHECKSTATE == Convert.ToInt32(CheckStates.Approved).ToString()
                    || EmployeeContract.CHECKSTATE == Convert.ToInt32(CheckStates.UnApproved).ToString())
                    {
                        RefreshUI(RefreshedTypes.AuditInfo);
                        SetToolBar();
                        RefreshUI(RefreshedTypes.HideProgressBar);
                    }
                    else
                    {
                        System.Collections.ObjectModel.ObservableCollection<string> CreateUserIDs = new System.Collections.ObjectModel.ObservableCollection<string>();
                        CreateUserIDs.Add(EmployeeContract.CREATEUSERID);
                        client.GetEmployeeToEngineAsync(CreateUserIDs);
                    }
                }
                else
                {
                    EmployeeContract.CREATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                    createUserName = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName;
                    RefreshUI(RefreshedTypes.AuditInfo);
                    SetToolBar();
                    RefreshUI(RefreshedTypes.HideProgressBar);
                }

            }
        }