public ActionResult LegalEdit() { if (!string.IsNullOrEmpty(Session["username"] as string)) { if (Session["roleid"].ToString() == "1" || Session["roleid"].ToString() == "3") { try { List <Legal> legals = new List <Legal>(); LegalData ld = new LegalData(); legals = ld.GetLegalData(); return(View(legals)); } catch (Exception ex) { return(View("Error", ex)); } } else { return(View("Accessdenied")); } } else { return(RedirectToAction("Index", "Login")); } }
public string Print() { LegalData ld = new LegalData(); List <Legal> legals = ld.GetLegalData(); return(new PageOrientations().RenderRazorViewToString(this, "Print", legals)); }
// GET: Legal public ActionResult Index() { if (!string.IsNullOrEmpty(Session["username"] as string)) { try { List <Legal> legals = new List <Legal>(); LegalData ld = new LegalData(); legals = ld.GetLegalData(); return(View(legals)); } catch (Exception ex) { return(View("Error", ex)); } } else { return(RedirectToAction("Index", "Login")); } }