Exemplo n.º 1
0
        public List <InventoryDetailItemCha> CreateReportXNTNewChiTiet(ParameterInventory pi)
        {
            List <InventoryDetailItemCha> data = new List <InventoryDetailItemCha>();
            DateTime beginDay, endDay;
            string   ky = string.Empty;

            beginDay = new DateTime(pi.FromDate.Year, pi.FromDate.Month, pi.FromDate.Day, 0, 0, 0);
            endDay   = new DateTime(pi.ToDate.Year, pi.ToDate.Month, pi.ToDate.Day, 23, 59, 59);

            var period = UnitOfWork.Repository <MdPeriod>().DbSet.FirstOrDefault(x => x.FromDate >= beginDay && x.FromDate <= endDay);

            if (period != null)
            {
                ky = ProcedureCollection.GetTableName(period.Year, period.Period);
            }
            switch (pi.GroupBy)
            {
            case TypeGroupInventory.TYPE:
                data = ProcedureCollection.ReportXNTNew_ChiTiet(pi.FromDate, pi.ToDate, pi.UnitCode, pi.WareHouseCodes, pi.MerchandiseTypeCodes, pi.MerchandiseGroupCodes, pi.MerchandiseCodes, InventoryGroupBy.MALOAIVATTU.ToString(), pi.NhaCungCapCodes);
                break;

            case TypeGroupInventory.GROUP:
                data = ProcedureCollection.ReportXNTNew_ChiTiet(pi.FromDate, pi.ToDate, pi.UnitCode, pi.WareHouseCodes, pi.MerchandiseTypeCodes, pi.MerchandiseGroupCodes, pi.MerchandiseCodes, InventoryGroupBy.MANHOMVATTU.ToString(), pi.NhaCungCapCodes);
                break;

            case TypeGroupInventory.NHACUNGCAP:
                data = ProcedureCollection.ReportXNTNew_ChiTiet(pi.FromDate, pi.ToDate, pi.UnitCode, pi.WareHouseCodes, pi.MerchandiseTypeCodes, pi.MerchandiseGroupCodes, pi.MerchandiseCodes, InventoryGroupBy.MANHACUNGCAP.ToString(), pi.NhaCungCapCodes);
                break;

            case TypeGroupInventory.WAREHOUSE:
                data = ProcedureCollection.ReportXNTNew_ChiTiet(pi.FromDate, pi.ToDate, pi.UnitCode, pi.WareHouseCodes, pi.MerchandiseTypeCodes, pi.MerchandiseGroupCodes, pi.MerchandiseCodes, InventoryGroupBy.MAKHO.ToString(), pi.NhaCungCapCodes);
                break;

            default:
                data = ProcedureCollection.ReportXNTNew_ChiTiet(pi.FromDate, pi.ToDate, pi.UnitCode, pi.WareHouseCodes, pi.MerchandiseTypeCodes, pi.MerchandiseGroupCodes, pi.MerchandiseCodes, InventoryGroupBy.MAVATTU.ToString(), pi.NhaCungCapCodes);
                break;
            }
            return(data);
        }