private void buttonExport_Click(object sender, EventArgs e)
 {
     if (comboBoxPO.SelectedIndex > 0)
     {
         ///   CreateReceivingPdfReport(ReceivingId, POId);
         ReceivingReport rpt = new ReceivingReport(ReceivingId);
         rpt.Show();
     }
     else
     {
         MainClass.ShowMessage("Please Select a Purchase Order first.", "Error", "Error");
     }
 }
Exemple #2
0
        private void CreateReceivingPdfReport(int ReciveId, int PoId)
        {
            try
            {
                //string Path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
                //Path += "\\Receiving_PDF";

                //if (!System.IO.Directory.Exists(Path))
                //{
                //    System.IO.Directory.CreateDirectory(Path);
                //}

                //string dates = DateTime.Now.ToString();
                //string rd = dates.Replace("/", ":");
                //string rdd = rd.Replace(":", "_");

                //Path += "\\Receiving_Number_" + ReciveId.ToString() + "_" + rdd + ".pdf";
                //string supplier = "Supplier : ";

                //DataTable dtblSupplier = retrieve.GetPOSupplier(PoId);
                //if (dtblSupplier.Rows.Count > 0)
                //{
                //    supplier += dtblSupplier.Rows[0][0].ToString();
                //}
                //DataTable dtbl = retrieve.GetReceivLinesforPDFExport(ReciveId);
                //string Header = "Receiving #" + ReciveId.ToString();
                //PDFReports pdf = new PDFReports();
                //pdf.ExportDataTableToPdfReceiving(dtbl, Path, Header, supplier, labelGrandTotalValue.Text, PoId);

                //System.Diagnostics.Process.Start(Path);

                ReceivingReport rpt = new ReceivingReport(ReciveId);
                rpt.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error Message");
            }
        }