Пример #1
0
        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;
 }
Пример #3
0
 /// <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);
     }
 }
Пример #4
0
        /// <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);
            }
        }
Пример #5
0
        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 }));
        }
Пример #6
0
        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 }));
        }
Пример #7
0
        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;
        }
Пример #8
0
        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);
        }
Пример #9
0
 public ConsignmentBusinessModel CreateConsignment(int itemId, ConsignmentBusinessModel consignment)
 {
     return(this.consignmentFacade.CreateConsignment(itemId, consignment));
 }
Пример #10
0
 public void UpdateConsignment(ConsignmentBusinessModel consignment)
 {
     this.consignmentFacade.UpdateConsignment(consignment);
 }
Пример #11
0
        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 });
        }
Пример #12
0
 public void UpdateConsignment(ConsignmentBusinessModel consignment)
 {
     var mapper = new ConsignmentMapper();
     this.uow.Consignments.Update(mapper.Map(consignment));
     this.uow.Commit();
 }
Пример #13
0
 public ConsignmentBusinessModel CreateConsignment(int itemId, ConsignmentBusinessModel consignment)
 {
     return this.consignmentFacade.CreateConsignment(itemId,consignment);
 }
Пример #14
0
 public void UpdateConsignment(ConsignmentBusinessModel consignment)
 {
     this.consignmentFacade.UpdateConsignment(consignment);
 }