示例#1
0
    private MemoryStream PrintTallySheetIndented(string orderNo, string jobType)
    {
        XtraReport rpt = new XtraReport();

        rpt.LoadLayout(Server.MapPath(@"~\PagesContTrucking\Report\repx\TallySheet.repx"));

        DataSet   set  = DocPrint.PrintTallySheet(orderNo, jobType, "Indented");
        DataTable Mast = set.Tables[0].Copy();

        Mast.TableName = "Mast";
        DataTable Detail = set.Tables[1].Copy();

        Detail.TableName = "Details";
        //if (Detail.Rows.Count > 0)
        //{
        //    DevExpress.XtraReports.UI.DetailReportBand details = rpt.Report.Bands["DetailReport"] as DevExpress.XtraReports.UI.DetailReportBand;
        //    if (details != null)
        //    {
        //        DevExpress.XtraReports.UI.DetailBand gridLine_sub = details.Bands["Detail"] as DevExpress.XtraReports.UI.DetailBand;
        //        DevExpress.XtraReports.UI.XRSubreport subReport_Line = new XRSubreport();
        //        subReport_Line.Name = "GridLine_sub";
        //        gridLine_sub.Controls.Add(subReport_Line);
        //        XtraReport rpt_Inv = new XtraReport();
        //        rpt_Inv.LoadLayout(Server.MapPath(@"~\PagesContTrucking\Report\repx\TallySheet_sub.repx"));
        //        subReport_Line.ReportSource = rpt_Inv;
        //        rpt_Inv.DataSource = Detail;
        //    }
        //}
        rpt.DataSource = set;
        System.IO.MemoryStream str = new MemoryStream();
        rpt.ExportToPdf(str);
        return(str);
    }
示例#2
0
    private MemoryStream PrintStockTallySheet(string orderNo, string jobType, string date1, string date2)
    {
        XtraReport rpt = new XtraReport();

        rpt.LoadLayout(Server.MapPath(@"~\PagesContTrucking\Report\repx\StockTallySheet.repx"));
        DataSet set = null;

        if (date1.Length > 0 && date2.Length > 0)
        {
            string[] s1 = date1.Split('/');
            string[] s2 = date2.Split('/');
            DateTime d1 = new DateTime(SafeValue.SafeInt(s1[2], 0), SafeValue.SafeInt(s1[1], 0), SafeValue.SafeInt(s1[0], 0));
            DateTime d2 = new DateTime(SafeValue.SafeInt(s2[2], 0), SafeValue.SafeInt(s2[1], 0), SafeValue.SafeInt(s2[0], 0));

            if (date1 != null && date2 != null)
            {
                set = DocPrint.PrintStockTallySheet(orderNo, d1, d2);
            }
        }
        else
        {
            set = DocPrint.PrintJobStockTallySheet(orderNo, jobType);
        }
        rpt.DataSource = set;
        System.IO.MemoryStream str = new MemoryStream();
        rpt.ExportToPdf(str);
        return(str);
    }
示例#3
0
    private MemoryStream PrintInventoryBalance(string orderNo, string jobType, string date1, string date2)
    {
        XtraReport rpt = new XtraReport();

        rpt.LoadLayout(Server.MapPath(@"~\Modules\Tpt\Report\repx\InventoryBalance.repx"));
        DataSet set = null;

        if (date1.Length > 0)
        {
            string[] s1 = date1.Split('/');
            DateTime d1 = new DateTime(SafeValue.SafeInt(s1[2], 0), SafeValue.SafeInt(s1[1], 0), SafeValue.SafeInt(s1[0], 0));
            DateTime d2 = DateTime.Today;

            if (date1 != null)
            {
                set = DocPrint.PrintInventoryBalance(orderNo, d1);
            }
        }
        rpt.DataSource = set;
        System.IO.MemoryStream str = new MemoryStream();
        if (docType == "1")
        {
            rpt.ExportToXls(str);
        }
        else
        {
            rpt.ExportToPdf(str);
        }
        return(str);
    }
示例#4
0
    private MemoryStream PrintCfsImpHaulier(string orderNo)
    {
        XtraReport rpt = new XtraReport();

        rpt.LoadLayout(Server.MapPath(@"~\PagesContTrucking\Report\repx\HaulierTruckingAdvice_Imp.repx"));
        rpt.DataSource = DocPrint.PrintImpHaulier(orderNo);

        System.IO.MemoryStream str = new MemoryStream();
        rpt.ExportToPdf(str);
        return(str);
    }
