public Response <string> Add([FromHeader] OutBoxListReq request) { var result = new Response <string>(); var view = new OutBoxView { username = request.username, Mbno = request.Mbno, Msg = request.Msg, SendTime = DateTime.Now, ComPort = request.ComPort, Report = request.Report, IsDel = request.IsDel, }; try { _app.Add(view); result.Result = view.id; } catch (Exception ex) { result.Code = 500; result.Message = ex.InnerException?.Message ?? ex.Message; } return(result); }
public void Update(OutBoxView view) { UnitWork.Update <OutBox>(u => u.Id == view.id, u => new OutBox { username = view.username, Mbno = view.Mbno, Msg = view.Msg, SendTime = DateTime.Now, }); UnitWork.Save(); }
public void Add(OutBoxView view) { OutBox outBox = view; outBox.username = view.username; outBox.Mbno = view.Mbno; outBox.Msg = view.Msg; outBox.SendTime = DateTime.Now; UnitWork.Add(outBox); UnitWork.Save(); }
public Response <string> Update([FromHeader] OutBoxListReq request) { var result = new Response <string>(); var view = new OutBoxView { id = request.Id, username = request.username, Mbno = request.Mbno, Msg = request.Msg, SendTime = request.SendTime, }; try { _app.Update(view); result.Result = view.id; } catch (Exception ex) { result.Code = 500; result.Message = ex.InnerException?.Message ?? ex.Message; } return(result); }