示例#1
0
        private void PopulateDepartmentSalesData()
        {
            // load the datagrid with data
            BindingSource bind = new BindingSource();

            SalesDepartmentData sdData = new SalesDepartmentData();

            dt = sdData.GetDepartmentSalesDataByDateID(SalesDateId);

            dgSalesDept.AutoGenerateColumns = false;

            // In the properties window, create a collection of headers and edit their name..
            // then set the named column[nameofcolumn] to the
            // datapropertyname, which is the 'header' of the datatable that was loaded with the data.
            //
            dgSalesDept.Columns["hdrSalesDateId"].DataPropertyName = "DateId";
            dgSalesDept.Columns["hdrSalesDeptId"].DataPropertyName = "SalesDeptId";
            dgSalesDept.Columns["hdrSalesDept"].DataPropertyName   = "SalesDept";
            dgSalesDept.Columns["hdrQuantity"].DataPropertyName    = "SalesCount";
            dgSalesDept.Columns["hdrTotal"].DataPropertyName       = "Amount";
            //bind.DataSource = dt;
            dgSalesDept.DataSource = dt;


            //dgSalesDept.
        }
示例#2
0
        private int GetSalesDeptIDByName(string deptName)
        {
            int deptId;
            SalesDepartmentData dept = new SalesDepartmentData();

            deptId = dept.GetDeptIDByName(deptName);
            return(deptId);
        }
示例#3
0
        private void btnNext2_Click(object sender, EventArgs e)
        {   // updates or inserts the Sales Department data.
            // update the dataabase
            // Create a list with all teh data from datagrid

            SalesDepartmentData salesdata = new FuelCenterDB.SalesDepartmentData();

            //int rows = 0;

            //for (int x = 0; x <= dt.columns.count - 1; x++)
            //{
            //    lblresults2.text += dt.columns[x].columnname;
            //}
            //rows = salesdata.insertsalesdatalistdb(dt, salesdata.dasql);

            //pnlregister.visible = true;
            Debug.Write("the btnNExt was clicked");
        }