Ejemplo n.º 1
0
        private void simpleButton_Print_Click(object sender, EventArgs e)
        {
            var depotName = listBoxControl_Depots.GetItemText(listBoxControl_Depots.SelectedIndex);
            var depotDate = Convert.ToDateTime(dateEdit_DepotDate.EditValue);
            var sscc      = string.Empty;

            if (gridView_SSCC.GetRowCellValue(gridView_SSCC.FocusedRowHandle, gridView_SSCC.Columns[0]) != null)
            {
                sscc = gridView_SSCC.GetRowCellValue(gridView_SSCC.FocusedRowHandle, gridView_SSCC.Columns[0]).ToString();
            }

            if (!string.IsNullOrEmpty(sscc))
            {
                var       tableInfo = new ReportDataSetTableInfo(depotName, depotDate.ToString("dd/MM/yyyy dddd"), sscc);
                DataTable dtInfo    = tableInfo.GetTableInfo();

                var       tableProducts = new DatabaseConnectionSI();
                DataTable dtProducts    = tableProducts.GetSsccProducts(sscc);

                DataRow dr = dtInfo.Rows[0];
                dr[6] = dtProducts.Rows.Count;

                DataSet ds = new DataSet();
                ds.Tables.Add(dtInfo);
                ds.Tables.Add(dtProducts);

                //ds.WriteXmlSchema(@"d:\ScotbeefSolutions\SSCC.xsd");

                XtraReport report = new SSCCReport();
                report.DataSource = ds;

                ReportPrintTool pt = new ReportPrintTool(report);
                pt.ShowPreview();
            }
        }
Ejemplo n.º 2
0
        private void GetDepots()
        {
            var connection = new DatabaseConnectionSI();
            var depotTable = connection.GetDepotList();

            listBoxControl_Depots.DisplayMember = connection.DisplayMember;
            listBoxControl_Depots.ValueMember   = connection.ValueMember;
            listBoxControl_Depots.DataSource    = depotTable;
        }
Ejemplo n.º 3
0
        private void GetSSCCList()
        {
            var    depotDate = Convert.ToDateTime(dateEdit_DepotDate.EditValue);
            string depotName = null;

            if (listBoxControl_Depots.SelectedValue != null)
            {
                depotName = listBoxControl_Depots.SelectedValue.ToString();
            }

            if (depotName != null && depotDate != null)
            {
                var connection = new DatabaseConnectionSI();
                var ssccTable  = connection.GetSsccList(depotName, depotDate.ToString("MM/dd/yyyy"));

                gridControl_SSCC.DataSource = ssccTable;
            }
        }