Exemple #1
0
        public bool Delete(string ma)
        {
            tbl_BP tbl = db.tbl_BP.Find(ma);

            db.tbl_BP.Remove(tbl);
            db.SaveChanges();
            return(true);
        }
Exemple #2
0
 public bool Update(DepartmentModel model)
 {
     try
     {
         tbl_BP tbl = db.tbl_BP.Find(model.Ma_BP);
         tbl.Ten_BP = model.Ten_BP;
         db.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Exemple #3
0
 public bool Save(DepartmentModel model)
 {
     try
     {
         tbl_BP tbl = new tbl_BP();
         tbl.Ma_BP  = model.Ma_BP;
         tbl.Ten_BP = model.Ten_BP;
         db.tbl_BP.Add(tbl);
         db.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }