public void UpdateConsignment(ConsignmentBusinessModel consignment) { var mapper = new ConsignmentMapper(); this.uow.Consignments.Update(mapper.Map(consignment)); this.uow.Commit(); }
public ConsignmentsForGrid(ConsignmentBusinessModel consignmrntModel) { this.Id = consignmrntModel.Id; this.ArrivalDate = consignmrntModel.ArrivalDate; this.InventoriesCount = consignmrntModel.Inventories.Count; this.WriteOffDate = consignmrntModel.WriteOffDate; this.Number = consignmrntModel.Number; }
/// <summary> /// Inits the Pdf document and first page. /// </summary> /// <param name="item"> /// The item params of Name and Year for first page. /// </param> /// <param name="consignment"> /// The consignment ArivalDate for first page. /// </param> public void PdfInit(ItemBusinessModel item,ConsignmentBusinessModel consignment) { BaseFont baseTimes = BaseFont.CreateFont(BaseFont.TIMES_ROMAN, BaseFont.CP1250, false); Font defaultFont = new Font(baseTimes, FontSize, Font.NORMAL, BaseColor.BLACK); Paragraph title1 = new Paragraph(item.Name + ".- " + item.Year, defaultFont); this.document.Add(title1); if (consignment.ArrivalDate != null) { Paragraph title2 = new Paragraph(consignment.ArrivalDate.Value.Date.ToShortDateString(), defaultFont); this.document.Add(title2); } }
/// <summary> /// Inits the Pdf document and first page. /// </summary> /// <param name="item"> /// The item params of Name and Year for first page. /// </param> /// <param name="consignment"> /// The consignment ArivalDate for first page. /// </param> public void PdfInit(ItemBusinessModel item, ConsignmentBusinessModel consignment) { BaseFont baseTimes = BaseFont.CreateFont(BaseFont.TIMES_ROMAN, BaseFont.CP1250, false); Font defaultFont = new Font(baseTimes, FontSize, Font.NORMAL, BaseColor.BLACK); Paragraph title1 = new Paragraph(item.Name + ".- " + item.Year, defaultFont); this.document.Add(title1); if (consignment.ArrivalDate != null) { Paragraph title2 = new Paragraph(consignment.ArrivalDate.Value.Date.ToShortDateString(), defaultFont); this.document.Add(title2); } }
public ActionResult AddNewConsignment(int itemId, int count) { ConsignmentBusinessModel consignment = this.consignmentManager.CreateConsignment(itemId, new ConsignmentBusinessModel { ArrivalDate = DateTime.Now }); for (int i = 0; i < count; i++) { this.inventoryManager.CreateInventory(itemId, consignment.Id, i + 1); } return(RedirectToAction("Details", new { id = consignment.Id })); }
public ActionResult Add(int bookId, int count) { var consignmentNew = new ConsignmentBusinessModel { ArrivalDate = DateTime.Now }; var consignmentId = this.consignmentManager.CreateConsignment(bookId, consignmentNew); for (int i = 0; i < count; i++) { this.inventoryManager.CreateInventory(bookId, consignmentId.Number, i + 1); } ViewBag.Consignment = consignmentId.Number; return(RedirectToAction("Index", new { id = bookId })); }
public ConsignmentBusinessModel CreateConsignment(int itemId, ConsignmentBusinessModel consignment) { ConsignmentBusinessModel consNew; var mapper = new ConsignmentMapper(); int id = 0; using (var uowNew = new LibraryUow()) { var item = uowNew.Items.GetById(itemId); var entryConsignment = mapper.Map(consignment); entryConsignment.Item = item; uowNew.Consignments.Add(entryConsignment); uowNew.Commit(); id = entryConsignment.Id; } consNew = mapper.Map(this.uow.Consignments.GetById(id)); consignment.Id = consNew.Id; consignment.Number = consNew.Number; return consNew; }
public ConsignmentBusinessModel CreateConsignment(int itemId, ConsignmentBusinessModel consignment) { ConsignmentBusinessModel consNew; var mapper = new ConsignmentMapper(); int id = 0; using (var uowNew = new LibraryUow()) { var item = uowNew.Items.GetById(itemId); var entryConsignment = mapper.Map(consignment); entryConsignment.Item = item; uowNew.Consignments.Add(entryConsignment); uowNew.Commit(); id = entryConsignment.Id; } consNew = mapper.Map(this.uow.Consignments.GetById(id)); consignment.Id = consNew.Id; consignment.Number = consNew.Number; return(consNew); }
public ConsignmentBusinessModel CreateConsignment(int itemId, ConsignmentBusinessModel consignment) { return(this.consignmentFacade.CreateConsignment(itemId, consignment)); }
public void UpdateConsignment(ConsignmentBusinessModel consignment) { this.consignmentFacade.UpdateConsignment(consignment); }
public ActionResult Add(int bookId, int count) { var consignmentNew = new ConsignmentBusinessModel { ArrivalDate = DateTime.Now }; var consignmentId = this.consignmentManager.CreateConsignment(bookId, consignmentNew); for (int i = 0; i < count; i++) { this.inventoryManager.CreateInventory(bookId, consignmentId.Number, i + 1); } ViewBag.Consignment = consignmentId.Number; return RedirectToAction("Index", new { id = bookId }); }
public ConsignmentBusinessModel CreateConsignment(int itemId, ConsignmentBusinessModel consignment) { return this.consignmentFacade.CreateConsignment(itemId,consignment); }