本文整理汇总了C#中CloudSalesDAL.ProductsDAL类的典型用法代码示例。如果您正苦于以下问题:C# ProductsDAL类的具体用法?C# ProductsDAL怎么用?C# ProductsDAL使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProductsDAL类属于CloudSalesDAL命名空间,在下文中一共展示了ProductsDAL类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddAttrValue
/// <summary>
/// 添加属性值
/// </summary>
/// <param name="valueName">值</param>
/// <param name="attrID">属性ID</param>
/// <returns></returns>
public string AddAttrValue(string valueName, string attrID, string operateid, string clientid)
{
var valueID = Guid.NewGuid().ToString();
var dal = new ProductsDAL();
if (dal.AddAttrValue(valueID, valueName, attrID, operateid, clientid))
{
return valueID.ToString();
}
return string.Empty;
}
示例2: GetBrandList
public List<Brand> GetBrandList(string keyWords, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string clientID)
{
var dal = new ProductsDAL();
DataSet ds = dal.GetBrandList(keyWords, pageSize, pageIndex, ref totalCount, ref pageCount, clientID);
List<Brand> list = new List<Brand>();
foreach (DataRow dr in ds.Tables[0].Rows)
{
Brand model = new Brand();
model.FillData(dr);
model.City = CommonBusiness.Citys.Where(c => c.CityCode == model.CityCode).FirstOrDefault();
list.Add(model);
}
return list;
}
示例3: AddAttrValue
public string AddAttrValue(string valueName, string attrID, string operateid, string clientid)
{
var valueID = Guid.NewGuid().ToString().ToLower();
var dal = new ProductsDAL();
if (dal.AddAttrValue(valueID, valueName, attrID, operateid, clientid))
{
var model = GetProductAttrByID(attrID, clientid);
model.AttrValues.Add(new AttrValue()
{
ValueID = valueID,
ValueName = valueName,
Status = 1,
AttrID = attrID,
ClientID = clientid,
CreateTime = DateTime.Now
});
return valueID;
}
return string.Empty;
}
示例4: InsertProduct
public static string InsertProduct(List<Products> list)
{
string mes ="";
list.ForEach(x =>
{
string result = "";
string pid
= new ProductsDAL().InsertProductExcel(x.ProductCode, x.ProductName, x.GeneralName, (x.IsCombineProduct == 1), x.BrandID,
x.BigUnitID,x.UnitID,x.BigSmallMultiple.Value,x.CategoryID,x.Status.Value,x.AttrList,x.ValueList,x.AttrValueList,
x.CommonPrice.Value,x.Price,x.Weight.Value,(x.IsNew==1),(x.IsRecommend==1),x.IsAllow,x.IsAutoSend,x.EffectiveDays.Value,
x.DiscountValue.Value, x.WarnCount, x.ProductImage, x.ShapeCode, x.Description, x.CreateUserID, x.ClientID, ref result);
if (string.IsNullOrEmpty(result))
{
LogBusiness.AddActionLog(CloudSalesEnum.EnumSystemType.Client,
CloudSalesEnum.EnumLogObjectType.Product, EnumLogType.Create, "", x.CreateUserID, "", x.ClientID);
}
else
{
mes += result+",";
}
});
return string.IsNullOrEmpty(mes) ? "" : mes;
}
示例5: UpdateAttrValueStatus
public bool UpdateAttrValueStatus(string valueid, EnumStatus status, string operateIP, string operateID)
{
var dal = new ProductsDAL();
return dal.UpdateAttrValueStatus(valueid, (int)status);
}
示例6: GetAttrs
public List<ProductAttr> GetAttrs(string clientid)
{
if (ClientAttrs.ContainsKey(clientid))
{
return ClientAttrs[clientid];
}
List<ProductAttr> list = new List<ProductAttr>();
DataSet ds = new ProductsDAL().GetAttrs(clientid);
foreach (DataRow dr in ds.Tables["Attrs"].Rows)
{
ProductAttr model = new ProductAttr();
model.FillData(dr);
model.AttrValues = new List<AttrValue>();
foreach (DataRow item in ds.Tables["Values"].Rows)
{
AttrValue attrValue = new AttrValue();
attrValue.FillData(item);
model.AttrValues.Add(attrValue);
}
}
ClientAttrs.Add(clientid, list);
return list;
}
示例7: UpdateAttrValue
public bool UpdateAttrValue(string valueID, string attrid, string valueName, string operateIP, string operateID, string clientid)
{
var dal = new ProductsDAL();
var bl = dal.UpdateAttrValue(valueID, valueName);
if (bl)
{
var model = GetProductAttrByID(attrid, clientid);
var value = model.AttrValues.Where(m => m.ValueID == valueID).FirstOrDefault();
value.ValueName = valueName;
}
return bl;
}
示例8: UpdateProductDetails
public bool UpdateProductDetails(string detailid, string productid, string productCode, string shapeCode, decimal bigPrice, string attrlist, string valuelist, string attrvaluelist, decimal price, decimal weight, string description, string productImg, string operateid, string clientid)
{
lock (SingleLock)
{
if (!string.IsNullOrEmpty(productImg) && productImg.IndexOf(TempPath) >= 0)
{
if (productImg.IndexOf("?") > 0)
{
productImg = productImg.Substring(0, productImg.IndexOf("?"));
}
FileInfo file = new FileInfo(HttpContext.Current.Server.MapPath(productImg));
productImg = FILEPATH + file.Name;
if (file.Exists)
{
file.MoveTo(HttpContext.Current.Server.MapPath(productImg));
}
}
var dal = new ProductsDAL();
return dal.UpdateProductDetails(detailid, productid, productCode, shapeCode, bigPrice, attrlist, valuelist, attrvaluelist, price, weight, description, productImg);
}
}
示例9: UpdateUnitStatus
public bool UpdateUnitStatus(string unitID, EnumStatus status, string operateIP, string operateID)
{
var dal = new ProductsDAL();
return dal.UpdateUnitStatus(unitID, (int)status);
}
示例10: UpdateCategoryAttrStatus
public bool UpdateCategoryAttrStatus(string categoryid, string attrid, EnumStatus status, int type, string operateIP, string operateID)
{
var dal = new ProductsDAL();
return dal.UpdateCategoryAttrStatus(categoryid, attrid, (int)status, type);
}
示例11: UpdateProductAttr
public bool UpdateProductAttr(string attrID, string attrName, string description, string operateIP, string operateID,string clientid)
{
var dal = new ProductsDAL();
var bl = dal.UpdateProductAttr(attrID, attrName, description);
if (bl)
{
var model = GetProductAttrByID(attrID, clientid);
model.AttrName = attrName;
model.Description = description;
}
return bl;
}
示例12: GetClientUnits
public List<ProductUnit> GetClientUnits(string clientid)
{
var dal = new ProductsDAL();
DataTable dt = dal.GetClientUnits(clientid);
List<ProductUnit> list = new List<ProductUnit>();
foreach (DataRow dr in dt.Rows)
{
ProductUnit model = new ProductUnit();
model.FillData(dr);
list.Add(model);
}
return list;
}
示例13: GetFilterProducts
public List<Products> GetFilterProducts(string categoryid, List<FilterAttr> Attrs, int doctype, string beginprice, string endprice, string keyWords, string orderby, bool isasc, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string clientID)
{
var dal = new ProductsDAL();
StringBuilder attrbuild = new StringBuilder();
StringBuilder salebuild = new StringBuilder();
foreach (var attr in Attrs)
{
if (attr.Type == EnumAttrType.Parameter)
{
attrbuild.Append(" and p.ValueList like '%" + attr.ValueID + "%'");
}
else if (attr.Type == EnumAttrType.Specification)
{
salebuild.Append(" and AttrValue like '%" + attr.ValueID + "%'");
}
}
DataSet ds = dal.GetFilterProducts(categoryid, attrbuild.ToString(), salebuild.ToString(), doctype, beginprice, endprice, keyWords, orderby, isasc ? 1 : 0, pageSize, pageIndex, ref totalCount, ref pageCount, clientID);
List<Products> list = new List<Products>();
foreach (DataRow dr in ds.Tables[0].Rows)
{
Products model = new Products();
model.FillData(dr);
list.Add(model);
}
return list;
}
示例14: GetCategoryDetailByID
/// <summary>
/// 获取产品分类详情(包括属性和值)
/// </summary>
public Category GetCategoryDetailByID(string categoryid)
{
var dal = new ProductsDAL();
DataSet ds = dal.GetCategoryDetailByID(categoryid);
Category model = new Category();
if (ds.Tables.Contains("Category") && ds.Tables["Category"].Rows.Count > 0)
{
model.FillData(ds.Tables["Category"].Rows[0]);
List<ProductAttr> salelist = new List<ProductAttr>();
List<ProductAttr> attrlist = new List<ProductAttr>();
foreach (DataRow attr in ds.Tables["Attrs"].Rows)
{
ProductAttr modelattr = new ProductAttr();
modelattr.FillData(attr);
if (modelattr.Type==1)
{
attrlist.Add(modelattr);
}
else if (modelattr.Type == 2)
{
salelist.Add(modelattr);
}
modelattr.AttrValues = new List<AttrValue>();
foreach (DataRow value in ds.Tables["Values"].Select("AttrID='" + modelattr.AttrID + "'"))
{
AttrValue valuemodel = new AttrValue();
valuemodel.FillData(value);
modelattr.AttrValues.Add(valuemodel);
}
}
model.SaleAttrs = salelist;
model.AttrLists = attrlist;
}
return model;
}
示例15: GetChildCategorysByID
public List<Category> GetChildCategorysByID(string categoryid, string clientid)
{
var dal = new ProductsDAL();
DataTable dt = dal.GetChildCategorysByID(categoryid, clientid);
List<Category> list = new List<Category>();
foreach (DataRow dr in dt.Rows)
{
Category model = new Category();
model.FillData(dr);
list.Add(model);
}
return list;
}