public HttpResponseMessage GetManufacturingUnit() { var ManUnit = new ManufacturingUnit_CRUD().ManufacturingUnit_GetAll(); if (ManUnit != null) { return(Request.CreateResponse(HttpStatusCode.OK, ManUnit)); } return(Request.CreateResponse(HttpStatusCode.NoContent, ManUnit)); }
public HttpResponseMessage PutManufacturingUnit(ManUnit ManufactUnit) { try { if (ModelState.IsValid) { var result = new ManufacturingUnit_CRUD().ManufacturingUnit_Update(ManufactUnit); if (result != null || result != "") { return(Request.CreateResponse(HttpStatusCode.OK, result)); } } return(Request.CreateResponse(HttpStatusCode.NoContent)); } catch { return(Request.CreateResponse(HttpStatusCode.BadRequest)); } }
public HttpResponseMessage DeleteManufacturingUnit(int Pid) { var result = new ManufacturingUnit_CRUD().ManufacturingUnit_GetById(Pid); if (result.PID == 0) { return(Request.CreateResponse(HttpStatusCode.NoContent, result)); } try { result.PID = Convert.ToInt16(new ManufacturingUnit_CRUD().ManufacturingUnit_Delete(Pid)); if (result.PID != 0) { return(Request.CreateResponse(HttpStatusCode.OK, result)); } return(Request.CreateResponse(HttpStatusCode.NoContent, result)); } catch (Exception ex) { return(Request.CreateResponse(HttpStatusCode.BadRequest, result)); } }
public ManUnit GetManufacturingUnit(int?Pid) { var ManUnit = new ManufacturingUnit_CRUD().ManufacturingUnit_GetById(Pid); return(ManUnit); }