Example #1
0
        private string GetRowDetailForDow(ExternalReportDTO item, string type)
        {
            var product = !string.IsNullOrEmpty(item.Product) ? item.Product.Replace(@",", ".") : "";

            var startDate = string.Format("{0:MM/dd/yyyy,HH:mm}", item.ServiceStartDate) ?? "";

            if (string.IsNullOrEmpty(startDate))
            {
                startDate = ",";
            }

            var finishDate = string.Format("{0:MM/dd/yyyy,HH:mm}", item.ServiceFinishDate) ?? "";

            if (string.IsNullOrEmpty(finishDate))
            {
                finishDate = ",";
            }

            string textProperties = ExcelHelper.StringToCSVCell(item.Username) + "," + ExcelHelper.StringToCSVCell(item.Drivername) + "," + ExcelHelper.StringToCSVCell(item.EquipmentNumber) + "," + ExcelHelper.StringToCSVCell(item.ChassisNo) + "," +
                                    ExcelHelper.StringToCSVCell(item.EquipmentStatusName) + "," + ExcelHelper.StringToCSVCell(item.Service) + "," + ExcelHelper.StringToCSVCell(product) + ", " +
                                    ExcelHelper.StringToCSVCell(item.ChargeNo) + ", " + ExcelHelper.StringToCSVCell(item.OriginBlock) + "," + ExcelHelper.StringToCSVCell(item.DestinationBlock) + "," +
                                    startDate + ",";

            if (type == "internalHistoryReport")
            {
                textProperties += finishDate + ",";
            }

            textProperties += ExcelHelper.StringToCSVCell(item.DriverComments);

            return(textProperties);
        }
Example #2
0
        private string GetRowDetail(ExternalReportDTO item, decimal driverpay, string type)
        {
            var cb           = String.Format("{0:0.00}", item.CustomerBill);
            var cbWithFormat = cb.Replace(@",", ".");

            var th           = String.Format("{0:0.00}", item.ServiceTotalHours);
            var thWithFormat = th.Replace(@",", ".");

            var dp           = String.Format("{0:0.00}", driverpay);
            var dpWithFormat = dp.Replace(@",", ".");

            var product = !string.IsNullOrEmpty(item.Product) ? item.Product.Replace(@",", ".") : "";

            var startDate = string.Format("{0:MM/dd/yyyy,HH:mm,dddd}", item.ServiceStartDate) ?? "";

            if (string.IsNullOrEmpty(startDate))
            {
                startDate = ",,";
            }

            var finishDate = string.Format("{0:MM/dd/yyyy,HH:mm,dddd}", item.ServiceFinishDate) ?? "";

            if (string.IsNullOrEmpty(finishDate))
            {
                finishDate = ",,";
            }

            var chargeNo = item.ChargeNo;

            if ((type == "internalHistoryReport" || type == "internalCurrentReport") && item.ChargeType == Constants.ChargeTypeCode.Shipment)
            {
                chargeNo = "\r00" + item.ChargeNo + "\r";
            }

            string textProperties = ExcelHelper.StringToCSVCell(item.Username) + "," + ExcelHelper.StringToCSVCell(item.EquipmentNumber) + "," + ExcelHelper.StringToCSVCell(item.EquipmentStatusName) + "," + ExcelHelper.StringToCSVCell(item.EquipmentSize) + "," +
                                    ExcelHelper.StringToCSVCell(item.EquipmentType) + "," + ExcelHelper.StringToCSVCell(item.ChassisNo) + "," + ExcelHelper.StringToCSVCell(item.Service) + "," + ExcelHelper.StringToCSVCell(product) + ", " + ExcelHelper.StringToCSVCell(item.IsHazardousLabel) + "," + ExcelHelper.StringToCSVCell(chargeNo) + ", " +
                                    ExcelHelper.StringToCSVCell(item.OriginBlock) + "," +
                                    ExcelHelper.StringToCSVCell(item.DestinationBlock) + "," + ExcelHelper.StringToCSVCell(item.Approver) + "," + ExcelHelper.StringToCSVCell(item.ApprovalStatus) + "," + ExcelHelper.StringToCSVCell(item.DispatchingParty) + "," +
                                    startDate + ",";

            if (type == "internalHistoryReport" || type == "externalHistoryReport")
            {
                textProperties += finishDate + ",";
                textProperties += ExcelHelper.StringToCSVCell(thWithFormat) + ",";
            }

            if (type == "internalHistoryReport" || type == "internalCurrentReport")
            {
                textProperties += ExcelHelper.StringToCSVCell(dpWithFormat) + ",";
            }

            textProperties += ExcelHelper.StringToCSVCell(cbWithFormat);

            if (type == "internalHistoryReport" || type == "internalCurrentReport")
            {
                textProperties += "," + ExcelHelper.StringToCSVCell(item.DriverComments);
            }

            return(textProperties);
        }