예제 #1
0
 public void SaveToPdfFile(ReportProviderBindingModel model)
 {
     SaveToPdf.CreateDoc(new PdfProviderInfo
     {
         FileName = model.FileName,
         Title    = "Список пациентов и поступлений",
         DateFrom = model.DateFrom.Value,
         DateTo   = model.DateTo.Value,
         Supplys  = GetGarnitureSupply(model)
     });
 }
예제 #2
0
        public List <ReportSupplyViewModel> GetGarnitureSupply(ReportProviderBindingModel model)
        {
            var supplys = _supplyStorage.GetFilteredList(new SupplyBindingModel
            {
                DateFrom = model.DateFrom,
                DateTo   = model.DateTo
            });
            var materials  = _materialStorage.GetFullList();
            var garnitures = _garnitureStorage.GetFullList();

            var list = new List <ReportSupplyViewModel>();

            foreach (var supply in supplys)
            {
                foreach (var material in materials)
                {
                    if (supply.SupplyMaterials.ContainsKey(material.Id))
                    {
                        foreach (var garniture in garnitures)
                        {
                            if (garniture.GarnitureMaterials.ContainsKey(material.Id))
                            {
                                list.Add(new ReportSupplyViewModel
                                {
                                    Date          = supply.Date,
                                    SupplyName    = supply.Name,
                                    SupplyPrice   = supply.Price.ToString(),
                                    GarnitureName = garniture.Name
                                });
                            }
                        }
                    }
                }
            }
            return(list);
        }