Exemplo n.º 1
0
        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));
            }
        }
Exemplo n.º 3
0
        //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;
            }
        }
Exemplo n.º 4
0
        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;
            }
        }
Exemplo n.º 5
0
 public shipment_notes updateNote(shipment_notes model)
 {
     return(shipNote.updateNote(model));
 }