public void CanCreateNewGiftcertificate() { var giftcertificate=new GiftCertificate { GiftCertificateID = 1, GiftDate = new DateTime(12/12/2013), DonorID = 2, SINumber = "12121", ReferenceNo = "45461212", Vessel = "MAERSK UTAH", ETA = new DateTime(11/11/2012), IsPrinted = false, ProgramID = 1, DModeOfTransport = 14, PortName = "Djibouti" }; // var result = _giftCertificateController.Create(giftcertificate); }
private void InsertGiftCertificate(GiftCertificateViewModel giftcertificate, GiftCertificate giftCertificateModel) { List<Models.GiftCertificateDetailsViewModel> giftCertificateDetails = GetSelectedGiftCertificateDetails(giftcertificate.JSONInsertedGiftCertificateDetails); var giftDetails = GenerateGiftCertificate(giftCertificateDetails); foreach (BLL.GiftCertificateDetail giftDetail in giftDetails) { giftCertificateModel.GiftCertificateDetails.Add(giftDetail); } _giftCertificateService.AddGiftCertificate(giftCertificateModel); }
/// <summary> /// Generates the gift certificate. /// </summary> /// <returns></returns> public BLL.GiftCertificate GenerateGiftCertificate() { GiftCertificate giftCertificate = new GiftCertificate() { GiftCertificateID = this.GiftCertificateID, GiftDate = this.GiftDate, SINumber = this.SINumber, DonorID = this.DonorID, ReferenceNo = this.ReferenceNo, Vessel = this.Vessel, ETA = this.ETA, IsPrinted = this.IsPrinted, DModeOfTransport = this.DModeOfTransport, ProgramID = this.ProgramID, PortName = this.PortName }; return giftCertificate; }