示例#5
0
    private MemoryStream PrintDN(string orderNo, string jobType)
    {
        XtraReport rpt = new XtraReport();

        rpt.LoadLayout(Server.MapPath(@"~\PagesContTrucking\Report\repx\Receipt_A4_2014.repx"));
        rpt.DataSource = DocPrint.DsReceipt(orderNo);

        System.IO.MemoryStream str = new MemoryStream();
        rpt.ExportToPdf(str);
        return(str);
    }
示例#6
0
    private MemoryStream PrintMovementDetail(string no, string sku)
    {
        XtraReport rpt = new XtraReport();

        rpt.LoadLayout(Server.MapPath(@"~\PagesContTrucking\Report\repx\MovementDetail.repx"));

        rpt.DataSource = DocPrint.PrintMovementDetail(no, sku);
        System.IO.MemoryStream str = new MemoryStream();
        if (docType == "1")
        {
            rpt.ExportToXls(str);
        }
        else
        {
            rpt.ExportToPdf(str);
        }

        return(str);
    }
示例#7
0
    private MemoryStream PrintHaulierSub(string orderNo, string jobType, string haulierCode)
    {
        XtraReport rpt = new XtraReport();

        rpt.LoadLayout(Server.MapPath(@"~\PagesContTrucking\Report\repx\HaulierTruckingAdviceSub.repx"));
        rpt.DataSource = DocPrint.PrintHaulierSub(orderNo, jobType, haulierCode);


        QR q = new QR();

        Wilson.ORMapper.OPathQuery query = new Wilson.ORMapper.OPathQuery(typeof(C2.CtmJob), "JobNo='" + orderNo + "'");
        C2.CtmJob job  = C2.Manager.ORManager.GetObject(query) as C2.CtmJob;
        string    text = string.Format(@"JobNo:" + orderNo + ",JobDate:" + job.JobDate.ToString("dd/MM/yyyy"));
        Bitmap    bt   = q.Create_QR(text);
        string    path = MapPath("~/files/barcode/");

        if (!Directory.Exists(path))
        {
            Directory.CreateDirectory(path);
        }
        string fileName = orderNo + ".png";
        string filePath = path + fileName;

        if (File.Exists(filePath))
        {
            File.Delete(filePath);
        }
        bt.Save(Server.MapPath("~/files/barcode/") + fileName);
        DevExpress.XtraReports.UI.XRPictureBox qr_code = rpt.Report.FindControl("barcode", true) as DevExpress.XtraReports.UI.XRPictureBox;
        if (qr_code != null)
        {
            qr_code.ImageUrl = "/files/barcode/" + fileName;
        }

        System.IO.MemoryStream str = new MemoryStream();
        rpt.ExportToPdf(str);
        return(str);
    }
