public ActionResult Save(FormCollection fc) { if (fc["depotid"] == null || fc["depotid"] == "") { Depot_master t = new Depot_master(); Boolean res = t.InsertDepot_master(fc); if (res) { return(Content("Record Inserted Successfully")); } else { return(Content("Error Adding Record Try Again")); } } else { Depot_master t = new Depot_master(); Boolean res = t.UpdateDepot_master(fc); if (res) { return(Content("Record Edited Successfully")); } else { return(Content("Error Editing Record Try Again")); } } //return PartialView("SaveRec"); }
public ActionResult Depot_masterdelete(int id) { Depot_master t = new Depot_master(); Boolean res = t.DeleteRecord(id); if (res) { return(Content("Record Deleted Successfully")); } else { return(Content("Error Deleting Record Try Again")); } }
public ActionResult Depot_masterlist() { int pageno = Convert.ToInt16(Request["page"]); GenHelper.pager gen = new GenHelper.pager(); Depot_master obj = new Depot_master(); DataSet ds = new DataSet(); DataTable dt = obj.GetOrderedRecords(pageno, PerPageRec, "depotid desc"); Int32 cnt = obj.GetOrderedRecordsCount("depotid desc"); gen.PagedList(pageno, cnt, PerPageRec, "Depot_master", "Depot_masterlist"); ViewBag.pageLinks = gen.PageNos; ViewData["TableHeading"] = "List Of Depot_master"; ViewData["addlink"] = "Depot_masterAdd"; dt.TableName = "depot_master"; ds.Tables.Add(dt); return(View("listDepot_master", ds)); }
public JsonResult IsAvailable(String depotname) { Depot_master d = new Depot_master(); return(Json(d.IsAvailable(depotname), JsonRequestBehavior.AllowGet)); }