Ejemplo n.º 1
0
        private string CreateXlsRptCCF(RptCCFInput input)
        {
            //get data
            List <RptCCFDto> data = _rptCcfBLL.GetRptCcf(input);
            var listData          = Mapper.Map <List <RptCCFItem> >(data);

            var slDocument = new SLDocument();

            //title
            slDocument.SetCellValue(1, 1, "CCF Report Data");
            slDocument.MergeWorksheetCells(1, 1, 1, 14);
            //create style
            SLStyle valueStyle = slDocument.CreateStyle();

            valueStyle.SetHorizontalAlignment(HorizontalAlignmentValues.Center);
            valueStyle.Font.Bold     = true;
            valueStyle.Font.FontSize = 18;
            slDocument.SetCellStyle(1, 1, valueStyle);

            //create header
            slDocument = CreateHeaderExcelDashboard(slDocument);

            //create data
            slDocument = CreateDataExcelDashboard(slDocument, listData);

            var fileName = "RptCCF" + DateTime.Now.ToString("_yyyyMMddHHmmss") + ".xlsx";
            var path     = Path.Combine(Server.MapPath(Constans.UploadPath), fileName);

            slDocument.SaveAs(path);

            return(path);
        }
Ejemplo n.º 2
0
        public List <TRA_CCF> GetRptCcf(RptCCFInput filter)
        {
            Expression <Func <TRA_CCF, bool> > queryFilter = PredicateHelper.True <TRA_CCF>();

            if (filter != null)
            {
                if (filter.PeriodFrom != null)
                {
                    queryFilter = queryFilter.And(c => (c.CREATED_DATE.Day >= filter.PeriodFrom.Day) &&
                                                  (c.CREATED_DATE.Month >= filter.PeriodFrom.Month) &&
                                                  (c.CREATED_DATE.Year >= filter.PeriodFrom.Year));
                }
                if (filter.PeriodTo != null)
                {
                    queryFilter = queryFilter.And(c => (c.CREATED_DATE.Day <= filter.PeriodTo.Day) &&
                                                  (c.CREATED_DATE.Month <= filter.PeriodTo.Month) &&
                                                  (c.CREATED_DATE.Year <= filter.PeriodTo.Year));
                }
                if (filter.Category > 0)
                {
                    queryFilter = queryFilter.And(c => c.COMPLAINT_CATEGORY == filter.Category);
                }
                if (!string.IsNullOrEmpty(filter.Coordinator))
                {
                    queryFilter = queryFilter.And(c => c.COORDINATOR_NAME.ToUpper() == filter.Coordinator.ToUpper());
                }
                if (!string.IsNullOrEmpty(filter.Location))
                {
                    queryFilter = queryFilter.And(c => c.LOCATION_CITY.ToUpper() == filter.Location.ToUpper());
                }
                if (filter.CoorKPI > 0)
                {
                    queryFilter = queryFilter.And(c => c.COORDINATOR_KPI == filter.CoorKPI);
                }
                if (filter.VendorKPI > 0)
                {
                    queryFilter = queryFilter.And(c => c.VENDOR_KPI == filter.VendorKPI);
                }
            }

            return(_rptCcfRepository.Get(queryFilter, null, "").ToList());
        }
Ejemplo n.º 3
0
        public List <RptCCFDto> GetRptCcf(RptCCFInput filter)
        {
            var data = _RptCcfService.GetRptCcf(filter);

            return(Mapper.Map <List <RptCCFDto> >(data));
        }