public ActionResult savevoucher(FormCollection fc) { if (Session["userid"] != null) { Int32 billtypeid = Convert.ToInt32(fc["billtypeid"]); Billtype_master b = new Billtype_master(); String payaccno = b.Netpayable(billtypeid); Int32 userid = Convert.ToInt32(Session["userid"]); Users user = new Users(); DataTable userdt = user.GetUserRecord(userid); DataTable Cardt = (DataTable)Session["datatable"]; Cadtvoucher cadt = new Cadtvoucher(); DateTime fst = (DateTime)Session["finstart"]; DateTime fend = (DateTime)Session["finend"]; int divid = Convert.ToInt32(Session["divid"]); int sectionid = Convert.ToInt32(Session["sectionid"]); String divname = Session["divname"].ToString(); String trid = ""; DataRow[] rows = Cardt.Select("accountnumber=" + payaccno); double Payamt = Convert.ToDouble(rows[0]["cramount"]); if (cadt.savevoucherdata(fc, userdt, Cardt, ref trid, fst, fend, divid, divname, sectionid, userid, Payamt)) { return(Content("Transaction saved sucessfully with Voucher.No=" + trid)); } else { return(Content("Error in Saving")); } } return(Content("Saved")); }
public ActionResult Save(FormCollection fc) { if (fc["billtypeid"] == null || fc["billtypeid"] == "") { Billtype_master t = new Billtype_master(); Boolean res = t.InsertBilltype_master(fc); if (res) { return(Content("Record Inserted Successfully")); } else { return(Content("Error Adding Record Try Again")); } } else { Billtype_master t = new Billtype_master(); Boolean res = t.UpdateBilltype_master(fc); if (res) { return(Content("Record Edited Successfully")); } else { return(Content("Error Editing Record Try Again")); } } //return PartialView("SaveRec"); }
public ActionResult SaveVoucher(FormCollection fc) { if (Session["userid"] != null) { Int32 abc = Convert.ToInt32(fc["billtypeid"].ToString()); Int32 mid = Convert.ToInt32(Session["Userid"]); Billtype_master b = new Billtype_master(); String payaccno = b.Netpayable(abc); Users user = new Users(); DataTable userdt = user.GetUserRecord(mid); DataTable cartdt = (DataTable)Session["billdetails"]; RadtVoucher_master radt = new RadtVoucher_master(); string trid = ""; DateTime fst = (DateTime)Session["finstart"]; DateTime fend = (DateTime)Session["finend"]; int mydivid = Convert.ToInt32(Session["divid"]); String mydivname = Session["divname"].ToString(); DataRow[] rows = cartdt.Select("accountnumber=" + payaccno); double Payamt = Convert.ToDouble(rows[0]["cramount"]); if (radt.SaveMyVoucher(fc, userdt, cartdt, ref trid, fst, fend, mydivid, mydivname, Convert.ToInt32(Session["sectionid"]), Convert.ToInt32(Session["Userid"]), Payamt, payaccno)) { return(Content("Transaction Saved Successfully With Voucher No : " + trid.ToString())); } else { } } return(Content("Saved")); }
public ActionResult Billtype_masterdelete(int id) { Billtype_master t = new Billtype_master(); Boolean res = t.DeleteRecord(id); if (res) { return(Content("Record Deleted Successfully")); } else { return(Content("Error Deleting Record Try Again")); } }
public ActionResult Billtype_masterlist() { int pageno = Convert.ToInt16(Request["page"]); GenHelper.pager gen = new GenHelper.pager(); Billtype_master obj = new Billtype_master(); DataSet ds = new DataSet(); DataTable dt = obj.GetOrderedRecords(pageno, PerPageRec, "billtypeid desc"); Int32 cnt = obj.GetOrderedRecordsCount("billtypeid desc"); gen.PagedList(pageno, cnt, PerPageRec, "Billtype_master", "Billtype_masterlist"); ViewBag.pageLinks = gen.PageNos; ViewData["TableHeading"] = "List Of Billtype_master"; ViewData["addlink"] = "Billtype_masterAdd"; dt.TableName = "Billtype_master"; ds.Tables.Add(dt); return(View("listBilltype_master", ds)); }
public JsonResult IsAvailable(String billtypename) { Billtype_master d = new Billtype_master(); return(Json(d.IsAvailable(billtypename), JsonRequestBehavior.AllowGet)); }