Ejemplo n.º 1
0
        // GET: Admin/ShClass/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SHCLASS sHCLASS = Service.FindOne(id);

            if (sHCLASS == null)
            {
                return(HttpNotFound());
            }
            return(View(sHCLASS));
        }
Ejemplo n.º 2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="emp"></param>
 /// <returns></returns>
 public int Update(SHCLASS obj)
 {
     try
     {
         using (AllShowEntities db = new AllShowEntities())
         {
             db.Entry(obj).State = EntityState.Modified;
             return(db.SaveChanges());
         }
     }
     catch (DbEntityValidationException)
     {
         throw;
     }
     catch (Exception)
     {
         throw;
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="emp"></param>
 /// <returns></returns>
 public int Create(SHCLASS obj)
 {
     try
     {
         using (AllShowEntities db = new AllShowEntities())
         {
             db.SHCLASS.Add(obj);
             return(db.SaveChanges());
         }
     }
     catch (DbEntityValidationException)
     {
         throw;
     }
     catch (Exception)
     {
         throw;
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="emp"></param>
 /// <returns></returns>
 public int Delete(int id)
 {
     try
     {
         using (AllShowEntities db = new AllShowEntities())
         {
             SHCLASS target = db.SHCLASS.Where(m => m.shclassno == id).FirstOrDefault();
             db.SHCLASS.Remove(target);
             return(db.SaveChanges());
         }
     }
     catch (DbEntityValidationException)
     {
         throw;
     }
     catch (Exception)
     {
         throw;
     }
 }
Ejemplo n.º 5
0
 public ActionResult Edit([Bind(Include = "shclassno,shclassname")] SHCLASS sHCLASS)
 {
     if (ModelState.IsValid)
     {
         try
         {
             Service.Update(sHCLASS);
             return(RedirectToAction("Index"));
         }
         catch (DbEntityValidationException ex)
         {
             logger.Error(GetEntityErrorMsg(ex));
         }
         catch (Exception ex)
         {
             logger.Error(ex.Message);
         }
     }
     return(View(sHCLASS));
 }
Ejemplo n.º 6
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="emp"></param>
 /// <returns></returns>
 public int Update(SHCLASS obj)
 {
     return(dao.Update(obj));
 }
Ejemplo n.º 7
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="emp"></param>
 /// <returns></returns>
 public int Create(SHCLASS obj)
 {
     return(dao.Create(obj));
 }