private void DataBindDDl() { try { DataSet ds = PH_RateCalc.PH_RateCalc_DateWeekSelAll(AppCode.strConnDB); ddlDateWeek.DataTextField = "dateweek"; ddlDateWeek.DataValueField = "dateweek"; ddlDateWeek.DataSource = ds; ddlDateWeek.DataBind(); /*DataTable dt = PH_UserVendor.PH_UserVendor_SelectAll(AppCode.strConnDB); * ddlVendorCode.DataTextField = "vendor_code"; * ddlVendorCode.DataValueField = "vendor_code"; * ddlVendorCode.DataSource = dt; * ddlVendorCode.DataBind();*/ DataTable dt = PH_HaulierInfo.PH_Haulier_SelAll(AppCode.strConnDB); ddlHaluier.DataTextField = "haulier_abbr"; ddlHaluier.DataValueField = "haulier_abbr"; ddlHaluier.DataSource = dt; ddlHaluier.DataBind(); } catch (Exception ex) { lblErr.Text = ex.Message; PH_ExceptionManager.WriteError(ex.Message); } }
public string[] GetHaulierCode(string prefixText) { DataTable dt = PH_HaulierInfo.PH_Haulier_SelAll(AppCode.strConnDB); List <string> items = new List <string>(dt.Rows.Count); for (int i = 0; i < dt.Rows.Count; i++) { string strName = dt.Rows[i]["haulier_taxid"].ToString() + "-" + dt.Rows[i]["haulier_name_en"].ToString() + "-" + dt.Rows[i]["haulier_name_th"].ToString(); items.Add(strName); } return(items.ToArray()); }