本文整理汇总了C#中CloudSalesBusiness.ProductsBusiness类的典型用法代码示例。如果您正苦于以下问题:C# ProductsBusiness类的具体用法?C# ProductsBusiness怎么用?C# ProductsBusiness使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProductsBusiness类属于CloudSalesBusiness命名空间,在下文中一共展示了ProductsBusiness类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProductDetail
public ActionResult ProductDetail(string id)
{
var model = new ProductsBusiness().GetProductByID(id);
ViewBag.Model = model;
ViewBag.BrandList = new ProductsBusiness().GetBrandList(CurrentUser.ClientID);
ViewBag.UnitList = new ProductsBusiness().GetClientUnits(CurrentUser.ClientID);
return View();
}
示例2: AddCategoryAttr
/// <summary>
/// 添加分类通用属性
/// </summary>
/// <param name="categoryid"></param>
/// <param name="attrid"></param>
/// <param name="type"></param>
/// <returns></returns>
public JsonResult AddCategoryAttr(string categoryid, string attrid, int type)
{
bool bl = new ProductsBusiness().AddCategoryAttr(categoryid, attrid, type, OperateIP, CurrentUser.UserID);
JsonDictionary.Add("Status", bl);
return new JsonResult
{
Data = JsonDictionary,
JsonRequestBehavior = JsonRequestBehavior.AllowGet
};
}
示例3: BrandDetail
/// <summary>
/// 品牌详情
/// </summary>
/// <returns></returns>
public ActionResult BrandDetail(string id)
{
if (string.IsNullOrEmpty(id))
{
return View("Brand");
}
Brand model = new ProductsBusiness().GetBrandByBrandID(id);
ViewBag.Item = model;
ViewBag.ID = id;
return View();
}
示例4: ChooseDetail
/// <summary>
/// 加入购物车详情页
/// </summary>
/// <param name="pid"></param>
/// <param name="did"></param>
/// <param name="type"></param>
/// <returns></returns>
public ActionResult ChooseDetail(string pid, string did, int type = 0, string guid = "")
{
if (string.IsNullOrEmpty(pid))
{
return Redirect("ProductList");
}
var model = new ProductsBusiness().GetProductByIDForDetails(pid);
if (model == null || string.IsNullOrEmpty(model.ProductID))
{
return Redirect("ProductList");
}
ViewBag.Model = model;
ViewBag.DetailID = did;
ViewBag.OrderType = type;
ViewBag.GUID = guid;
return View();
}
示例5: GetProductListForShopping
/// <summary>
/// 过滤产品
/// </summary>
/// <param name="filter"></param>
/// <returns></returns>
public JsonResult GetProductListForShopping(string filter)
{
JavaScriptSerializer serializer = new JavaScriptSerializer();
FilterProduct model = serializer.Deserialize<FilterProduct>(filter);
int totalCount = 0;
int pageCount = 0;
List<Products> list = new ProductsBusiness().GetFilterProducts(model.CategoryID, model.Attrs, model.BeginPrice, model.EndPrice, model.Keywords, model.OrderBy, model.IsAsc, 20, model.PageIndex, ref totalCount, ref pageCount, CurrentUser.ClientID);
JsonDictionary.Add("Items", list);
JsonDictionary.Add("TotalCount", totalCount);
JsonDictionary.Add("PageCount", pageCount);
return new JsonResult
{
Data = JsonDictionary,
JsonRequestBehavior = JsonRequestBehavior.AllowGet
};
}
示例6: ProductDetails
/// <summary>
/// 设置子产品
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public ActionResult ProductDetails(string id)
{
var model = new ProductsBusiness().GetProductByID(id);
ViewBag.Model = model;
return View();
}
示例7: ProductAdd
/// <summary>
/// 添加产品
/// </summary>
/// <returns></returns>
public ActionResult ProductAdd(string id)
{
if (string.IsNullOrEmpty(id))
{
var list = new ProductsBusiness().GetChildCategorysByID("", CurrentUser.ClientID);
ViewBag.Items = list;
return View("ChooseCategory");
}
ViewBag.Model = new ProductsBusiness().GetCategoryDetailByID(id);
ViewBag.BrandList = new ProductsBusiness().GetBrandList(CurrentUser.ClientID);
ViewBag.UnitList = new ProductsBusiness().GetClientUnits(CurrentUser.ClientID);
return View();
}
示例8: ExportFromProduct
public ActionResult ExportFromProduct(bool test = false, string model = "", string filleName = "产品", string filter = "")
{
JavaScriptSerializer serializer=new JavaScriptSerializer();
Dictionary<string, ExcelFormatter> dic = new Dictionary<string, ExcelFormatter>();
FilterProduct qicProduct = serializer.Deserialize<FilterProduct>(filter);
Dictionary<string, ExcelModel> listColumn = new Dictionary<string, ExcelModel>();
if (string.IsNullOrEmpty(filter))
{
listColumn = GetColumnForJson("product", ref dic, model, test ? "testexport" : "export", CurrentUser.ClientID);
}
else
{
qicProduct = serializer.Deserialize<FilterProduct>(filter);
listColumn = GetColumnForJson("product", ref dic, !string.IsNullOrEmpty(model) ? model : "Item", test ? "testexport" : "export", CurrentUser.ClientID);
}
string ipPath = "";
var excelWriter = new ExcelWriter();
foreach (var key in listColumn)
{
excelWriter.Map(key.Key, key.Value.Title);
}
byte[] buffer;
DataTable dt = new DataTable();
//模版导出
if (test)
{
DataRow dr = dt.NewRow();
foreach (var key in listColumn)
{
DataColumn dc1 = new DataColumn(key.Key, Type.GetType("System.String"));
dt.Columns.Add(dc1);
dr[key.Key] = key.Value.DefaultText;
}
dt.Rows.Add(dr);
}
else
{
int totalCount = 0;
int pageCount = 0;
ipPath= Server.MapPath("~");
dt = new ProductsBusiness().GetProductListDataTable(qicProduct.CategoryID, qicProduct.BeginPrice, qicProduct.EndPrice, qicProduct.Keywords, qicProduct.OrderBy, qicProduct.IsAsc, PageSize, qicProduct.PageIndex, ref totalCount, ref pageCount, CurrentUser.ClientID);
}
buffer = excelWriter.Write(dt, dic, ipPath);
var fileName = filleName + (test ? "导入模版" : "")+DateTime.Now.ToString("yyyyMMdd");
if (!Request.ServerVariables["http_user_agent"].ToLower().Contains("firefox"))
fileName = HttpUtility.UrlEncode(fileName);
this.Response.AddHeader("content-disposition", "attachment;filename=" + fileName + ".xlsx");
return File(buffer, "application/ms-excel");
}
示例9: UpdateProductStatus
/// <summary>
/// 编辑产品状态
/// </summary>
/// <param name="productid"></param>
/// <param name="status"></param>
/// <returns></returns>
public JsonResult UpdateProductStatus(string productid, int status)
{
bool bl = new ProductsBusiness().UpdateProductStatus(productid, (EnumStatus)status, OperateIP, CurrentUser.UserID);
JsonDictionary.Add("Status", bl);
return new JsonResult
{
Data = JsonDictionary,
JsonRequestBehavior = JsonRequestBehavior.AllowGet
};
}
示例10: ChooseDetail
/// <summary>
/// 加入购物车详情页
/// </summary>
/// <param name="pid"></param>
/// <param name="did"></param>
/// <param name="type"></param>
/// <returns></returns>
public ActionResult ChooseDetail(string pid, string did, int type = 0)
{
var model = new ProductsBusiness().GetProductByIDForDetails(pid);
ViewBag.Model = model;
ViewBag.DetailID = did;
ViewBag.OrderType = type;
return View();
}
示例11: SavaProduct
/// <summary>
/// 保存产品
/// </summary>
/// <param name="product"></param>
/// <returns></returns>
public JsonResult SavaProduct(string product)
{
JavaScriptSerializer serializer = new JavaScriptSerializer();
Products model = serializer.Deserialize<Products>(product);
if (!string.IsNullOrEmpty(model.AttrList))
{
model.AttrList = model.AttrList.Substring(0, model.AttrList.Length - 1);
}
if (!string.IsNullOrEmpty(model.ValueList))
{
model.ValueList = model.ValueList.Substring(0, model.ValueList.Length - 1);
}
if (!string.IsNullOrEmpty(model.AttrValueList))
{
model.AttrValueList = model.AttrValueList.Substring(0, model.AttrValueList.Length - 1);
}
string id = "";
if (string.IsNullOrEmpty(model.ProductID))
{
id = new ProductsBusiness().AddProduct(model.ProductCode, model.ProductName, model.GeneralName, model.IsCombineProduct.Value == 1, model.BrandID, model.BigUnitID, model.SmallUnitID,
model.BigSmallMultiple.Value, model.CategoryID, model.Status.Value, model.AttrList, model.ValueList, model.AttrValueList,
model.CommonPrice.Value, model.Price, model.Weight.Value, model.IsNew.Value == 1, model.IsRecommend.Value == 1, model.IsAllow, model.IsAutoSend, model.EffectiveDays.Value,
model.DiscountValue.Value, model.ProductImage, model.ShapeCode, model.Description, model.ProductDetails, CurrentUser.UserID, CurrentUser.ClientID);
}
else
{
bool bl = new ProductsBusiness().UpdateProduct(model.ProductID,model.ProductCode, model.ProductName, model.GeneralName, model.IsCombineProduct.Value == 1, model.BrandID, model.BigUnitID, model.SmallUnitID,
model.BigSmallMultiple.Value, model.Status.Value, model.CategoryID, model.AttrList, model.ValueList, model.AttrValueList,
model.CommonPrice.Value, model.Price, model.Weight.Value, model.IsNew.Value == 1, model.IsRecommend.Value == 1, model.IsAllow, model.IsAutoSend, model.EffectiveDays.Value,
model.DiscountValue.Value, model.ProductImage, model.ShapeCode, model.Description, CurrentUser.UserID, CurrentUser.ClientID);
if (bl)
{
id = model.ProductID;
}
}
JsonDictionary.Add("ID", id);
return new JsonResult
{
Data = JsonDictionary,
JsonRequestBehavior = JsonRequestBehavior.AllowGet
};
}
示例12: GetBrandList
public JsonResult GetBrandList(string keyWords, int pageSize, int pageIndex, int totalCount)
{
int pageCount = 0;
List<Brand> list = new ProductsBusiness().GetBrandList(keyWords, pageSize, pageIndex, ref totalCount, ref pageCount, CurrentUser.ClientID);
JsonDictionary.Add("Items", list);
JsonDictionary.Add("TotalCount", totalCount);
JsonDictionary.Add("PageCount", pageCount);
return new JsonResult
{
Data = JsonDictionary,
JsonRequestBehavior = JsonRequestBehavior.AllowGet
};
}
示例13: GetBrandDetail
public JsonResult GetBrandDetail(string id)
{
Brand model = new ProductsBusiness().GetBrandByBrandID(id);
JsonDictionary.Add("model", model);
return new JsonResult
{
Data = JsonDictionary,
JsonRequestBehavior = JsonRequestBehavior.AllowGet
};
}
示例14: GetAttrsByCategoryID
/// <summary>
/// 获取所有属性
/// </summary>
/// <returns></returns>
public JsonResult GetAttrsByCategoryID(string categoryid)
{
List<ProductAttr> list = new List<ProductAttr>();
list = new ProductsBusiness().GetAttrList(categoryid, CurrentUser.ClientID);
JsonDictionary.Add("Items", list);
return new JsonResult
{
Data = JsonDictionary,
JsonRequestBehavior = JsonRequestBehavior.AllowGet
};
}
示例15: GetAttrList
/// <summary>
/// 获取属性列表
/// </summary>
/// <param name="index"></param>
/// <param name="keyWorks"></param>
/// <returns></returns>
public JsonResult GetAttrList(int index, string keyWorks)
{
List<ProductAttr> list = new List<ProductAttr>();
int totalCount = 0, pageCount = 0;
list = new ProductsBusiness().GetAttrList("", keyWorks, PageSize, index, ref totalCount, ref pageCount, CurrentUser.AgentID, CurrentUser.ClientID);
JsonDictionary.Add("Items", list);
JsonDictionary.Add("TotalCount", totalCount);
JsonDictionary.Add("PageCount", pageCount);
return new JsonResult
{
Data = JsonDictionary,
JsonRequestBehavior = JsonRequestBehavior.AllowGet
};
}