Пример #1
0
 public Boolean Update(tbl_MENU record)
 {
     try
     {
         var existrecord = GetByID(record.MenuID);
         db.Entry(existrecord).CurrentValues.SetValues(record);
         db.SaveChanges();
         return(true);
     }catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #2
0
 public Boolean Save(tbl_MENU record)
 {
     try
     {
         db.MenuList.Add(record);
         db.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #3
0
 public Boolean Update(tbl_MENU record)
 {
     try
     {
         if (record == null)
         {
             throw new Exception("Invalid Parameter");
         }
         if (!menudal.IsExistID(record.MenuID))
         {
             throw new Exception("Record does not exist!");
         }
         return(menudal.Update(record));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #4
0
 public Boolean Save(tbl_MENU record)
 {
     try
     {
         if (record == null)
         {
             throw new Exception("Invalid Parameter");
         }
         if (menudal.IsExistID(record.MenuID))
         {
             throw new Exception("Record already exist!");
         }
         return(menudal.Save(record));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }