예제 #1
0
        public ActionResult Create(TypePayment typepayment)
        {
            if (ModelState.IsValid)
            {
                db.TypePayments.AddObject(typepayment);
                db.SaveChanges();
                return RedirectToAction("Index");
            }
            ViewBag.Status = new SelectList((new TypePaymentViewModel()).GetStatus(), "Value", "Text", typepayment.Status);

            return View(typepayment);
        }
예제 #2
0
 public ActionResult Edit(TypePayment typepayment)
 {
     if (ModelState.IsValid)
     {
         db.TypePayments.Attach(typepayment);
         db.ObjectStateManager.ChangeObjectState(typepayment, EntityState.Modified);
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.Status = new SelectList((new TypePaymentViewModel()).GetStatus(), "Value", "Text", typepayment.Status);
     return View(typepayment);
 }
예제 #3
0
 public TypePaymentViewModel(TypePayment typePayment)
 {
     this.TypePayment = typePayment;
     this.Status = typePayment.Status;
 }