public void Update(DebtCoverDTO element) { var elementToUpdate = (from c in db.DebtCovers where c.Id == element.Id select c).FirstOrDefault(); elementToUpdate.CoverDate = element.CoverDate; elementToUpdate.PaymentByCard = element.PaymentByCard; elementToUpdate.PaymentByCash = element.PaymentByCash; elementToUpdate.PaymentByTransfer = element.PaymentByTransfer; elementToUpdate.UpdatedDate = DateTime.Now; db.SubmitChanges(); }
public HttpResponseMessage Update(DebtCoverDTO dto) { try { new DebtCoverBL().Update(dto); return(Request.CreateResponse(HttpStatusCode.OK, true)); } catch (Exception ex) { LogManager.Instance.Error(ex); return(Request.CreateResponse(HttpStatusCode.InternalServerError, false)); } }
public HttpResponseMessage Add(DebtCoverDTO element) { try { new DebtCoverBL().Add(element); return(Request.CreateResponse(HttpStatusCode.OK, true)); } catch (Exception ex) { LogManager.Instance.Error(ex); return(Request.CreateResponse(HttpStatusCode.InternalServerError)); } }
public void Add(DebtCoverDTO element) { var cover = new DebtCover() { OrderId = element.OrderId, CoverDate = element.CoverDate, PaymentByCard = element.PaymentByCard, PaymentByTransfer = element.PaymentByTransfer, PaymentByCash = element.PaymentByCash }; db.DebtCovers.InsertOnSubmit(cover); db.SubmitChanges(); }
public void Update(DebtCoverDTO dto) { new DebtCoverDalFacade().Update(dto); }
public void Add(DebtCoverDTO dto) { new DebtCoverDalFacade().Add(dto); }