public JsonResult LoadDomains(int isActive) { //isActive=>Denotes which type of data to get(i.e,active,inactive or all) FormsAuthenticationTicket ticket = null; try { HttpCookie authCookie = System.Web.HttpContext.Current.Request.Cookies[FormsAuthentication.FormsCookieName]; ticket = FormsAuthentication.Decrypt(authCookie.Value); _DomainBusinessLogic = new DomainBusinessLogic(); var domainArr = _DomainBusinessLogic.GetAllDomains(isActive); return(Json(domainArr)); } catch (Exception ex) { currentFile = this.ControllerContext.RouteData.Values["controller"].ToString(); // System.Diagnostics.StackTrace(true).GetFrame(0).GetFileName(); StackTrace st = new StackTrace(); StackFrame sf = st.GetFrame(0); methodName = sf.GetMethod().Name; ErrorLogHelper.UpdatingErrorLog(currentFile + "-" + methodName, ticket == null ? "N/A" : ticket.Name, ex); return(Json(null)); } }
public JsonResult AddOrUpdateDomain(Domain domainObj) { FormsAuthenticationTicket ticket = null; try { _DomainBusinessLogic = new DomainBusinessLogic(); bool isSuccess = false; _UserDetailsBusinessLogic = new UserDetailsBusinessLogic(); HttpCookie authCookie = System.Web.HttpContext.Current.Request.Cookies[FormsAuthentication.FormsCookieName]; ticket = FormsAuthentication.Decrypt(authCookie.Value); int currentUserId = _UserDetailsBusinessLogic.GetUserID(ticket.Name); if (_DomainBusinessLogic.IsDomainAvailable(domainObj.DomainCode) == true) { isSuccess = _DomainBusinessLogic.UpdateDomain(domainObj); } else { isSuccess = _DomainBusinessLogic.SaveDomain(domainObj, currentUserId); } return(Json(isSuccess)); } catch (Exception ex) { currentFile = this.ControllerContext.RouteData.Values["controller"].ToString(); // System.Diagnostics.StackTrace(true).GetFrame(0).GetFileName(); StackTrace st = new StackTrace(); StackFrame sf = st.GetFrame(0); methodName = sf.GetMethod().Name; ErrorLogHelper.UpdatingErrorLog(currentFile + "-" + methodName, ticket == null ? "N/A" : ticket.Name, ex); return(Json(false)); } }
public JsonResult ChangeStatusForAllDomains(bool isActiveForAll) { FormsAuthenticationTicket ticket = null; try { HttpCookie authCookie = System.Web.HttpContext.Current.Request.Cookies[FormsAuthentication.FormsCookieName]; ticket = FormsAuthentication.Decrypt(authCookie.Value); _DomainBusinessLogic = new DomainBusinessLogic(); bool isSuccess = false; isSuccess = _DomainBusinessLogic.ChangeStatusForAllDomains(isActiveForAll); return(Json(isSuccess)); } catch (Exception ex) { currentFile = this.ControllerContext.RouteData.Values["controller"].ToString(); // System.Diagnostics.StackTrace(true).GetFrame(0).GetFileName(); StackTrace st = new StackTrace(); StackFrame sf = st.GetFrame(0); methodName = sf.GetMethod().Name; ErrorLogHelper.UpdatingErrorLog(currentFile + "-" + methodName, ticket == null ? "N/A" : ticket.Name, ex); return(Json(false)); } }
public JsonResult GetDomainCodesForAutoComplete(string domainCode) { FormsAuthenticationTicket ticket = null; try { HttpCookie authCookie = System.Web.HttpContext.Current.Request.Cookies[FormsAuthentication.FormsCookieName]; ticket = FormsAuthentication.Decrypt(authCookie.Value); _DomainBusinessLogic = new DomainBusinessLogic(); var domainArr = _DomainBusinessLogic.GetDomainCodesForAutoComplete(domainCode); return(Json(domainArr)); } catch (Exception ex) { currentFile = this.ControllerContext.RouteData.Values["controller"].ToString(); // System.Diagnostics.StackTrace(true).GetFrame(0).GetFileName(); StackTrace st = new StackTrace(); StackFrame sf = st.GetFrame(0); methodName = sf.GetMethod().Name; ErrorLogHelper.UpdatingErrorLog(currentFile + "-" + methodName, ticket == null ? "N/A" : ticket.Name, ex); return(Json(false)); } }