示例#1
0
 public ActionResult Edit([Bind(Include = "authorityno,authorityname")] AUTHORITYFUNCTION aUTHORITYFUNCTION)
 {
     if (ModelState.IsValid)
     {
         Service.Update(aUTHORITYFUNCTION);
         return(RedirectToAction("Index"));
     }
     return(View(aUTHORITYFUNCTION));
 }
示例#2
0
        // 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));
        }
示例#3
0
 /// <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;
     }
 }
示例#4
0
 /// <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;
     }
 }
示例#5
0
 /// <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;
     }
 }
示例#6
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="emp"></param>
 /// <returns></returns>
 public int Update(AUTHORITYFUNCTION obj)
 {
     return(dao.Update(obj));
 }
示例#7
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="emp"></param>
 /// <returns></returns>
 public int Create(AUTHORITYFUNCTION obj)
 {
     return(dao.Create(obj));
 }