Ejemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "Id,Date,Winner,Loser,RefereePoints")] Battle battle)
 {
     if (ModelState.IsValid)
     {
         _db.Entry(battle).State = EntityState.Modified;
         _db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(battle));
 }
Ejemplo n.º 2
0
        public string Edit(Battle obj)
        {
            string msg;

            try
            {
                if (ModelState.IsValid)
                {
                    _db.Entry(obj).State = EntityState.Modified;
                    _db.SaveChanges();
                    msg = "Saved Successfully";
                }
                else
                {
                    msg = "Validation data is not successful";
                }
            }
            catch (Exception ex)
            {
                msg = "Error occured:" + ex.Message;
            }
            return(msg);
        }