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