Exemplo n.º 1
0
 public static string deletesplash(int cpId)
 {
     try
     {
         using (var db = new smartcheckEntities())
         {
             var cp = new splash()
             {
                 id = cpId
             };
             db.Entry(cp).State = EntityState.Deleted;
             db.SaveChanges();
         }
         return(string.Empty);
     }
     catch (Exception ex)
     {
         return("Thất bại: " + ex.Message);
     }
 }
Exemplo n.º 2
0
 //Config
 //Splash
 public static string addUpdateSplash(splash cp)
 {
     try
     {
         using (var db = new smartcheckEntities())
         {
             if (cp.id == 0)
             {
                 db.splashes.Add(cp);
             }
             else
             {
                 db.Entry(cp).State = EntityState.Modified;
             }
             db.SaveChanges();
         }
         return(string.Empty);
     }
     catch (Exception ex)
     {
         return("Thất bại: " + ex.Message);
     }
 }