public bool Insert(LaboratoryRequestItem newLaboratoryRequestItem) { using (MySqlHealthContext ctx = new MySqlHealthContext()) { ctx.LaboratoryRequestItems.Add(newLaboratoryRequestItem); return(ctx.SaveChanges() > -1); } }
public bool Delete(int id) { using (MySqlHealthContext ctx = new MySqlHealthContext()) { LaboratoryRequestItem laboratoryRequestItem = ctx.LaboratoryRequestItems.FirstOrDefault(d => d.Id == id); if (laboratoryRequestItem == null) { return(false); } ctx.LaboratoryRequestItems.Remove(laboratoryRequestItem); return(ctx.SaveChanges() > -1); } }
public bool Update(LaboratoryRequestItem newInfoLaboratoryRequestItem) { using (MySqlHealthContext ctx = new MySqlHealthContext()) { LaboratoryRequestItem laboratoryRequestItem = ctx.LaboratoryRequestItems.FirstOrDefault(d => d.Id == newInfoLaboratoryRequestItem.Id); if (laboratoryRequestItem == null) { return(false); } laboratoryRequestItem.LaboratoryRequestId = newInfoLaboratoryRequestItem.LaboratoryRequestId; laboratoryRequestItem.LaboratoryRequestTypeId = newInfoLaboratoryRequestItem.LaboratoryRequestTypeId; laboratoryRequestItem.Result = newInfoLaboratoryRequestItem.Result; return(ctx.SaveChanges() > -1); } }
public bool Update(LaboratoryRequestItem newInfoLaboratoryRequestItem) { return(_laboratoryRequestItemDal.Update(newInfoLaboratoryRequestItem)); }
public bool Insert(LaboratoryRequestItem newLaboratoryRequestItem) { return(_laboratoryRequestItemDal.Insert(newLaboratoryRequestItem)); }