예제 #1
0
        public ActionResult DeleteConfirmed(int?accountingRecordId, int?customerId)
        {
            Accounting_Record accounting_Record = db.Accounting_Record.Find(accountingRecordId, customerId);

            db.Accounting_Record.Remove(accounting_Record);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "accounting_record_id,customer_id,record_date,amount,record_type_name,record_category_id,description")] Accounting_Record accounting_Record)
 {
     if (ModelState.IsValid)
     {
         db.Entry(accounting_Record).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.customer_id        = new SelectList(db.Customers, "customer_id", "customer_name", accounting_Record.customer_id);
     ViewBag.record_category_id = new SelectList(db.Record_Category, "record_category_id", "record_category_name", accounting_Record.record_category_id);
     ViewBag.record_type_name   = new SelectList(db.Record_Type, "record_type_name", "record_type_name", accounting_Record.record_type_name);
     return(View(accounting_Record));
 }
예제 #3
0
        public ActionResult Details(int?accountingRecordId, int?customerId)
        {
            if (accountingRecordId == null || customerId == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Accounting_Record accounting_Record = db.Accounting_Record.Find(accountingRecordId, customerId);

            if (accounting_Record == null)
            {
                return(HttpNotFound());
            }
            return(View(accounting_Record));
        }
예제 #4
0
        public ActionResult Edit(int?accountingRecordId, int?customerId)
        {
            if (accountingRecordId == null || customerId == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Accounting_Record accounting_Record = db.Accounting_Record.Find(accountingRecordId, customerId);

            if (accounting_Record == null)
            {
                return(HttpNotFound());
            }
            ViewBag.customer_id        = new SelectList(db.Customers, "customer_id", "customer_name", accounting_Record.customer_id);
            ViewBag.record_category_id = new SelectList(db.Record_Category, "record_category_id", "record_category_name", accounting_Record.record_category_id);
            ViewBag.record_type_name   = new SelectList(db.Record_Type, "record_type_name", "record_type_name", accounting_Record.record_type_name);
            return(View(accounting_Record));
        }