示例#8
0
    private MemoryStream PrintJobSheet(string orderNo, string jobType, string tripId)
    {
        XtraReport rpt = new XtraReport();

        string path1    = string.Format("~/files/photos/");
        string path2    = path1.Replace(' ', '_').Replace('\'', '_');
        string pathx    = path2.Substring(1);
        string path3    = MapPath(path2);
        string filename = string.Format(@"{0}.jpg", orderNo);

        if (!Directory.Exists(path3))
        {
            Directory.CreateDirectory(path3);
        }
        string p = string.Format(@"~\files\photos\{0}", filename);

        string     e_file      = HttpContext.Current.Server.MapPath(p);
        DateTime   now         = DateTime.Now;
        string     file        = string.Format(@"~\html\{0}", jobType.ToUpper());
        string     htmlName    = string.Format(@"{0}.html", orderNo);
        string     httpPath    = HttpContext.Current.Request.Url.Host.ToString() + "/html/" + jobType.ToUpper() + "/" + htmlName;
        XtraReport rpt_barcode = new XtraReport();

        rpt_barcode.LoadLayout(Server.MapPath(@"~\PagesContTrucking\Report\repx\DeliveryOrder_CRA.repx"));
        rpt_barcode.DataSource = DocPrint.PrintJobSheet(orderNo, jobType, tripId);
        set_signed_barcode(rpt_barcode, orderNo, httpPath, filename);
        rpt_barcode.CreateDocument();
        rpt_barcode.ExportToImage(e_file);

        Dictionary <string, string> d = new Dictionary <string, string>();
        string http_Photo_Path        = "http://" + HttpContext.Current.Request.Url.Host.ToString() + "/files/photos/" + filename;
        string value = string.Format(@"<img src='{0}' alt=''/>", http_Photo_Path);

        d.Add("title", orderNo);
        d.Add("content", value);

        string temp = string.Format(@"~\html\template.html");


        html.CreateHtml(temp, file, htmlName, d, "");
        rpt.LoadLayout(Server.MapPath(@"~\PagesContTrucking\Report\repx\DeliveryOrder_CRA.repx"));
        string sql      = string.Format(@"select epodHardCopy from ctm_jobdet2 where Id={0}", tripId);
        string hardCopy = SafeValue.SafeString(ConnectSql.ExecuteScalar(sql));

        if (hardCopy == "HardCopy")
        {
            rpt.LoadLayout(Server.MapPath(@"~\PagesContTrucking\Report\repx\DO_HardCopy.repx"));
        }

        set_signed_barcode_byid(rpt, orderNo, tripId, httpPath, filename);

        DataSet   set  = DocPrint.PrintJobSheet(orderNo, jobType, tripId);
        DataTable Mast = set.Tables[0].Copy();

        Mast.TableName = "Mast";
        if (Mast.Rows.Count > 0)
        {
            string epodCB1 = SafeValue.SafeString(Mast.Rows[0]["EpodCB1"]);
            string epodCB2 = SafeValue.SafeString(Mast.Rows[0]["EpodCB2"]);
            string epodCB3 = SafeValue.SafeString(Mast.Rows[0]["EpodCB3"]);
            string epodCB4 = SafeValue.SafeString(Mast.Rows[0]["EpodCB4"]);
            string epodCB5 = SafeValue.SafeString(Mast.Rows[0]["EpodCB5"]);
            string epodCB6 = SafeValue.SafeString(Mast.Rows[0]["EpodCB6"]);
            DevExpress.XtraReports.UI.DetailBand details = rpt.Report.Bands["detailBand1"] as DevExpress.XtraReports.UI.DetailBand;
            if (details != null)
            {
                DevExpress.XtraReports.UI.XRCheckBox ckb1 = details.FindControl("ckb1", false) as DevExpress.XtraReports.UI.XRCheckBox;
                if (epodCB1 == "Yes")
                {
                    ckb1.Checked = true;
                }
                DevExpress.XtraReports.UI.XRCheckBox ckb2 = details.FindControl("ckb2", false) as DevExpress.XtraReports.UI.XRCheckBox;
                if (epodCB2 == "Yes")
                {
                    ckb2.Checked = true;
                }
                DevExpress.XtraReports.UI.XRCheckBox ckb3 = details.FindControl("ckb3", false) as DevExpress.XtraReports.UI.XRCheckBox;
                if (epodCB3 == "Yes")
                {
                    ckb3.Checked = true;
                }
                DevExpress.XtraReports.UI.XRCheckBox ckb4 = details.FindControl("ckb4", false) as DevExpress.XtraReports.UI.XRCheckBox;
                if (epodCB4 == "Yes")
                {
                    ckb4.Checked = true;
                }
                DevExpress.XtraReports.UI.XRCheckBox ckb5 = details.FindControl("ckb5", false) as DevExpress.XtraReports.UI.XRCheckBox;
                if (epodCB5 == "Yes")
                {
                    ckb5.Checked = true;
                }
                DevExpress.XtraReports.UI.XRCheckBox ckb6 = details.FindControl("ckb6", false) as DevExpress.XtraReports.UI.XRCheckBox;
                if (epodCB6 == "Yes")
                {
                    ckb6.Checked = true;
                }
            }
        }
        rpt.DataSource = set;

        System.IO.MemoryStream str = new MemoryStream();
        rpt.CreateDocument();
        rpt.ExportToPdf(str);


        return(str);
    }
