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