public int DeleteBasicInfo(int ovaid) { using (Entities db = new Entities()) { fi_uvas uvas_model = db.fi_uvas.FirstOrDefault(a => a.ovaid == ovaid); if (uvas_model != null) { uvas_model.isdelete = 1; return(db.SaveChanges()); } else { return(0); } } }
public int AddBasicInfo(basicinfoModel model) { using (Entities db = new Entities()) { fi_uvas uvas_model = new fi_uvas(); uvas_model.createtime = DateTime.Now; uvas_model.createuserid = model.createuserid; uvas_model.device = model.device; uvas_model.isdelete = 0; uvas_model.ovaname = model.ovaname; uvas_model.ovanum = model.ovanum; uvas_model.unit = model.unit; db.fi_uvas.Add(uvas_model); return(db.SaveChanges()); } }
public int EditBasicInfo(basicinfoModel model) { using (Entities db = new Entities()) { fi_uvas uvas = db.fi_uvas.FirstOrDefault(t => t.ovaid == model.ovaid); if (uvas != null) { uvas.device = model.device; uvas.ovaname = model.ovaname; uvas.unit = model.unit; uvas.ovanum = model.ovanum; return(db.SaveChanges()); } else { return(0); } } }