示例#9
0
    private MemoryStream PrintDeliveryOrder(string orderNo, string id, string jobType)
    {
        XtraReport rpt      = new XtraReport();
        string     hardCopy = "";

        if (SafeValue.SafeInt(id, 0) > 0)
        {
            rpt.LoadLayout(Server.MapPath(@"~\PagesContTrucking\Report\repx\DO.repx"));

            string sql = string.Format(@"select epodHardCopy from ctm_jobdet2 where Id={0}", id);
            hardCopy = SafeValue.SafeString(ConnectSql.ExecuteScalar(sql));
            if (hardCopy == "HardCopy")
            {
                rpt.LoadLayout(Server.MapPath(@"~\PagesContTrucking\Report\repx\DO_HardCopy.repx"));
            }
            set_signed_barcode_byid(rpt, orderNo, id, "", "");
        }
        else if (jobType == "tr")
        {
            rpt.LoadLayout(Server.MapPath(@"~\PagesContTrucking\Report\repx\Transfer.repx"));
        }
        else if (jobType.ToLower() == "cra")
        {
            rpt.LoadLayout(Server.MapPath(@"~\PagesContTrucking\Report\repx\DeliveryOrder_CRA.repx"));
            if (hardCopy == "HardCopy")
            {
                rpt.LoadLayout(Server.MapPath(@"~\PagesContTrucking\Report\repx\DO_HardCopy.repx"));
                set_signed_barcode_byid(rpt, orderNo, id, "", "");
            }
        }
        else
        {
            string path1    = string.Format("~/files/photos/");
            string path2    = path1.Replace(' ', '_').Replace('\'', '_');
            string pathx    = path2.Substring(1);
            string path3    = MapPath(path2);
            string filename = string.Format(@"{0}.jpg", orderNo);
            if (!Directory.Exists(path3))
            {
                Directory.CreateDirectory(path3);
            }
            string p = string.Format(@"~\files\photos\{0}", filename);

            string     e_file      = HttpContext.Current.Server.MapPath(p);
            DateTime   now         = DateTime.Now;
            string     file        = string.Format(@"~\html\{0}", jobType.ToUpper());
            string     htmlName    = string.Format(@"{0}.html", orderNo);
            string     httpPath    = HttpContext.Current.Request.Url.Host.ToString() + "/html/" + jobType.ToUpper() + "/" + htmlName;
            XtraReport rpt_barcode = new XtraReport();
            if (jobType.ToLower() == "tp")
            {
                rpt.LoadLayout(Server.MapPath(@"~\PagesContTrucking\Report\repx\TransportOrder.repx"));
            }
            else
            {
                rpt.LoadLayout(Server.MapPath(@"~\PagesContTrucking\Report\repx\DO.repx"));
            }


            if (SafeValue.SafeInt(id, 0) > 0)
            {
                rpt_barcode.DataSource = DocPrint.PrintDeliveryTrip(orderNo, id, jobType);
                set_signed_barcode_byid(rpt_barcode, orderNo, id, httpPath, filename);
            }
            else
            {
                rpt_barcode.DataSource = DocPrint.PrintDeliveryOrder(orderNo, jobType);
                set_signed_barcode(rpt_barcode, orderNo, httpPath, filename);
            }

            rpt_barcode.CreateDocument();
            rpt_barcode.ExportToImage(e_file);

            Dictionary <string, string> d = new Dictionary <string, string>();
            string http_Photo_Path        = "http://" + HttpContext.Current.Request.Url.Host.ToString() + "/files/photos/" + filename;
            string value = string.Format(@"<img src='{0}' alt=''/>", http_Photo_Path);
            d.Add("title", orderNo);
            d.Add("content", value);

            string temp = string.Format(@"~\html\template.html");


            html.CreateHtml(temp, file, htmlName, d, "");
            if (jobType.ToLower() == "tp")
            {
                rpt_barcode.LoadLayout(Server.MapPath(@"~\PagesContTrucking\Report\repx\TransportOrder.repx"));
            }
            else
            {
                rpt_barcode.LoadLayout(Server.MapPath(@"~\PagesContTrucking\Report\repx\DO.repx"));
            }
            if (SafeValue.SafeInt(id, 0) > 0)
            {
                set_signed_barcode_byid(rpt, orderNo, id, httpPath, filename);
            }
            else
            {
                set_signed_barcode(rpt, orderNo, httpPath, filename);
            }
        }
        if (SafeValue.SafeInt(id, 0) > 0)
        {
            rpt.DataSource = DocPrint.PrintDeliveryTrip(orderNo, id, jobType);
        }
        else
        {
            rpt.DataSource = DocPrint.PrintDeliveryOrder(orderNo, jobType);
        }
        System.IO.MemoryStream str = new MemoryStream();
        rpt.CreateDocument();
        rpt.ExportToPdf(str);


        return(str);
    }
