/// <summary> /// 沮坝珇ID莉坝珇獺 /// </summary> public Model.article_attribute_value GetModelID(int id) { #region 琩高獺 StringBuilder strSql2 = new StringBuilder(); strSql2.Append("select * from " + databaseprefix + "article_attribute_value "); strSql2.Append(" where article_id=@id "); SqlParameter[] parameters2 = { new SqlParameter("@id", SqlDbType.Int, 8) }; parameters2[0].Value = id; Model.article_attribute_value modelt = new Model.article_attribute_value(); DataSet ds2 = DbHelperSQL.Query(strSql2.ToString(), parameters2); if (ds2.Tables[0].Rows.Count > 0) { int i = ds2.Tables[0].Rows.Count; for (int n = 0; n < i; n++) { if (ds2.Tables[0].Rows[n]["article_id"] != null && ds2.Tables[0].Rows[n]["article_id"].ToString() != "") { modelt.Id = int.Parse(ds2.Tables[0].Rows[n]["article_id"].ToString()); } if (ds2.Tables[0].Rows[n]["sub_title"] != null && ds2.Tables[0].Rows[n]["sub_title"].ToString() != "") { modelt.Title = ds2.Tables[0].Rows[n]["sub_title"].ToString(); } if (ds2.Tables[0].Rows[n]["sell_price"] != null && ds2.Tables[0].Rows[n]["sell_price"].ToString() != "") { modelt.Price = decimal.Parse(ds2.Tables[0].Rows[n]["sell_price"].ToString()); } if (ds2.Tables[0].Rows[n]["stock_quantity"] != null && ds2.Tables[0].Rows[n]["stock_quantity"].ToString() != "") { modelt.Num = int.Parse(ds2.Tables[0].Rows[n]["stock_quantity"].ToString()); } } return(modelt); } #endregion else { return(null); } }
private void ShowInfo(int _id) { BLL.orders bll = new BLL.orders(); model = bll.GetModelID(_id); }