예제 #1
0
        public void Deactivate()
        {
            try
            {
                if (this.CurrentFormId == 0)
                {
                    var f = OGEForm450.GetCurrentFormByUser(AccountName);

                    CurrentFormId = f != null ? f.Id : 0;
                }

                //  Set Current Form to Canceled
                if (this.CurrentFormId > 0)
                {
                    var form = OGEForm450.Get(this.CurrentFormId);

                    form.FormStatus = Constants.FormStatus.CANCELED;

                    form.Save();

                    form.RemoveExtensions();
                }

                this.Inactive       = true;
                this.InactiveDate   = DateTime.Now;
                this.EmployeeStatus = Constants.EmployeeStatus.INACTIVE;
            }
            catch (Exception ex)
            {
                // Couldn't find form, ignore exception
                SharePointHelper.HandleException(ex, "", "Employee.Deactivate");
            }
        }
예제 #2
0
파일: UserInfo.cs 프로젝트: EOP-OMB/OGE-450
        public static OGEForm450 GetUserForm(string loginName)
        {
            var form = OGEForm450.GetCurrentFormByUser(loginName);

            return(form);
        }