| | |
| | | } |
| | | } |
| | | |
| | | /***进入模版管理可以修改模版***/ |
| | | |
| | | /// <summary> |
| | | /// 获取所有 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetList")] |
| | | public ResponseResult GetList() |
| | | [HttpPost("Delete")] |
| | | public ResponseResult Delete(DelBarcode barcode) |
| | | { |
| | | var entity = new MessageCenter(); |
| | | entity.TableName = TableName; |
| | | entity.Url = URL + "Delete"; |
| | | entity.Method = METHOD; |
| | | entity.Data = JsonConvert.SerializeObject(barcode); |
| | | entity.Status = 1; |
| | | entity.CreateBy = "PL017"; |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetList(); |
| | | var save = m.Delete(barcode); |
| | | resultInfos.tbBillList = save; |
| | | |
| | | entity.Result = 0; |
| | | if (save) entity.Result = 1; |
| | | |
| | | entity.DealWith = 1; |
| | | _manager.save(entity); |
| | | |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | entity.Result = 0; |
| | | |
| | | entity.DealWith = 0; |
| | | |
| | | entity.ResultData = ex.Message; |
| | | |
| | | _manager.save(entity); |
| | | |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 根据主键获取 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetById")] |
| | | public ResponseResult GetById(int id) |
| | | [HttpPost("DeleteList")] |
| | | public ResponseResult DeleteList(List<DelBarcode> barcodes) |
| | | { |
| | | var entity = new MessageCenter(); |
| | | entity.TableName = TableName; |
| | | entity.Url = URL + "DeleteList"; |
| | | entity.Method = METHOD; |
| | | entity.Data = JsonConvert.SerializeObject(barcodes); |
| | | entity.Status = 1; |
| | | entity.CreateBy = "PL017"; |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetById(id); |
| | | var save = m.DeleteList(barcodes); |
| | | resultInfos.tbBillList = save; |
| | | |
| | | entity.Result = 0; |
| | | if (save) entity.Result = 1; |
| | | |
| | | entity.DealWith = 1; |
| | | _manager.save(entity); |
| | | |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | entity.Result = 0; |
| | | |
| | | /// <summary> |
| | | /// 根据主键删除 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("DeleteByIds")] |
| | | public ResponseResult DeleteByIds([FromBody] object[] ids) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.DeleteByIds(ids); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | entity.DealWith = 0; |
| | | |
| | | /// <summary> |
| | | /// 添加 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Insert")] |
| | | public ResponseResult Add([FromBody] MesDeliveryNoteBarcode data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Insert(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | entity.ResultData = ex.Message; |
| | | |
| | | /// <summary> |
| | | /// 添加返回自增 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("InsertReturnIdentity")] |
| | | public ResponseResult InsertReturnIdentity([FromBody] MesDeliveryNoteBarcode data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.InsertReturnIdentity(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | _manager.save(entity); |
| | | |
| | | /// <summary> |
| | | /// 修改 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Update")] |
| | | public ResponseResult Update([FromBody] MesDeliveryNoteBarcode data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Update(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |