コード例 #1
0
        /// <summary>
        ///添加库房
        /// </summary>
        /// <param name="request"></param>
        public void AddWarehouse(AddWarehouseRequest request)
        {
            Warehouse model = new Warehouse(request.Name, request.Note, request.WarehouseTypeId);

            this._warehouseRepository.Add(model);
            this._uow.Commit();
        }
コード例 #2
0
        /// <summary>
        /// 修改库房
        /// </summary>
        /// <param name="request"></param>
        public void UpdateWarehouse(AddWarehouseRequest request)
        {
            Warehouse model = this._warehouseRepository.FindBy(request.Id);

            if (model == null)
            {
                throw new EntityIsInvalidException <string>(request.Id.ToString());
            }

            model.Name            = request.Name;
            model.Note            = request.Note;
            model.WarehouseTypeId = request.WarehouseTypeId;
            this._warehouseRepository.Save(model);
            this._uow.Commit();
        }
コード例 #3
0
 public Task <IActionResult> AddWarehouse([FromBody] AddWarehouseRequest request)
 {
     return(this.HandleRequest <AddWarehouseRequest, AddWarehouseResponse>(request));
 }
コード例 #4
0
 /// <summary>
 /// 修改库房
 /// </summary>
 /// <returns></returns>
 public JsonResult UpdateWarehouse(AddWarehouseRequest request)
 {
     this._warehouseService.UpdateWarehouse(request);
     return(Json("修改成功", JsonRequestBehavior.AllowGet));
 }