public ExpressdescInfo Save() { if (this.Express_id != null) { Expressdesc.Update(this); return(this); } return(Expressdesc.Insert(this)); }
public APIReturn _Add([FromForm] uint?Express_id, [FromForm] string Content) { ExpressdescInfo item = new ExpressdescInfo(); item.Express_id = Express_id; item.Content = Content; item = Expressdesc.Insert(item); return(APIReturn.成功.SetData("item", item.ToBson())); }
public ActionResult Edit([FromQuery] uint Express_id) { ExpressdescInfo item = Expressdesc.GetItem(Express_id); if (item == null) { return(APIReturn.记录不存在_或者没有权限); } ViewBag.item = item; return(View()); }
public APIReturn _Del([FromForm] uint[] ids) { int affrows = 0; foreach (uint id in ids) { affrows += Expressdesc.Delete(id); } if (affrows > 0) { return(APIReturn.成功.SetMessage($"删除成功,影响行数:{affrows}")); } return(APIReturn.失败); }
public APIReturn _Edit([FromQuery] uint Express_id, [FromForm] string Content) { ExpressdescInfo item = Expressdesc.GetItem(Express_id); if (item == null) { return(APIReturn.记录不存在_或者没有权限); } item.Content = Content; int affrows = Expressdesc.Update(item); if (affrows > 0) { return(APIReturn.成功.SetMessage($"更新成功,影响行数:{affrows}")); } return(APIReturn.失败); }
public ExpressdescInfo AddExpressdesc(string Content) => Expressdesc.Insert(new ExpressdescInfo { Express_id = this.Id, Content = Content });