protected void Page_Load(object sender, EventArgs e) { string ProName = Request.QueryString["ProName"].ToString(); //string ProName = "胃必治"; Product_Manager Product_MG = new Product_DAO(); Producer_Manager Producer_MG = new Producer_DAO(); List <string> ListName = new List <string>(); String RT = ""; try { List <Product> Products = Product_MG.Select_ProductS(P => P.Pro_Name == ProName); foreach (Product Pro in Products) { Producer huhuh = Producer_MG.Select_Producer(Pro.Pro_ComID); ListName.Add(huhuh.Producer_Name.ToString()); } } catch (Exception E) { Response.Write("<Option Value=OP>此公司未找到,请先建立此公司的基本资料</Option>"); Response.Write(E.Message); } for (int i = 0; i < ListName.Count(); i++) { RT += "<Option Value=OP" + (i + 1) + ">" + ListName[i] + "</Option>"; } Response.Write(RT); Response.End(); }
public static string[] GetSpecificationList(string prefixText, int count, string contextKey) { Product_Manager Product_MG = new Product_DAO(); List <string> Select_Name = Product_MG.Select_ProductS( P => P.Pro_Name.Contains(prefixText), K => K.Pro_Name); List <string> Select_EasyPing = Product_MG.Select_ProductS( P => P.Pro_EasyPing.Contains(prefixText.ToLower()), K => K.Pro_Name ).ToList(); return(Select_Name.Union(Select_EasyPing).ToArray()); }