public ActionResult LanguageEdit(int id) { Tbl_Language q = new Tbl_Language(); q = db.Tbl_Language.Where(a => a.Language_ID == id).SingleOrDefault(); LanguageAddModel model = new LanguageAddModel(); model.ID = q.Language_ID; model.Name = q.Language_Name; model.Titel = q.Language_Titel; return(View(model)); }
public ActionResult LanguageAdd(LanguageAddModel model) { Tbl_Language q = new Tbl_Language(); q.Language_Name = model.Name; q.Language_Titel = model.Titel; db.Tbl_Language.Add(q); if (Convert.ToBoolean(db.SaveChanges() > 0)) { return(RedirectToAction("LanguageList", "Setting")); } else { return(View()); } }
public ActionResult LanguageEdit(LanguageAddModel model) { Tbl_Language q = new Tbl_Language(); q = db.Tbl_Language.Where(a => a.Language_ID == model.ID).SingleOrDefault(); q.Language_Name = model.Name; q.Language_Titel = model.Titel; db.Entry(q).State = System.Data.Entity.EntityState.Modified; if (Convert.ToBoolean(db.SaveChanges() > 0)) { return(RedirectToAction("LanguageList", "Setting")); } else { return(View()); } }