public bool TableData(string table, string vItem, string dItem, int aLevel) { if (aLevel > 1111) { aLevel = 1111; } int[] lvlArray = new int[4]; int[] paraArray = new int[] { 1000, 100, 10, 1 }; int rCount = 0; for (int i = 0; i < lvlArray.Length; i++) { lvlArray[i] = aLevel / paraArray[i]; aLevel = aLevel % paraArray[i]; rCount += lvlArray[i]; } if (rCount == 0) { emptyComboBox(); return(Basic()); } valItem = new string[rCount]; dispItem = new string[rCount]; SqlHandling sh = new SqlHandling(table); DataTable dt = sh.SpecifiedData(vItem, dItem); if (dt == null) { emptyComboBox(); return(Basic()); } DataRow dr; int idx = 0; for (int i = 0; i < dt.Rows.Count; i++) { if (lvlArray[i] == 1) { dr = dt.Rows[i]; valItem[idx] = Convert.ToString(dr[vItem]); dispItem[idx] = Convert.ToString(dr[dItem]); idx++; } } return(Basic()); }
private bool commonDataCorePosSelect(string sqlStr, int selectPos) { SqlHandling sh = new SqlHandling("M_Common"); DataTable dt = sh.SpecifiedData("ComSymbol", "ComData", sqlStr); if (dt == null) { emptyComboBox(); return(Basic(selectPos)); } if (SetValueDt(dt) == false) { return(false); } return(Basic(1)); }
public bool TableData(string table, string vItem, string dItem, string sItem, string sCode, string wParam) { SqlHandling sh = new SqlHandling(table); DataTable dt = sh.SpecifiedData(vItem, dItem, wParam); if (dt == null) { emptyComboBox(); return(Basic()); } if (SetValueDt(dt, vItem, dItem, sItem, sCode) == false) { return(false); } return(Basic()); }
public bool TableData(string table, string vItem, string dItem) { SqlHandling sh = new SqlHandling(table); DataTable dt = sh.SpecifiedData(vItem, dItem); if (dt == null) { emptyComboBox(); return(Basic()); } DataRow dr; valItem = new string[dt.Rows.Count]; dispItem = new string[dt.Rows.Count]; for (int i = 0; i < dt.Rows.Count; i++) { dr = dt.Rows[i]; valItem[i] = Convert.ToString(dr[vItem]); dispItem[i] = Convert.ToString(dr[dItem]); } return(Basic()); }