示例#10
0
    private MemoryStream PrintDelivery(string orderNo, string jobType)
    {
        XtraReport rpt = new XtraReport();

        rpt.LoadLayout(Server.MapPath(@"~\PagesContTrucking\Report\repx\DeliveryOrder.repx"));
        rpt.DataSource = DocPrint.PrintHaulier(orderNo, jobType);


        QR q = new QR();

        Wilson.ORMapper.OPathQuery query = new Wilson.ORMapper.OPathQuery(typeof(C2.CtmJob), "JobNo='" + orderNo + "'");
        C2.CtmJob job  = C2.Manager.ORManager.GetObject(query) as C2.CtmJob;
        string    text = string.Format(@"JobNo:" + orderNo + ",JobDate:" + job.JobDate.ToString("dd/MM/yyyy"));
        Bitmap    bt   = q.Create_QR(text);
        string    path = MapPath("~/files/barcode/");

        if (!Directory.Exists(path))
        {
            Directory.CreateDirectory(path);
        }
        string fileName = orderNo + ".png";
        string filePath = path + fileName;

        if (File.Exists(filePath))
        {
            File.Delete(filePath);
        }
        bt.Save(Server.MapPath("~/files/barcode/") + fileName);
        DevExpress.XtraReports.UI.XRPictureBox qr_code = rpt.Report.FindControl("barcode", true) as DevExpress.XtraReports.UI.XRPictureBox;
        if (qr_code != null)
        {
            qr_code.ImageUrl = "/files/barcode/" + fileName;
        }
        string sql_trip = string.Format(@"select top 1 Id from ctm_jobdet2 where JobNo='{0}'", orderNo);

        string tripId = ConnectSql_mb.ExecuteScalar(sql_trip);

        string Signature_Consignee = "";
        string Signature_Driver    = "";

        string sql_signature = string.Format(@"select Id,FileType,FileName,FilePath,FileNote From CTM_Attachment where FileType='Signature' and RefNo=@RefNo and charindex(@sType, FileNote,0)>0 and TripId=@tripId");
        List <ConnectSql_mb.cmdParameters> list = new List <ConnectSql_mb.cmdParameters>();

        list.Add(new ConnectSql_mb.cmdParameters("@RefNo", orderNo, SqlDbType.NVarChar, 100));
        list.Add(new ConnectSql_mb.cmdParameters("@sType", "Consignee", SqlDbType.NVarChar, 100));
        list.Add(new ConnectSql_mb.cmdParameters("@tripId", tripId, SqlDbType.Int));
        DataTable dt = ConnectSql_mb.GetDataTable(sql_signature, list);

        if (dt.Rows.Count > 0)
        {
            Signature_Consignee = dt.Rows[0]["FilePath"].ToString();
        }
        list = new List <ConnectSql_mb.cmdParameters>();
        list.Add(new ConnectSql_mb.cmdParameters("@RefNo", orderNo, SqlDbType.NVarChar, 100));
        list.Add(new ConnectSql_mb.cmdParameters("@sType", "Driver", SqlDbType.NVarChar, 100));
        list.Add(new ConnectSql_mb.cmdParameters("@tripId", tripId, SqlDbType.Int));
        dt = ConnectSql_mb.GetDataTable(sql_signature, list);
        if (dt.Rows.Count > 0)
        {
            Signature_Driver = dt.Rows[0]["FilePath"].ToString();
        }


        DevExpress.XtraReports.UI.XRPictureBox signature = rpt.Report.FindControl("signature", true) as DevExpress.XtraReports.UI.XRPictureBox;
        if (signature != null)
        {
            signature.ImageUrl = Signature_Consignee;
        }
        DevExpress.XtraReports.UI.XRPictureBox signature1 = rpt.Report.FindControl("signature1", true) as DevExpress.XtraReports.UI.XRPictureBox;
        if (signature1 != null)
        {
            signature1.ImageUrl = Signature_Driver;
        }
        System.IO.MemoryStream str = new MemoryStream();
        rpt.ExportToPdf(str);
        return(str);
    }
