예제 #1
0
 public TblMaterial GetMaterialData(int id)
 {
     try
     {
         TblMaterial material = db.TblMaterial.Find(id);
         return(material);
     }
     catch
     {
         throw;
     }
 }
예제 #2
0
 public int AddMaterial(TblMaterial material)
 {
     try
     {
         db.TblMaterial.Add(material);
         db.SaveChanges();
         return(1);
     }
     catch
     {
         throw;
     }
 }
예제 #3
0
 public int DeleteMaterial(int id)
 {
     try
     {
         TblMaterial mat = db.TblMaterial.Find(id);
         db.TblMaterial.Remove(mat);
         db.SaveChanges();
         return(1);
     }
     catch
     {
         throw;
     }
 }
예제 #4
0
        public int UpdateMaterial(TblMaterial material)
        {
            try
            {
                db.Entry(material).State = EntityState.Modified;
                db.SaveChanges();

                return(1);
            }
            catch
            {
                throw;
            }
        }