Ejemplo n.º 1
0
 public ActionResult TermCondition(FormCollection form)
 {
     if (Session["Role"].ToString() == "N")
     {
         Response.Write("Access denied!");
         return(null);
     }
     else
     {
         RepositoryOBTRS db = new RepositoryOBTRS();
         ViewData["Data"] = db.GetTermCondition();
         if (form.Get("RichTextEditor") != null)
         {
             if (Session["Role"].ToString() == "R")
             {
                 ViewData["Result"] = "Your role is readonly";
             }
             else
             {
                 ViewData["Result"] = db.UpdateTermCondititon(form.Get("RichTextEditor"));
                 ViewData["Data"]   = db.GetTermCondition();
             }
             return(View());
         }
         else
         {
             ViewData["Result"] = "";
         }
         return(View());
     }
 }