public static 商品分类 添加分类(string catName, long parentCatID = -1, bool fn = false, int Num = 999999999, bool normal = true, bool agreement = false, bool emergency = false) { 商品分类 pc = null; if (-1 != parentCatID) { pc = 查找分类(parentCatID); if (null == pc) return null; } var c = new 商品分类() { Id = -1, 序号 = Num, 分类名 = catName, 普通采购 = normal, 协议采购 = agreement, 应急采购 = emergency, }; if (fn) { c.分类性质 = 商品分类性质.专用物资; } else { c.分类性质 = 商品分类性质.通用物资; } if (null != pc) { c.父分类.商品分类ID = pc.Id; //c.父分类.商品分类名 = pc.分类名; } return Mongo.添加(c) ? c : null ; }
public ActionResult Part_OtherClass() { try { if (!string.IsNullOrWhiteSpace(Request.QueryString["id"])) { long id = long.Parse(Request.QueryString["id"]); var good = new 商品分类(); if (!string.IsNullOrEmpty(id.ToString())) { good = 商品分类管理.查找分类(id); return PartialView("Part_Product/Part_OtherClass", good); } else { return Content("<script>window.location='/商品陈列/';</script>"); } } else { return Content("<script>window.location='/商品陈列/';</script>"); } } catch { return Content("<script>window.location='/商品陈列/';</script>"); } }
public static bool 更新分类(商品分类 cat, bool updateModifiedTime = true) { return Mongo.更新(cat, updateModifiedTime); }