Ejemplo n.º 1
0
        public List <Pcis> AddPcises(string cicoid, string sYear, string atCode)
        {
            var varPcisResults = _hmEntities.FetchPcisList(cicoid, sYear, atCode).ToList();
            var lstPcisResults = new List <Pcis>();


            if (varPcisResults.Any())
            {
                lstPcisResults = varPcisResults.AsEnumerable().Select(item =>
                                                                      new Pcis()
                {
                    PcisId            = item.PCIS_ID,
                    Entity            = item.Entity,
                    EntityProject     = item.Entity_Project_Name,
                    PromotionItems    = item.Promotion_Items,
                    ExpenditureAmount = item.Expenditure_Amount
                }).ToList();

                for (var i = 0; i < 5; i++)
                {
                    var pcis = new Pcis {
                        PcisId = 0, Entity = "", EntityProject = "", PromotionItems = "", ExpenditureAmount = 0
                    };
                    lstPcisResults.Add(pcis);
                }
            }
            else
            {
                var pcis = new Pcis {
                    PcisId = 0, Entity = "", EntityProject = "", PromotionItems = "", ExpenditureAmount = 0
                };
                lstPcisResults.Add(pcis);
            }
            return(lstPcisResults);
        }
Ejemplo n.º 2
0
        public List <Pcis> FetchPcises(string cicoid, string fiscalYr, string atCd, bool blnPrint)
        {
            var varPcisResults = _hmEntities.FetchPcisList(cicoid, fiscalYr, atCd).ToList();

            if (blnPrint)
            {
                var lstPcisResults = varPcisResults.AsEnumerable().Select(item =>
                                                                          new Pcis()
                {
                    PcisId            = item.PCIS_ID,
                    Entity            = item.Entity,
                    EntityProject     = item.Entity_Project_Name,
                    PromotionItems    = item.Promotion_Items,
                    ExpenditureAmount = item.Expenditure_Amount
                }).ToList();
                return(lstPcisResults);
            }
            if (varPcisResults.Any())
            {
                var lstPcisResults = varPcisResults.AsEnumerable().Select(item =>
                                                                          new Pcis()
                {
                    PcisId            = item.PCIS_ID,
                    Entity            = item.Entity,
                    EntityProject     = item.Entity_Project_Name,
                    PromotionItems    = item.Promotion_Items,
                    ExpenditureAmount = item.Expenditure_Amount
                }).ToList();
                return(lstPcisResults);
            }


            var lstPcis = new List <Pcis>();

            for (var i = 0; i < 25; i++)
            {
                var pcis = new Pcis {
                    PcisId = 0, Entity = "", EntityProject = "", PromotionItems = "", ExpenditureAmount = 0
                };
                lstPcis.Add(pcis);
            }
            return(lstPcis);
        }