Exemple #1
0
 public static bool updateState(StateModel model)
 {
     using (LIC_CMSEntities db = new LIC_CMSEntities())
     {
         var query = db.STATE_MASTER.Where(x => x.STATE_ID == model.STATE_ID).FirstOrDefault();
         query.STATE_NAME = model.STATE_NAME;
         query.COUNTRY_ID = model.COUNTRY_ID;
         int valid = db.SaveChanges();
         if (valid == 1)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
Exemple #2
0
 public static bool insertState(StateModel model)
 {
     using (LIC_CMSEntities db = new LIC_CMSEntities())
     {
         db.STATE_MASTER.Add(new STATE_MASTER
         {
             STATE_NAME = model.STATE_NAME,
             COUNTRY_ID = model.COUNTRY_ID
         });
         int valid = db.SaveChanges();
         if (valid == 1)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }