Exemple #1
0
 public ActionResult Edit(tb_Languages entity)
 {
     if (ModelState.IsValid)
     {
         Dao.Update(entity);
     }
     return(View(entity));
 }
Exemple #2
0
 public ActionResult Add(tb_Languages entity)
 {
     if (ModelState.IsValid)
     {
         string Id = Dao.Insert(entity);
         return(RedirectToAction("Edit", "Languages", new { LanguageId = Id }));
     }
     return(View(entity));
 }
 public bool Update(tb_Languages entity)
 {
     try
     {
         db.Entry(entity).State = EntityState.Modified;
         db.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
 public string Insert(tb_Languages entity)
 {
     db.tb_Languages.Add(entity);
     db.SaveChanges();
     return(entity.LanguageId);
 }