Example #1
0
 public MarketdescInfo Save()
 {
     if (this.Market_id != null)
     {
         Marketdesc.Update(this);
         return(this);
     }
     return(Marketdesc.Insert(this));
 }
Example #2
0
        public APIReturn _Add([FromForm] uint?Market_id, [FromForm] string Content, [FromForm] string Url)
        {
            MarketdescInfo item = new MarketdescInfo();

            item.Market_id = Market_id;
            item.Content   = Content;
            item.Url       = Url;
            item           = Marketdesc.Insert(item);
            return(APIReturn.成功.SetData("item", item.ToBson()));
        }
Example #3
0
        public ActionResult Edit([FromQuery] uint Market_id)
        {
            MarketdescInfo item = Marketdesc.GetItem(Market_id);

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

            foreach (uint id in ids)
            {
                affrows += Marketdesc.Delete(id);
            }
            if (affrows > 0)
            {
                return(APIReturn.成功.SetMessage($"删除成功,影响行数:{affrows}"));
            }
            return(APIReturn.失败);
        }
Example #5
0
        public APIReturn _Edit([FromQuery] uint Market_id, [FromForm] string Content, [FromForm] string Url)
        {
            MarketdescInfo item = Marketdesc.GetItem(Market_id);

            if (item == null)
            {
                return(APIReturn.记录不存在_或者没有权限);
            }
            item.Content = Content;
            item.Url     = Url;
            int affrows = Marketdesc.Update(item);

            if (affrows > 0)
            {
                return(APIReturn.成功.SetMessage($"更新成功,影响行数:{affrows}"));
            }
            return(APIReturn.失败);
        }
Example #6
0
 public MarketdescInfo AddMarketdesc(string Content, string Url) => Marketdesc.Insert(new MarketdescInfo {
     Market_id = this.Id,
     Content   = Content,
     Url       = Url
 });