// GET: Home public ActionResult Index(int Id) { SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"]; try { DataModel.Company.Company obj = new DataModel.Company.Company(); List <DataModel.Company.Company> objList = obj.getCompany(Id, "", "", "", Convert.ToInt32(SessLogObj.USERID)); SessLogObj.objComp = objList != null?objList.FirstOrDefault() : null; Session["SessionInformation"] = SessLogObj; //Form setializing user object and encrypting string userData = JsonConvert.SerializeObject(SessLogObj); FormsAuthenticationTicket authTicket = new FormsAuthenticationTicket(1, SessLogObj.USERNAME, DateTime.Now, DateTime.Now.AddDays(1), false, userData); string encTicket = FormsAuthentication.Encrypt(authTicket); HttpCookie faCookie = new HttpCookie(FormsAuthentication.FormsCookieName, encTicket); //faCookie.Expires = authTicket.Expiration; // comment for use as non persistence cookie Response.Cookies.Add(faCookie); } catch (Exception ex) { throw; } return(View()); }
public ActionResult AddCompany(DataModel.Company.Company obj) { try { SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"]; objRes = obj.Save(obj, Convert.ToInt32(SessLogObj.USERID)); return(Json(objRes, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { throw ex; } }
public ActionResult GetPayFrequency() { try { SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"]; DataModel.Company.Company obj = new DataModel.Company.Company(); List <DataModel.Company.Company> objList = obj.getPayFrequency(SessLogObj.objComp.COMPID, 0); return(PartialView((objList != null && objList.Count > 0) ? objList.FirstOrDefault() : null)); } catch (Exception ex) { throw ex; } }
public ActionResult EditCompany(int Id) { try { SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"]; DataModel.Company.Company obj = new DataModel.Company.Company(); List <DataModel.Company.Company> modelList = obj.getCompany(Id, "", "", "", Convert.ToInt32(SessLogObj.USERID)); return(PartialView((modelList != null && modelList.Count > 0) ? modelList.FirstOrDefault() : null)); } catch (Exception ex) { throw; } }
public JsonResult CompanyList() { try { SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"]; DataModel.Company.Company obj = new DataModel.Company.Company(); List <DataModel.Company.Company> objList = obj.getCompany(0, "", "", "", Convert.ToInt32(SessLogObj.USERID)); return(Json(objList, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { throw ex; } }
public ActionResult Index() { try { SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"]; DataModel.Company.Company obj = new DataModel.Company.Company(); List <DataModel.Company.Company> objList = obj.getCompany(0, "", "", "", Convert.ToInt32(SessLogObj.USERID)); return(View(objList)); } catch (Exception ex) { throw ex; } }