Beispiel #1
0
 public ActionResult UpdateVoucher(FormCollection fc)
 {
     if (Session["userid"] != null)
     {
         Int32              abc    = Convert.ToInt32(fc["billtypeid"].ToString());
         Int32              mid    = Convert.ToInt32(Session["Userid"]);
         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();
         if (radt.UpdateMyVoucher(fc, userdt, cartdt, ref trid, fst, fend, mydivid, mydivname, Convert.ToInt32(Session["sectionid"]), Convert.ToInt32(Session["Userid"])))
         {
             return(Content("Transaction Saved Successfully With Voucher No : " + trid.ToString()));
         }
         else
         {
         }
     }
     return(Content("Saved"));
 }
Beispiel #2
0
 public ActionResult Save(FormCollection fc)
 {
     if (fc["id"] == null || fc["id"] == "")
     {
         RadtVoucher_master t   = new RadtVoucher_master();
         Boolean            res = t.InsertVoucher_master(fc);
         if (res)
         {
             return(Content("Record Inserted Successfully"));
         }
         else
         {
             return(Content("Error Adding Record Try Again"));
         }
     }
     else
     {
         RadtVoucher_master t   = new RadtVoucher_master();
         Boolean            res = t.UpdateVoucher_master(fc);
         if (res)
         {
             return(Content("Record Edited Successfully"));
         }
         else
         {
             return(Content("Error Editing Record Try Again"));
         }
     }
     //return PartialView("SaveRec");
 }
Beispiel #3
0
 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"));
 }
Beispiel #4
0
        public ActionResult Voucher_masterdelete(int id)
        {
            RadtVoucher_master t   = new RadtVoucher_master();
            String             st  = "";
            Boolean            res = t.DeleteRecord(id, ref st);

            if (res)
            {
                return(Content("Record Deleted Successfully"));
            }
            else
            {
                return(Content(st));
            }
        }
Beispiel #5
0
        public ActionResult RadtVoucher_masterlist()
        {
            int pageno = Convert.ToInt16(Request["page"]);

            GenHelper.pager    gen = new GenHelper.pager();
            RadtVoucher_master obj = new RadtVoucher_master();
            DataSet            ds  = new DataSet();
            DataTable          dt  = obj.GetOrderedRecords(pageno, PerPageRec, "id desc");
            Int32 cnt = obj.GetOrderedRecordsCount("id desc");

            gen.PagedList(pageno, cnt, PerPageRec, "RadtVoucher_master", "Voucher_masterlist");
            ViewBag.pageLinks        = gen.PageNos;
            ViewData["TableHeading"] = "List Of RadtVoucher_master";
            ViewData["addlink"]      = "Voucher_masterAdd";
            dt.TableName             = "RadtVoucher_master";
            ds.Tables.Add(dt);
            return(View("listVoucher_master", ds));
        }