public ActionResult SetCategory(long id, int categoryID, bool isAdd) { if (isAdd) { Z01ProductInCategory pic = new Z01ProductInCategory(); pic.ProductID = id; pic.CategoryID = categoryID; pic.TenantID = _tenant.TenantID; pic.Creator = _user.UserID; db.Insert(pic); } else { db.Delete <Z01ProductInCategory>("ProductID=@ProductID and CategoryID=@CategoryID and TenantID=@TenantID", db.CreateParameter("ProductID", id), db.CreateParameter("CategoryID", categoryID), db.CreateParameter("TenantID", _tenant.TenantID)); } return(Content("1")); }
public static int Insert(Zippy.Data.IDalProvider db, Z01ProductInCategory entity) { int rtn = db.Insert(entity); return rtn; }
/// <summary> /// 表示 [产品] 对应的实体 /// </summary> public static Z01Product GetProductIDEntity(Zippy.Data.IDalProvider db, Z01ProductInCategory entity) { return db.FindUnique<Z01Product>("ProductID=@ProductID", db.CreateParameter("ProductID", entity.ProductID)); }
public static int Update(Zippy.Data.IDalProvider db, Z01ProductInCategory entity) { return db.Update(entity); }
public ActionResult SetCategory(long id, int categoryID, bool isAdd) { if (isAdd) { Z01ProductInCategory pic = new Z01ProductInCategory(); pic.ProductID = id; pic.CategoryID = categoryID; pic.TenantID = _tenant.TenantID; pic.Creator = _user.UserID; db.Insert(pic); } else { db.Delete<Z01ProductInCategory>("ProductID=@ProductID and CategoryID=@CategoryID and TenantID=@TenantID", db.CreateParameter("ProductID", id), db.CreateParameter("CategoryID", categoryID), db.CreateParameter("TenantID", _tenant.TenantID)); } return Content("1"); }
public static Z01ProductInCategory Create(Zippy.Data.IDalProvider db, Int64 _PICID) { Z01ProductInCategory rtn = db.FindUnique <Z01ProductInCategory>(_PICID); return(rtn); }
/// <summary> /// 表示 [分类] 对应的实体 /// </summary> public static Z01ProductCategory GetCategoryIDEntity(Zippy.Data.IDalProvider db, Z01ProductInCategory entity) { return(db.FindUnique <Z01ProductCategory>("CategoryID=@CategoryID", db.CreateParameter("CategoryID", entity.CategoryID))); }
public static int Update(Zippy.Data.IDalProvider db, Z01ProductInCategory entity) { return(db.Update(entity)); }
public static int Insert(Zippy.Data.IDalProvider db, Z01ProductInCategory entity) { int rtn = db.Insert(entity); return(rtn); }