private DataTable BuildEmptyTable() { List <string> wpList = new List <string>(); DataTable oTable = new DataTable(); oTable.Columns.Add("Description", typeof(string)); string[] qtyList = new string[] { "BFQty", "CDQty", "FEPQTY", "RECQTY", "INVQTY", "POQTY", "SOQTY", "REJQTY", "EPQTY" }; RT2020.DAL.WorkplaceCollection wList = RT2020.DAL.Workplace.LoadCollection(new string[] { "WorkplaceCode" }, true); foreach (RT2020.DAL.Workplace w in wList) { oTable.Columns.Add(w.WorkplaceCode, typeof(decimal)); wpList.Add(w.WorkplaceCode); } for (int i = 0; i < qtyList.Length; i++) { DataRow row = oTable.NewRow(); row["Description"] = qtyList[i]; foreach (string wp in wpList) { row[wp] = 0; } oTable.Rows.Add(row); } return(oTable); }
private void FillWorkplaceList() { cboWorkplace.Items.Clear(); RT2020.DAL.WorkplaceCollection wpList = RT2020.DAL.Workplace.LoadCollection(new String[] { "WorkplaceCode" }, true); cboWorkplace.DataSource = wpList; cboWorkplace.DisplayMember = "WorkplaceCode"; cboWorkplace.ValueMember = "WorkplaceId"; cboWorkplace.SelectedIndex = 0; }