本文整理汇总了C#中BLL.article.GetGroupPrice方法的典型用法代码示例。如果您正苦于以下问题:C# BLL.article.GetGroupPrice方法的具体用法?C# BLL.article.GetGroupPrice怎么用?C# BLL.article.GetGroupPrice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BLL.article
的用法示例。
在下文中一共展示了BLL.article.GetGroupPrice方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: get_good_info
private void get_good_info(HttpContext context)
{
int good_id = DTRequest.GetQueryInt("good_id");
BLL.article bll_article = new BLL.article();
Model.article model_article = bll_article.GetModel(good_id);
if (model_article == null)
{
context.Response.Write("NotFind");
return;
}
string str_header = "";
string str_body = "";
//会员组
BLL.user_groups bll_groups = new BLL.user_groups();
DataTable dt_groups = bll_groups.GetList(0, "", "grade asc,id desc").Tables[0];
string str_groups_header = "";
string str_groups_body = "";
BLL.standard_price bll_standard_price = new BLL.standard_price();
DataTable dt_standard_price = bll_standard_price.GetList("good_id=" + good_id).Tables[0];
if (dt_standard_price != null && dt_standard_price.Rows.Count > 0)
{
//有规格价格
foreach (DataRow dr in dt_standard_price.Rows)
{
decimal sell_price = Convert.ToDecimal(model_article.fields["sell_price"]);
string str_standard = "";
string str_standard_value = "";
sell_price = Convert.ToDecimal(dr["sell_price"]);
if (dr["standards"] != null && !string.IsNullOrEmpty(dr["standards"].ToString()))
{
string[] standard_arr = dr["standards"].ToString().Split(',');//规格名
string[] standard_value_arr = dr["standard_values"].ToString().Split(',');//规格值
string[] standard_value_id_arr = dr["standard_value_ids"].ToString().Split(',');//规格值ID
for (int i = 0; i < standard_arr.Length; i++)
{
str_standard += "<td style='font-weight:bold;color:#33B5E5;padding-right:10px;'>" + standard_arr[i] + "</td>";
if (i < standard_value_arr.Length)
{
str_standard_value += "<td style='padding-right: 20px;'>" + standard_value_arr[i] + "</td>";
foreach (DataRow dr_group in dt_groups.Rows)
{
BLL.standard_group_price bll_standard_group_price = new BLL.standard_group_price();
DataTable dt_standard_group_price = bll_standard_group_price.GetList("good_id=" + model_article.id + " and group_id=" + Convert.ToInt32(dr_group["id"]) + " and standard_price_id=" + standard_value_id_arr[i]).Tables[0];
if (dt_standard_group_price != null && dt_standard_group_price.Rows.Count > 0)
{
str_groups_body += "<td style='padding-right: 20px;'>" + Convert.ToDecimal(dt_standard_group_price.Rows[0]["group_price"]) + "</td>";
}
}
}
else
{
str_standard_value += "<td style='padding-right: 20px;'> </td>";
}
}
}
str_header = "<table>"
+ "<thead><tr>"
+ "<td style='font-weight:bold;color:#33B5E5;padding-right:10px;'>名称</td>"
+ "<td style='font-weight:bold;color:#33B5E5;padding-right:10px;'>售价</td>"
+ str_standard
+ str_groups_header
+ "<td style='font-weight:bold;color:#33B5E5;padding-right:10px;'>数量</td>"
+ "<td style='font-weight:bold;color:#33B5E5;padding-right:10px;'>操作</td>"
+ "</tr></thead>";
str_body += "<tbody><tr>"
+ "<td style='padding-right: 20px;'>" + model_article.title + "</td>"
+ "<td style='padding-right: 20px;'>" + sell_price + "</td>"
+ str_groups_body
+ str_standard_value
+ "<td style='padding-right: 20px;'><input type='text' class='input small' id='quantity_" + model_article.id + "_" + dr["id"].ToString() + "'></td>"
+ "<td style='padding-right: 20px;'><a href='javascript:;' onclick='into_meal(" + model_article.id + "," + dr["id"].ToString() + ",this)'>选择</a></td>"
+ "</tr></tbody>"
+ "<table>";
}
}
else
{
//无规格价格
if (dt_groups != null && dt_groups.Rows.Count > 0)
{
for (int i = 0; i < dt_groups.Rows.Count; i++)
{
str_groups_header += "<td style='font-weight:bold;color:#33B5E5;padding-right:10px;'>" + dt_groups.Rows[i]["title"].ToString() + "</td>";
str_groups_body += "<td style='font-weight:bold;color:#33B5E5;padding-right:10px;'>" + bll_article.GetGroupPrice(model_article.id, Convert.ToInt32(dt_groups.Rows[i]["id"])) + "</td>";
}
}
str_header = "<table>"
+ "<thead><tr>"
+ "<td style='font-weight:bold;color:#33B5E5;padding-right:10px;'>名称</td>"
+ "<td style='font-weight:bold;color:#33B5E5;padding-right:10px;'>售价</td>"
+ str_groups_header
+ "<td style='font-weight:bold;color:#33B5E5;padding-right:10px;'>数量</td>"
+ "<td style='font-weight:bold;color:#33B5E5;padding-right:10px;'>操作</td>"
//.........这里部分代码省略.........