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 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")); }