Beispiel #1
0
        private void ActivityLogReports_Load(object sender, EventArgs e)
        {
            Stores    stor      = new Stores();
            DataTable dtStor    = stor.GetActiveStores();
            DataRow   dtStorRow = dtStor.NewRow();

            dtStorRow["ID"]        = "0";
            dtStorRow["StoreName"] = "All Stores";
            dtStor.Rows.InsertAt(dtStorRow, 0);

            cboStores.Properties.DataSource = dtStor;

            DateTime dateFrom = dtFrom.Value;
            DateTime dateTo   = dtTo.Value;

            Supplier  sp      = new Supplier();
            DataTable dtsupp  = sp.GetActiveSuppliers();
            DataRow   dtrsupp = dtsupp.NewRow();

            dtrsupp["ID"]          = "0";
            dtrsupp["CompanyName"] = "All Suppliers";
            dtsupp.Rows.InsertAt(dtrsupp, 0);
            lkSupplier.Properties.DataSource  = dtsupp;
            lkSupplierT.Properties.DataSource = dtsupp;

            ReceivingUnits ru    = new ReceivingUnits();
            DataTable      dtru  = ru.GetAllApplicableDU();
            DataRow        dtrru = dtru.NewRow();

            dtrru["ID"]   = "0";
            dtrru["Name"] = "All Receiving Units";
            dtru.Rows.InsertAt(dtrru, 0);
            lklocation.Properties.DataSource  = dtru;
            lklocationT.Properties.DataSource = dtru;

            dtRec = rec.GetAllReceiveByDateRange(dateFrom, dateTo);
            dtiss = iss.GetIssuedByDateRange(dateFrom, dateTo);
            gridReceives.DataSource          = dtRec;
            gridIssues.DataSource            = dtiss;
            grdViewIssued.ActiveFilterString = String.Format("Quantity<>0");
            grdViewIssued.Columns["InternalDrugCode"].Visible = grdViewReceive.Columns["InternalDrugCode"].Visible = false;

            grdTotalReceived.DataSource = rec.GetTotalReceiveByDateRange(dateFrom, dateTo, 0);
            //grdVwTotalReceived.ActiveFilterString = String.Format("totalQuantity<>0");
            grdTotalIssued.DataSource           = iss.GetTotalIssuedByDateRange(dateFrom, dateTo, 0);
            grdVwTotalIssued.ActiveFilterString = String.Format("TotalQuantity<>0");
        }