本文整理汇总了C#中CloudSalesDAL.ProductsDAL.GetAttrList方法的典型用法代码示例。如果您正苦于以下问题:C# ProductsDAL.GetAttrList方法的具体用法?C# ProductsDAL.GetAttrList怎么用?C# ProductsDAL.GetAttrList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CloudSalesDAL.ProductsDAL
的用法示例。
在下文中一共展示了ProductsDAL.GetAttrList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetAttrList
public List<ProductAttr> GetAttrList(string categoryid, string clientid)
{
var dal = new ProductsDAL();
DataTable dt = dal.GetAttrList(categoryid, clientid);
List<ProductAttr> list = new List<ProductAttr>();
foreach (DataRow dr in dt.Rows)
{
ProductAttr model = new ProductAttr();
model.FillData(dr);
list.Add(model);
}
return list;
}
示例2: GetAttrList
/// <summary>
/// 获取属性列表(包括属性值列表)
/// </summary>
/// <param name="keyWords"></param>
/// <param name="pageSize"></param>
/// <param name="pageIndex"></param>
/// <param name="totalCount"></param>
/// <param name="pageCount"></param>
/// <returns></returns>
public List<ProductAttr> GetAttrList(string categoryid, string keyWords, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string clientid)
{
var dal = new ProductsDAL();
DataSet ds = dal.GetAttrList(categoryid, keyWords, pageSize, pageIndex, ref totalCount, ref pageCount, clientid);
List<ProductAttr> list = new List<ProductAttr>();
if (ds.Tables.Contains("Attrs"))
{
foreach (DataRow dr in ds.Tables["Attrs"].Rows)
{
ProductAttr model = new ProductAttr();
model.FillData(dr);
List<AttrValue> valueList = new List<AttrValue>();
StringBuilder build = new StringBuilder();
foreach (DataRow drValue in ds.Tables["Values"].Select("AttrID='" + model.AttrID + "'"))
{
AttrValue valueModel = new AttrValue();
valueModel.FillData(drValue);
valueList.Add(valueModel);
build.Append(valueModel.ValueName + ",");
}
model.AttrValues = valueList;
if (string.IsNullOrEmpty(build.ToString()))
{
model.ValuesStr = "暂无属性值(单击添加)";
}
else
{
if (build.ToString().Length > 50)
{
if (build.ToString().Substring(49, 1).ToString() != ",")
{
model.ValuesStr = build.ToString() + "...";
}
else
{
model.ValuesStr = build.ToString().Substring(0, 49) + " ...";
}
}
else
{
model.ValuesStr = build.ToString().Substring(0, build.ToString().Length - 1);
}
}
list.Add(model);
}
}
return list;
}
示例3: GetAttrList
public List<ProductAttr> GetAttrList(string categoryid, string keyWords, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string agentid, string clientid)
{
var dal = new ProductsDAL();
DataSet ds = dal.GetAttrList(categoryid, keyWords, pageSize, pageIndex, ref totalCount, ref pageCount, clientid);
List<ProductAttr> list = new List<ProductAttr>();
foreach (DataRow dr in ds.Tables["Attrs"].Rows)
{
ProductAttr model = new ProductAttr();
model.FillData(dr);
model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, agentid);
list.Add(model);
}
return list;
}