Ejemplo n.º 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");
            }
        }
Ejemplo n.º 2
0
        public static OGEForm450 GetUserForm(string loginName)
        {
            var form = OGEForm450.GetCurrentFormByUser(loginName);

            return(form);
        }