public ActionResult Save(FormCollection fc) { if (fc["usertypeid"] == null || fc["usertypeid"] == "") { User_types t = new User_types(); Boolean res = t.InsertUser_types(fc); if (res) { return(Content("Record Inserted Successfully")); } else { return(Content("Error Adding Record Try Again")); } } else { User_types t = new User_types(); Boolean res = t.UpdateUser_types(fc); if (res) { return(Content("Record Edited Successfully")); } else { return(Content("Error Editing Record Try Again")); } } //return PartialView("SaveRec"); }
public ActionResult savepermissions() { int utype = Convert.ToInt32(Request.QueryString.Get("uid")); String Mess = ""; String ids = Request.QueryString.Get("chkids"); User_types u = new User_types(); if (u.SavePer(ids, utype)) { Mess = "Permissions Saved "; } else { Mess = "Try again"; } return(Content(Mess)); }
public ActionResult User_typesdelete(int id) { if (!CanDelete()) { return(Content("Contains Related Recordes in another table, You Cannot Delete This Record")); } User_types t = new User_types(); Boolean res = t.DeleteRecord(id); if (res) { return(Content("Record Deleted Successfully")); } else { return(Content("Error Deleting Record Try Again")); } }
public ActionResult User_typeslist() { if (!g.HasPermission()) { return(Redirect("/Login")); } int pageno = Convert.ToInt16(Request["page"]); GenHelper.pager gen = new GenHelper.pager(); User_types obj = new User_types(); DataSet ds = new DataSet(); DataTable dt = obj.GetOrderedRecords(pageno, PerPageRec, "usertypeid desc"); Int32 cnt = obj.GetOrderedRecordsCount("usertypeid desc"); gen.PagedList(pageno, cnt, PerPageRec, "User_types", "User_typeslist"); ViewBag.pageLinks = gen.PageNos; ViewData["TableHeading"] = "List Of User_types"; ViewData["addlink"] = "User_typesAdd"; dt.TableName = "User_types"; ds.Tables.Add(dt); return(View("listUser_types", ds)); }
/** public void GenerateMenu(DataTable mydt, ref String MyMenu) * { * for (int i = 0; i < mydt.Rows.Count; i++) { * MyMenu += "<li><a href='" + mydt.Rows[i]["menuurl"]+ "'>" + mydt.Rows[i]["menuname"] + "</a></li>"; * } * } **/ public JsonResult IsAvailable(String usertypename) { User_types d = new User_types(); return(Json(d.IsAvailable(usertypename), JsonRequestBehavior.AllowGet)); }