public bool DeleteCounter(int id)
 {
     using (RMSDBEntities db = new RMSDBEntities())
     {
         if (id > 0)
         {
             section RowinDb = db.sections.Where(d => d.id == id).SingleOrDefault();
             if (RowinDb != null)
             {
                 db.sections.Remove(RowinDb);
                 db.SaveChanges();
                 return(true);
             }
             return(false);
         }
         return(false);
     }
 }
 public bool SaveCounter(section model)
 {
     using (RMSDBEntities db = new RMSDBEntities())
     {
         if (model.id == 0)
         {
             db.sections.Add(model);
             db.SaveChanges();
             return(true);
         }
         else if (model.id > 0)
         {
             section RowinDb = db.sections.Where(d => d.id == model.id).SingleOrDefault();
             RowinDb.sectionname = model.sectionname;
             db.SaveChanges();
             return(true);
         }
         return(false);
     }
 }