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 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.失败);
        }