Beispiel #1
0
        private void initData()
        {
            DataTable dt = new WarehouseBLL().GetList(null);

            dt.Columns[0].ColumnName = "id";
            dt.Columns[1].ColumnName = "name";
            DataRow dr = dt.NewRow();

            dr["id"]   = "";
            dr["name"] = "所有";
            dt.Rows.InsertAt(dr, 0);

            cmbWarehouse.DataSource    = dt;
            cmbWarehouse.DisplayMember = "name";
            cmbWarehouse.ValueMember   = "id";
            cmbWarehouse.SelectedIndex = 0;

            DataTable temp = new DataTable();

            for (int i = 0; i < 6; i++)
            {
                DataColumn column = new DataColumn();
                column.DataType   = System.Type.GetType("System.String");
                column.ColumnName = i.ToString();

                temp.Columns.Add(column);
            }
            this.dataGridView1.DataSource = temp;
            getName();
        }
Beispiel #2
0
        private void PlaceSetForm_Load(object sender, EventArgs e)
        {
            #region 设置货区 数据源
            this.dgv_area.DataSource       = abll.GetList(null);
            dgv_area.Columns[0].HeaderText = "货区编码";
            dgv_area.Columns[1].HeaderText = "货区名称";
            dgv_area.Columns[2].HeaderText = "备注";
            #endregion

            #region combox
            DataTable dt = new WarehouseBLL().GetList(null);
            dt.Columns[0].ColumnName = "id";
            dt.Columns[1].ColumnName = "name";
            DataRow dr = dt.NewRow();
            dr["id"]   = "";
            dr["name"] = "所有";
            dt.Rows.InsertAt(dr, 0);

            cmbJia.DataSource    = dt;
            cmbJia.DisplayMember = "name";
            cmbJia.ValueMember   = "id";
            cmbJia.SelectedIndex = 0;

            cmbLie.DataSource    = initCC();
            cmbLie.DisplayMember = "name";
            cmbLie.ValueMember   = "id";
            cmbLie.SelectedIndex = 0;

            cmbCeng.DataSource    = initCC();
            cmbCeng.DisplayMember = "name";
            cmbCeng.ValueMember   = "id";
            cmbCeng.SelectedIndex = 0;
            #endregion
            initFlag = true;
            setPlaceData();
        }