Ejemplo n.º 1
0
        public IpermitPDFData(ImportPermit ipermit, LetterHeading letterHeading, Letter letter, string comment = null)
        {
            this.ipermitId         = ipermit.ID;
            this.company           = letterHeading.CompanyName;
            this.logoUrl           = letterHeading.LogoUrl;
            this.header            = letter.Title;
            this.address           = ipermit.Agent?.Address?.City;
            this.to                = ipermit.Agent?.Name;
            this.date              = DateTime.Now.ToString();
            this.body              = letter.Body;
            this.submissionDate    = ipermit.CreatedDate.ToString();
            this.applicationNumber = ipermit.ImportPermitNumber;
            this.totalPrice        = String.Format("{0:n2}", ipermit.Amount);
            this.shippingMethod    = ipermit.ShippingMethod.Name;
            this.delivery          = ipermit.Delivery;
            this.freight           = String.Format("{0:n2}", ipermit.FreightCost);
            this.insurance         = ipermit.Insurance != null?String.Format("{0:n2}", ipermit.Insurance) : "0";

            this.discount = ipermit.Discount != null?String.Format("{0:n2}", ipermit.Discount) : "0";

            this.comment               = ipermit.Remark;
            this.portOfEntry           = ipermit.PortOfEntry.Name;
            this.paymentMode           = ipermit.PaymentMode.Name;
            this.performaInvoiceNumber = ipermit.PerformaInvoiceNumber;
            this.fileName              = letter.ModuleDocument.DocumentType.Name + ".pdf";
            this.tempFolderName        = ipermit.RowGuid.ToString();
            this.rejectedDate          = ipermit.ImportPermitStatus.CreatedDate.ToString();
            this.approvedDate          = ipermit.ImportPermitStatus.CreatedDate.ToString();
            this.expiryDate            = ipermit.ImportPermitStatus.CreatedDate.ToString();
            this.currency              = ipermit.Currency?.Symbol;
            this.currencyName          = ipermit.Currency?.Name;
            this.items = ipermit.ImportPermitDetails.ToList().Select(d => new IpermitPDFDataDetail(d)).ToList();
        }
Ejemplo n.º 2
0
        public RegistrationPDFData(MABusinessModel ma, LetterHeading letterHeading, Letter letter, int noOfFIR = 1)
        {
            this.maId                = ma.MA.ID;
            this.company             = letterHeading.CompanyName;
            this.logoUrl             = letterHeading.LogoUrl;
            this.header              = letter.Title;
            this.body                = letter.Body;
            this.to                  = ma.MA.Agent?.Name;
            this.address             = ma.MA.Agent?.Address?.City;
            this.date                = DateTime.Now.ToString("dd-MM-yyyy");
            this.productName         = ma.Product?.BrandName;
            this.genericName         = ma.Product?.GenericName;
            this.dosageForm          = ma.Product?.DosageFormObj?.Name;
            this.dosageUnit          = ma.Product?.DosageUnitObj?.Name;
            this.productStrength     = ma.Product?.DosageStrengthObj?.Name;
            this.routeAdminstration  = ma.Product?.AdminRoute?.Name;
            this.indication          = ma.Product?.Indication;
            this.prescriptionStatus  = ma.Product?.PharmacopoeiaStandard?.Name; //check
            this.packSize            = ma.Product?.Presentation;                //check
            this.generalAppearance   = ma.Product?.Description;
            this.primaryContainer    = ma.Product?.ContainerType;
            this.agent               = ma.MA.Agent?.Name;
            this.supplier            = ma.MA.Supplier?.Name;
            this.supplierAddress     = ma.MA.Supplier?.Address?.City;
            this.applicationType     = ma.MA.MAType?.Name;
            this.applicationNumber   = ma.MA.MANumber;
            this.certificationNumber = ma.MA.CertificateNumber;                                                                                                                                                       //check
            this.manufacturer        = ma.Product?.ProductManufacturers?.DefaultIfEmpty().FirstOrDefault(m => m?.ManufacturerType?.ManufacturerTypeCode == "FIN_PROD_MANUF")?.ManufacturerAddress.Manufacturer?.Name; //check
            this.shelfLife           = ma.Product?.ShelfLifeObj?.Name;

            this.productCategory = ma.Product.ProductCategory?.Name;
            this.productType     = ma.Product.ProductType?.Name;
            this.deviceClass     = ma.Product.ProductMD?.DeviceClass?.Name;
            this.deviceGroup     = ma.Product.ProductMD?.MDGrouping?.Name;
            this.foodIngredients = ma.Product.FoodIngredients;

            this.fileName       = ma.MA.MAStatus.MAStatusCode == "FIR" ? noOfFIR + "_" + letter.ModuleDocument.DocumentType.Name + ".pdf" : letter.ModuleDocument.DocumentType.Name + ".pdf";
            this.tempFolderName = ma.MA.RowGuid.ToString();
            this.manufacturers  = (bool)ma.Product?.ProductManufacturers?.Any() ? ma.Product?.ProductManufacturers?.Select(x => new Manufacturer(x))?.ToList() : new List <Manufacturer> ();
            this.inns           = (bool)ma.Product?.ProductCompositions?.Any() ? ma.Product?.ProductCompositions?.Where(c => c.INNID != null).Select(x => new Ingredient(x))?.ToList() : new List <Ingredient> ();
            this.expients       = (bool)ma.Product?.ProductCompositions?.Any() ? ma.Product?.ProductCompositions?.Where(c => c.ExcipientID != null).Select(x => new Ingredient(x))?.ToList() : new List <Ingredient> ();
            this.components     = (bool)ma.Product?.DeviceAccessories?.Any() ? ma.Product?.DeviceAccessories?.Where(c => c.AccessoryType.AccessoryTypeCode == "CMP").Select(x => new DeviceAccessories(x))?.ToList() : new List <DeviceAccessories> ();
            this.rawMaterials   = (bool)ma.Product?.DeviceAccessories?.Any() ? ma.Product?.DeviceAccessories?.Where(c => c.AccessoryType.AccessoryTypeCode == "RMT").Select(x => new DeviceAccessories(x))?.ToList() : new List <DeviceAccessories> ();

            this.spareParts          = (bool)ma.Product?.DeviceAccessories?.Any() ? ma.Product?.DeviceAccessories?.Where(c => c.AccessoryType.AccessoryTypeCode == "SPR").Select(x => new DeviceAccessories(x))?.ToList() : new List <DeviceAccessories> ();;
            this.standardAccessories = (bool)ma.Product?.DeviceAccessories?.Any() ? ma.Product?.DeviceAccessories?.Where(c => c.AccessoryType.AccessoryTypeCode == "STND").Select(x => new DeviceAccessories(x))?.ToList() : new List <DeviceAccessories> ();;
            this.mdModelSizes        = (bool)ma.Product?.MDModelSizes?.Any() ? ma.Product?.MDModelSizes.Select(x => new MDModelSize(x))?.ToList() : new List <MDModelSize> ();;
            this.foodCompositions    = (bool)ma.Product?.FoodCompositions?.Any() ? ma.Product?.FoodCompositions?.Where(c => c.CompositionType == "COMPOSITION").Select(x => new FoodComposition(x))?.ToList() : new List <FoodComposition> ();
            this.foodNutritions      = (bool)ma.Product?.FoodCompositions?.Any() ? ma.Product?.FoodCompositions?.Where(c => c.CompositionType == "NUTRITIONAL_FACT").Select(x => new FoodComposition(x))?.ToList() : new List <FoodComposition> ();
        }