public ActionResult Edit([Bind(Include = "authorityno,authorityname")] AUTHORITYFUNCTION aUTHORITYFUNCTION) { if (ModelState.IsValid) { Service.Update(aUTHORITYFUNCTION); return(RedirectToAction("Index")); } return(View(aUTHORITYFUNCTION)); }
// GET: Admin/Authority/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AUTHORITYFUNCTION aUTHORITYFUNCTION = Service.FindOne(id); if (aUTHORITYFUNCTION == null) { return(HttpNotFound()); } return(View(aUTHORITYFUNCTION)); }
/// <summary> /// /// </summary> /// <param name="emp"></param> /// <returns></returns> public int Update(AUTHORITYFUNCTION obj) { try { using (AllShowEntities db = new AllShowEntities()) { db.Entry(obj).State = EntityState.Modified; return(db.SaveChanges()); } } catch (DbEntityValidationException) { throw; } catch (Exception) { throw; } }
/// <summary> /// /// </summary> /// <param name="emp"></param> /// <returns></returns> public int Create(AUTHORITYFUNCTION obj) { try { using (AllShowEntities db = new AllShowEntities()) { db.AUTHORITYFUNCTION.Add(obj); return(db.SaveChanges()); } } catch (DbEntityValidationException) { throw; } catch (Exception) { throw; } }
/// <summary> /// /// </summary> /// <param name="emp"></param> /// <returns></returns> public int Delete(int id) { try { using (AllShowEntities db = new AllShowEntities()) { AUTHORITYFUNCTION target = db.AUTHORITYFUNCTION.Where(m => m.authorityno == id).FirstOrDefault(); db.AUTHORITYFUNCTION.Remove(target); return(db.SaveChanges()); } } catch (DbEntityValidationException) { throw; } catch (Exception) { throw; } }
/// <summary> /// /// </summary> /// <param name="emp"></param> /// <returns></returns> public int Update(AUTHORITYFUNCTION obj) { return(dao.Update(obj)); }
/// <summary> /// /// </summary> /// <param name="emp"></param> /// <returns></returns> public int Create(AUTHORITYFUNCTION obj) { return(dao.Create(obj)); }