public shipment_notes saveShipmentNote(shipment_notes model) { model.creation_date = DateTime.Today; model.status = "U"; return(shipNote.saveShipmentNote(model)); }
public HttpResponseMessage Put(shipment_notes model) { try { BOShipmentNotes shipNote = new BOShipmentNotes(); shipment_notes note; note = shipNote.updateNote(model); return(Request.CreateResponse(HttpStatusCode.OK, note)); } catch (Exception e) { ErrorMessage mensaje = new ErrorMessage("2.1", "Exception to update shipment note - " + e.GetBaseException().Message, e.ToString()); return(Request.CreateResponse(HttpStatusCode.InternalServerError, mensaje)); } }
//save a new shipment_note public shipment_notes saveShipmentNote(shipment_notes model) { var shipNote = new shipment_notes(); try { using (var ctx = new transshipEntities()) { shipNote = ctx.shipment_notes.Add(model); ctx.SaveChanges(); return(shipNote); } } catch (Exception e) { LogBook.TextLog.Info(string.Format("{0} {1}", e.Message, e.InnerException != null ? e.InnerException.Message : string.Empty)); throw e; } }
public shipment_notes updateNote(shipment_notes model) { shipment_notes note = new shipment_notes(); note = model; try { using (var ctx = new transshipEntities()) { ctx.Entry(note).State = EntityState.Modified; ctx.SaveChanges(); return(note); } } catch (Exception e) { LogBook.TextLog.Info(string.Format("{0} {1}", e.Message, e.InnerException != null ? e.InnerException.Message : string.Empty)); throw e; } }
public shipment_notes updateNote(shipment_notes model) { return(shipNote.updateNote(model)); }