private void cmbTrfFromCategory_SelectedIndexChanged(object sender, EventArgs e) { dgvTrf.DataSource = null; lblTotalQty.Text = ""; if (cmbTrfFromCategory.Text.Equals("Factory")) { DataTable dt = dalFac.Select(); loadLocationData(dt, cmbTrfFrom, "fac_name"); } else if (cmbTrfFromCategory.Text.Equals("Customer")) { DataTable dt = dalCust.Select(); loadLocationData(dt, cmbTrfFrom, "cust_name"); //cmbTrfFrom.Text = tool.getCustomerName(cmbTrfItemCode.Text); } else if (cmbTrfFromCategory.Text.Equals("Assembly")) { cmbTrfFrom.DataSource = null; cmbTrfToCategory.SelectedIndex = 0; cmbTrfTo.SelectedIndex = 4; } else { cmbTrfFrom.DataSource = null; } }
private void loadCustomerList() { DataTable dt = dalCust.Select(); DataTable distinctTable = dt.DefaultView.ToTable(true, "cust_name"); distinctTable.DefaultView.Sort = "cust_name ASC"; cmbCust.DataSource = distinctTable; cmbCust.DisplayMember = "cust_name"; cmbCust.SelectedIndex = -1; }
private void loadData() { DataTable dt = dalCust.Select(); dgvCust.Rows.Clear(); foreach (DataRow item in dt.Rows) { int n = dgvCust.Rows.Add(); dgvCust.Rows[n].Cells["dgvcCustID"].Value = item["cust_id"].ToString(); dgvCust.Rows[n].Cells["dgvcCustName"].Value = item["cust_name"].ToString(); } }
private void cmbFrom_SelectedIndexChanged(object sender, EventArgs e) { //errorProvider4.Clear(); if (cmbFrom.Text.Equals("Customer")) { DataTable dt = dalCust.Select(); loadLocationData(dt, cmbSubFrom, "cust_name"); } else { cmbSubFrom.DataSource = null; } }