public IHttpActionResult Put(business business) { bool isUpdated = businessService.UpdateBusiness(business.busid, business); if (isUpdated == true) return Ok(); return BadRequest(); }
public IHttpActionResult Post(business business) { bool isSave = businessService.SaveBusiness(business); if (isSave == true) return Ok(); return BadRequest(); }
public bool UpdateBusiness(long exeid, business business) { try { db.Entry(business).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return true; } catch (Exception ex) { return false; } }
public bool SaveBusiness(business business) { try { db.business.Add(business); db.SaveChanges(); return true; } catch (Exception ex) { return false; } }