Exemplo n.º 1
0
        public APIReturn _Add([FromForm] uint?Member_id, [FromForm] uint?Product_id)
        {
            Member_productInfo item = new Member_productInfo();

            item.Member_id   = Member_id;
            item.Product_id  = Product_id;
            item.Create_time = DateTime.Now;
            item             = Member_product.Insert(item);
            return(APIReturn.成功.SetData("item", item.ToBson()));
        }
Exemplo n.º 2
0
 public Member_productInfo Save()
 {
     if (this.Member_id != null && this.Product_id != null)
     {
         Member_product.Update(this);
         return(this);
     }
     this.Create_time = DateTime.Now;
     return(Member_product.Insert(this));
 }
Exemplo n.º 3
0
        public ActionResult Edit([FromQuery] uint Member_id, [FromQuery] uint Product_id)
        {
            Member_productInfo item = Member_product.GetItem(Member_id, Product_id);

            if (item == null)
            {
                return(APIReturn.记录不存在_或者没有权限);
            }
            ViewBag.item = item;
            return(View());
        }
Exemplo n.º 4
0
        public APIReturn _Del([FromForm] string[] ids)
        {
            int affrows = 0;

            foreach (string id in ids)
            {
                string[] vs = id.Split(',');
                affrows += Member_product.Delete(uint.Parse(vs[0]), uint.Parse(vs[1]));
            }
            if (affrows > 0)
            {
                return(APIReturn.成功.SetMessage($"删除成功,影响行数:{affrows}"));
            }
            return(APIReturn.失败);
        }
Exemplo n.º 5
0
        public APIReturn _Edit([FromQuery] uint Member_id, [FromQuery] uint Product_id)
        {
            Member_productInfo item = Member_product.GetItem(Member_id, Product_id);

            if (item == null)
            {
                return(APIReturn.记录不存在_或者没有权限);
            }
            item.Create_time = DateTime.Now;
            int affrows = Member_product.Update(item);

            if (affrows > 0)
            {
                return(APIReturn.成功.SetMessage($"更新成功,影响行数:{affrows}"));
            }
            return(APIReturn.失败);
        }
Exemplo n.º 6
0
        public Member_productInfo FlagMember(uint?Member_id, DateTime?Create_time)
        {
            Member_productInfo item = Member_product.GetItem(Member_id.Value, this.Id.Value);

            if (item == null)
            {
                item = Member_product.Insert(new Member_productInfo {
                    Member_id   = Member_id,
                    Product_id  = this.Id,
                    Create_time = Create_time
                });
            }
            else
            {
                item.UpdateDiy
                .SetCreate_time(Create_time).ExecuteNonQuery();
            }
            return(item);
        }
Exemplo n.º 7
0
 public int UnflagMemberALL() => Member_product.DeleteByProduct_id(this.Id);
Exemplo n.º 8
0
 public int UnflagMember(uint?Member_id) => Member_product.Delete(Member_id.Value, this.Id.Value);
Exemplo n.º 9
0
 public int UnflagProductALL() => Member_product.DeleteByMember_id(this.Id);
Exemplo n.º 10
0
 public int UnflagProduct(uint?Product_id) => Member_product.Delete(this.Id.Value, Product_id.Value);