Esempio n. 1
0
        public ActionResult AddBill(BillModel model)
        {
            try
            {
                BudgetGuru.DataLayer.Bill_Item bill = new Bill_Item();
                bill.Title = model.billTitle ?? string.Empty;
                bill.Description = model.billDescription ?? string.Empty;
                bill.DueDate = Convert.ToDateTime(model.datepicker);
                bill.Amout = Convert.ToDecimal(model.billAmt);
                bill.addNewBill();

                //if (bill.addNewBill())
                //{
                //    //show success msg or confirmation
                //}
                // TODO: Add insert logic here
                // TODO: Save billdto using data layer
                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
Esempio n. 2
0
 partial void DeleteBill_Item(Bill_Item instance);
Esempio n. 3
0
 partial void UpdateBill_Item(Bill_Item instance);
Esempio n. 4
0
 partial void InsertBill_Item(Bill_Item instance);
Esempio n. 5
0
 public ActionResult Delete(int id, BillModel model)
 {
     try
     {
         Bill_Item bill = new Bill_Item();
         //bill.deleteBill(id, d);
         return RedirectToAction("Index");
     }
     catch
     {
         return View("Index");
     }
 }
Esempio n. 6
0
 //
 // GET: /Bill/
 public ActionResult Index()
 {
     BudgetGuru.DataLayer.Bill_Item b = new Bill_Item();
     b.doStuff();
     //BillModel b = new BillModel();
     //b.establishConnection();
     return View();
 }
Esempio n. 7
0
 public ActionResult Edit(BillModel model)
 {
     try
     {
         DataClasses1DataContext db = new DataClasses1DataContext();
         BudgetGuru.DataLayer.Bill_Item bill = new Bill_Item();
         Bill_Item item = db.Bill_Items.Single(p => p.Id == model.billId); //Load by primary key. Ideal way to update using Linq-SQL
         //bill.Id = model.billId;
         item.Title = model.billTitle ?? string.Empty;
         item.Description = model.billDescription ?? string.Empty;
         item.DueDate = Convert.ToDateTime(model.datepicker);
         item.Amout = Convert.ToDecimal(model.billAmt);
         db.SubmitChanges();
         //bill.updateBill(model.billId);
         return RedirectToAction("Index");
     }
     catch (Exception e)
     {
         return View();
     }
 }
Esempio n. 8
0
        public ActionResult Edit(int id, BillModel model)
        {
            //BudgetGuru.DataLayer.Bill_Item bill = new Bill_Item();
            var bill = new Bill_Item().getBillById(id);
            model.billId = bill.Id;
            model.billAmt = Convert.ToDecimal(bill.Amout);
            model.billDescription = bill.Description;
            model.billTitle = bill.Title;
            model.datepicker = Convert.ToString(bill.DueDate);

            //BUILD THIS
            return View(model);
        }