public ActionResult Save(FormCollection fc) { if (fc["id"] == null || fc["id"] == "") { int divid = Convert.ToInt16(Session["divid"]); int sectionid = Convert.ToInt16(Session["sectionid"]); int userid = Convert.ToInt16(Session["userid"]); VoucherMaster t = new VoucherMaster(); Boolean res = t.Insertvoucherdata(fc, divid, sectionid, userid); if (res) { return(Content("Record Inserted Successfully")); } else { return(Content("Error Adding Record Try Again")); } } else { Party_master t = new Party_master(); Boolean res = t.UpdateParty_master(fc); if (res) { return(Content("Record Edited Successfully")); } else { return(Content("Error Editing Record Try Again")); } } //return PartialView("SaveRec"); }
public ActionResult Save(FormCollection fc) { if (fc["partyid"] == null || fc["partyid"] == "") { Party_master t = new Party_master(); Boolean res = t.InsertParty_master(fc); if (res) { return(Content("Record Inserted Successfully")); } else { return(Content("Error Adding Record Try Again")); } } else { Party_master t = new Party_master(); Boolean res = t.UpdateParty_master(fc); if (res) { return(Content("Record Edited Successfully")); } else { return(Content("Error Editing Record Try Again")); } } //return PartialView("SaveRec"); }
public JsonResult IsAvailable(String partyname) { int divid = Convert.ToInt16(Session["divid"]); Party_master d = new Party_master(); return(Json(d.IsAvailable(partyname, divid), JsonRequestBehavior.AllowGet)); }
public ActionResult Party_masterdelete(int id) { Party_master t = new Party_master(); Boolean res = t.DeleteRecord(id); if (res) { return(Content("Record Deleted Successfully")); } else { return(Content("Error Deleting Record Try Again")); } }
public ActionResult Party_masterlist() { int pageno = Convert.ToInt16(Request["page"]); GenHelper.pager gen = new GenHelper.pager(); Party_master obj = new Party_master(); DataSet ds = new DataSet(); DataTable dt = obj.GetOrderedRecords(pageno, PerPageRec, "partyid desc"); Int32 cnt = obj.GetOrderedRecordsCount("partyid desc"); gen.PagedList(pageno, cnt, PerPageRec, "party_master", "Party_masterlist"); ViewBag.pageLinks = gen.PageNos; ViewData["TableHeading"] = "List Of Party_Master"; ViewData["addlink"] = "Party_masterAdd"; dt.TableName = "Party_master"; ds.Tables.Add(dt); return(View("listParty_master", ds)); }