Пример #1
0
 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"));
 }
Пример #2
0
 public static int Insert(Zippy.Data.IDalProvider db, Z01ProductInCategory entity)
 {
     int rtn = db.Insert(entity);
     return rtn;
 }
Пример #3
0
 /// <summary>
 /// 表示 [产品] 对应的实体
 /// </summary>
 public static Z01Product GetProductIDEntity(Zippy.Data.IDalProvider db, Z01ProductInCategory entity)
 {
     return db.FindUnique<Z01Product>("ProductID=@ProductID", db.CreateParameter("ProductID", entity.ProductID));
 }
Пример #4
0
 public static int Update(Zippy.Data.IDalProvider db, Z01ProductInCategory entity)
 {
     return db.Update(entity);
 }
Пример #5
0
 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");
 }
Пример #6
0
        public static Z01ProductInCategory Create(Zippy.Data.IDalProvider db, Int64 _PICID)
        {
            Z01ProductInCategory rtn = db.FindUnique <Z01ProductInCategory>(_PICID);

            return(rtn);
        }
Пример #7
0
 /// <summary>
 /// 表示 [分类] 对应的实体
 /// </summary>
 public static Z01ProductCategory GetCategoryIDEntity(Zippy.Data.IDalProvider db, Z01ProductInCategory entity)
 {
     return(db.FindUnique <Z01ProductCategory>("CategoryID=@CategoryID", db.CreateParameter("CategoryID", entity.CategoryID)));
 }
Пример #8
0
 public static int Update(Zippy.Data.IDalProvider db, Z01ProductInCategory entity)
 {
     return(db.Update(entity));
 }
Пример #9
0
        public static int Insert(Zippy.Data.IDalProvider db, Z01ProductInCategory entity)
        {
            int rtn = db.Insert(entity);

            return(rtn);
        }