Ejemplo n.º 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);
        }
Ejemplo n.º 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);
 }
Ejemplo n.º 3
0
 public TypePaymentViewModel(TypePayment typePayment)
 {
     this.TypePayment = typePayment;
     this.Status = typePayment.Status;
 }