Beispiel #1
0
 public Product_questionInfo Save()
 {
     if (this.Id != null)
     {
         Product_question.Update(this);
         return(this);
     }
     this.Create_time = DateTime.Now;
     return(Product_question.Insert(this));
 }
Beispiel #2
0
        public ActionResult Edit([FromQuery] uint Id)
        {
            Product_questionInfo item = Product_question.GetItem(Id);

            if (item == null)
            {
                return(APIReturn.记录不存在_或者没有权限);
            }
            ViewBag.item = item;
            return(View());
        }
Beispiel #3
0
        public APIReturn _Del([FromForm] uint[] ids)
        {
            int affrows = 0;

            foreach (uint id in ids)
            {
                affrows += Product_question.Delete(id);
            }
            if (affrows > 0)
            {
                return(APIReturn.成功.SetMessage($"删除成功,影响行数:{affrows}"));
            }
            return(APIReturn.失败);
        }
Beispiel #4
0
        public APIReturn _Add([FromForm] uint?Member_id, [FromForm] uint?Parent_id, [FromForm] uint?Product_id, [FromForm] string Content, [FromForm] string Email, [FromForm] string Name, [FromForm] Product_questionSTATE?State)
        {
            Product_questionInfo item = new Product_questionInfo();

            item.Member_id   = Member_id;
            item.Parent_id   = Parent_id;
            item.Product_id  = Product_id;
            item.Content     = Content;
            item.Create_time = DateTime.Now;
            item.Email       = Email;
            item.Name        = Name;
            item.State       = State;
            item             = Product_question.Insert(item);
            return(APIReturn.成功.SetData("item", item.ToBson()));
        }
Beispiel #5
0
        public APIReturn _Edit([FromQuery] uint Id, [FromForm] uint?Member_id, [FromForm] uint?Parent_id, [FromForm] uint?Product_id, [FromForm] string Content, [FromForm] string Email, [FromForm] string Name, [FromForm] Product_questionSTATE?State)
        {
            Product_questionInfo item = Product_question.GetItem(Id);

            if (item == null)
            {
                return(APIReturn.记录不存在_或者没有权限);
            }
            item.Member_id   = Member_id;
            item.Parent_id   = Parent_id;
            item.Product_id  = Product_id;
            item.Content     = Content;
            item.Create_time = DateTime.Now;
            item.Email       = Email;
            item.Name        = Name;
            item.State       = State;
            int affrows = Product_question.Update(item);

            if (affrows > 0)
            {
                return(APIReturn.成功.SetMessage($"更新成功,影响行数:{affrows}"));
            }
            return(APIReturn.失败);
        }
Beispiel #6
0
 public Product_questionInfo AddQuestion(uint?Member_id, uint?Parent_id, string Content, DateTime?Create_time, string Email, string Name, Product_questionSTATE?State) => Product_question.Insert(new Product_questionInfo {
     Member_id   = Member_id,
     Parent_id   = Parent_id,
     Product_id  = this.Id,
     Content     = Content,
     Create_time = Create_time,
     Email       = Email,
     Name        = Name,
     State       = State
 });