示例#11
0
    private bool ePOD_SendEmail(int tripId)
    {
        bool   res = false;
        string sql = string.Format(@"select job.JobNo,job.EmailAddress,job.JobType,det2.epodHardCopy  
from ctm_jobdet2 as det2
left outer join ctm_job as job on job.JobNo=det2.JobNo
where det2.Id=@tripId");
        List <ConnectSql_mb.cmdParameters> list = new List <ConnectSql_mb.cmdParameters>();

        list.Add(new ConnectSql_mb.cmdParameters("@tripId", tripId, SqlDbType.Int));
        DataTable dt = ConnectSql_mb.GetDataTable(sql, list);

        if (dt.Rows.Count > 0)
        {
            string JobNo    = dt.Rows[0]["JobNo"].ToString();
            string email    = dt.Rows[0]["EmailAddress"].ToString();
            string JobType  = dt.Rows[0]["JobType"].ToString();
            string hardCopy = dt.Rows[0]["epodHardCopy"].ToString();

            if (email != "")
            {
                try
                {
                    //bool action = false;
                    string path1 = string.Format("~/files/pdf/");
                    string path2 = path1.Replace(' ', '_').Replace('\'', '_');
                    string pathx = path2.Substring(1);
                    //string path3 = MapPath(path2);
                    //string path3 = Path.Combine(@"C:\boox\boox_ell", path2);
                    string path3 = HttpContext.Current.Server.MapPath(path2);
                    if (!Directory.Exists(path3))
                    {
                        Directory.CreateDirectory(path3);
                    }
                    string p      = string.Format(@"~\files\pdf\DeliveryOrder_Crane_{0}.pdf", DateTime.Now.ToString("yyyyMMdd_HHmmss"));
                    string e_file = HttpContext.Current.Server.MapPath(p);
                    //if (!File.Exists(e_file))
                    //{
                    //    File.Create(e_file);
                    //}

                    MemoryStream ms  = new MemoryStream();
                    XtraReport   rpt = new XtraReport();
                    if (hardCopy == "HardCopy")
                    {
                        rpt.LoadLayout(Server.MapPath(@"~\PagesContTrucking\Report\repx\DO_HardCopy.repx"));
                    }
                    else
                    {
                        rpt.LoadLayout(Server.MapPath(@"~\PagesContTrucking\Report\repx\DeliveryOrder_CRA.repx"));
                    }
                    rpt.DataSource = DocPrint.PrintJobSheet(JobNo, JobType, tripId + "");


                    //============ bind signatrue
                    QR q = new QR();
                    Wilson.ORMapper.OPathQuery query = new Wilson.ORMapper.OPathQuery(typeof(C2.CtmJob), "JobNo='" + JobNo + "'");
                    C2.CtmJob job  = C2.Manager.ORManager.GetObject(query) as C2.CtmJob;
                    string    text = string.Format(@"JobNo:" + JobNo + ",JobDate:" + job.JobDate.ToString("dd/MM/yyyy"));
                    Bitmap    bt   = q.Create_QR(text);
                    string    path = HttpContext.Current.Server.MapPath("~/files/barcode/");
                    if (!Directory.Exists(path))
                    {
                        Directory.CreateDirectory(path);
                    }
                    string fileName = JobNo + ".png";
                    string filePath = path + fileName;
                    if (File.Exists(filePath))
                    {
                        File.Delete(filePath);
                    }
                    bt.Save(Server.MapPath("~/files/barcode/") + fileName);

                    string Signature_Consignee = "";
                    string Signature_Driver    = "";
                    string sql_signature       = string.Format(@"select Id,FileType,FileName,FilePath,FileNote From CTM_Attachment where FileType='Signature' and RefNo=@RefNo and charindex(@sType, FileNote,0)>0 and TripId=@tripId");
                    list = new List <ConnectSql_mb.cmdParameters>();
                    list.Add(new ConnectSql_mb.cmdParameters("@RefNo", JobNo, SqlDbType.NVarChar, 100));
                    list.Add(new ConnectSql_mb.cmdParameters("@sType", "Consignee", SqlDbType.NVarChar, 100));
                    list.Add(new ConnectSql_mb.cmdParameters("@tripId", tripId, SqlDbType.Int));
                    dt = ConnectSql_mb.GetDataTable(sql_signature, list);
                    if (dt.Rows.Count > 0)
                    {
                        Signature_Consignee = dt.Rows[0]["FilePath"].ToString().Replace(@"/500", "");
                    }
                    list = new List <ConnectSql_mb.cmdParameters>();
                    list.Add(new ConnectSql_mb.cmdParameters("@RefNo", JobNo, SqlDbType.NVarChar, 100));
                    list.Add(new ConnectSql_mb.cmdParameters("@sType", "Driver", SqlDbType.NVarChar, 100));
                    list.Add(new ConnectSql_mb.cmdParameters("@tripId", tripId, SqlDbType.Int));
                    dt = ConnectSql_mb.GetDataTable(sql_signature, list);
                    if (dt.Rows.Count > 0)
                    {
                        Signature_Driver = dt.Rows[0]["FilePath"].ToString();
                    }
                    DevExpress.XtraReports.UI.XRPictureBox qr_code = rpt.Report.FindControl("barcode", true) as DevExpress.XtraReports.UI.XRPictureBox;
                    if (qr_code != null)
                    {
                        qr_code.ImageUrl = "/files/barcode/" + fileName;
                    }
                    DevExpress.XtraReports.UI.XRPictureBox signature = rpt.Report.FindControl("signature", true) as DevExpress.XtraReports.UI.XRPictureBox;
                    if (signature != null)
                    {
                        signature.ImageUrl = Signature_Consignee;
                    }
                    signature = rpt.Report.FindControl("signature1", true) as DevExpress.XtraReports.UI.XRPictureBox;
                    if (signature != null)
                    {
                        signature.ImageUrl = Signature_Driver;
                    }



                    System.IO.MemoryStream str = new MemoryStream();
                    rpt.CreateDocument();
                    rpt.ExportToPdf(e_file);


                    Helper.Email.SendEmail(email, "*****@*****.**", "*****@*****.**", "Delivery Order " + JobNo, "", p);

                    res = true;
                }
                catch { }

                //            string company = System.Configuration.ConfigurationManager.AppSettings["CompanyName"];
                //            string address1 = System.Configuration.ConfigurationManager.AppSettings["CompanyAddress1"];
                //            string address2 = System.Configuration.ConfigurationManager.AppSettings["CompanyAddress2"];
                //            string address3 = System.Configuration.ConfigurationManager.AppSettings["CompanyAddress3"];
                //            sql = string.Format(@"select Email1,Email2,Name from xxparty where PartyId='{0}'",JobNo);
                //            DataTable tab = ConnectSql.GetTab(sql);
                //            string add = address1 + " " + address2 + " " + address3;
                //            string title = "Haulier Advice";
                //            if (tab.Rows.Count > 0)
                //            {
                //                string email1 = SafeValue.SafeString(tab.Rows[0]["Email1"]);
                //                string email2 = SafeValue.SafeString(tab.Rows[0]["Email2"]);
                //                string name = SafeValue.SafeString(tab.Rows[0]["Name"]);
                //                string mes = string.Format(@"<b>{0}</b><br><br>
                //{1}<br><br>
                //<b>Dear Customer, <br><br>Kindly review attached document for  HAULIER ADVICE.</b>
                //<br><br>
                //<b>This is a computer generated email, please DO NOT reply.
                //<br><br>
                //Pls email to : [email protected] for any questions.
                //</b><br><br>
                //***IMPORTANT NOTICE***<br><br>
                //
                //1.     Pls wait for our delivery department to call you for delivery arrangement<br><br>
                //
                //2.     Delivery arrangement will be made within 3 working days from the date of unstuffing of container.<br><br>
                //<br><br>", company, add);
                //                if (email1.Length > 0)
                //                {
                //                    Helper.Email.SendEmail(email1, "[email protected],[email protected]", "*****@*****.**", title, mes, p);
                //                    //Helper.Email.SendEmail("*****@*****.**", "[email protected],[email protected]", "", title, mes, p);
                //                    action = true;
                //                }
                //                if (email2.Length > 0)
                //                {
                //                    if (action)
                //                        Helper.Email.SendEmail(email2, "", "", title, mes, p);
                //                    else
                //                        Helper.Email.SendEmail(email2, "[email protected],[email protected]", "*****@*****.**", title, mes, p);
                //                }
                //                //"*****@*****.**", "*****@*****.**"
                //                res = true;
                //            }
            }
        }
        return(res);
    }