Ejemplo n.º 1
0
        public ActionResult Delete(int Id)
        {
            using (var db = new alkemyChallengeEntities())
            {
                var user = db.userAmounts.Find(Id);

                user.isIDstate = 3;

                db.Entry(user).State = System.Data.Entity.EntityState.Modified;
                db.SaveChanges();
            }

            return(Content("1"));
        }
Ejemplo n.º 2
0
        public ActionResult Edit(EditAMBViewModels model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }
            using (var db = new alkemyChallengeEntities())
            {
                var user = db.userAmounts.Find(model.concept);
                user.amount = model.amount;
                user.date   = model.date;
                user.type   = model.type;

                db.Entry(user).State = System.Data.Entity.EntityState.Modified;
                db.SaveChanges();
            }

            return(Redirect(Url.Content("~/AMB/")));
        }