protected void btnDelete_Click(object sender, EventArgs e)
    {
        string         whcode   = this.txtWhCode.Text;
        string         areaCode = this.txtAreaCode.Text;
        int            areaid   = Convert.ToInt32(this.txtAreaID.Text);
        WarehouseShelf objShelf = new WarehouseShelf();
        int            count    = objShelf.QueryShelfByAreaCode(areaCode).Tables[0].Rows.Count;

        if (count > 0)
        {
            JScript.Instance.ShowMessage(this, areaCode + "库区还有下属货架,不能删除!");
            return;
        }
        else
        {
            objArea.Delete(areaid);
            this.txtAreaID.Text          = "";
            this.txtAreaCode.Text        = objArea.GetNewAreaCode(this.txtWhCode.Text);
            this.txtAreaName.Text        = "";
            this.txtShortName.Text       = "";
            this.ddlActive.SelectedIndex = 0;
            this.txtAreaType.Text        = "";
            this.txtMemo.Text            = "";
            this.txtAreaCode.ReadOnly    = false;
            this.btnDelete.Enabled       = false;
            //JScript.Instance.ShowMessage(this, "库区删除成功!");
            string path = whcode + "/" + areaCode;
            JScript.Instance.RegisterScript(this, "RefreshParent('" + path + "');");
        }
    }
Пример #2
0
        /// <summary>
        ///添加库房
        /// </summary>
        /// <param name="request"></param>
        public void AddWarehouseShelf(AddWarehouseShelfRequest request)
        {
            WarehouseShelf model = new WarehouseShelf(request.Name, request.Capacity, request.Note, request.WarehouseId);

            this._warehouseShelfRepository.Add(model);
            this._uow.Commit();
        }
Пример #3
0
        /// <summary>
        /// 添加入库
        /// </summary>
        /// <param name="request"></param>
        public void AddInBound(AddInBoundRequest request)
        {
            Product product = this._productRepository.FindBy(request.ProductId);

            if (product == null)
            {
                throw new EntityIsInvalidException <string>(request.ProductId.ToString());
            }
            Warehouse warehouse = this._warehouseRepository.FindBy(request.WarehouseId);

            if (warehouse == null)
            {
                throw new EntityIsInvalidException <string>(request.WarehouseId.ToString());
            }
            WarehouseShelf warehouseShelf = this._warehouseShelfRepository.FindBy(request.WarehouseShelfId);

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


            InBound model = new InBound(product, warehouse, warehouseShelf, request.Qty, request.Price, request.Currency, request.Note, request.CreateUserId);

            this._inBoundRepository.Add(model);
            this._uow.Commit();
        }
Пример #4
0
        /// <summary>
        /// 修改库房
        /// </summary>
        /// <param name="request"></param>
        public void UpdateWarehouseShelf(AddWarehouseShelfRequest request)
        {
            WarehouseShelf model = this._warehouseShelfRepository.FindBy(request.Id);

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

            model.Capacity    = request.Capacity;
            model.Note        = request.Note;
            model.WarehouseId = request.WarehouseId;
            this._warehouseShelfRepository.Save(model);
            this._uow.Commit();
        }
Пример #5
0
        /// <summary>
        /// 添加入库
        /// </summary>
        /// <param name="request"></param>
        public void AddInBound(AddInBoundRequest request)
        {
            Product product = this._productRepository.FindBy(request.ProductId);

            if (product == null)
            {
                throw new EntityIsInvalidException <string>(request.ProductId.ToString());
            }
            Warehouse warehouse = this._warehouseRepository.FindBy(request.WarehouseId);

            if (warehouse == null)
            {
                throw new EntityIsInvalidException <string>(request.WarehouseId.ToString());
            }
            WarehouseShelf warehouseShelf = this._warehouseShelfRepository.FindBy(request.WarehouseShelfId);

            if (warehouseShelf == null)
            {
                throw new EntityIsInvalidException <string>(request.WarehouseId.ToString());
            }
            InOutReason reason = this._inOutReasonService.GetInOutReason(request.InOutReasonId);

            if (reason == null)
            {
                throw new EntityIsInvalidException <string>(request.InOutReasonId.ToString());
            }
            Users users = this._usersService.GetUsers(request.CreateUserId);

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

            InBound model = new InBound(product, warehouse, warehouseShelf, reason, request.Qty, request.Price, request.Currency, request.Note, users);

            this._inBoundRepository.Add(model);
            this._spotInventoryService.InSpotInventory(request.ProductId, request.WarehouseId, request.Qty, request.Price, request.Currency);
        }
Пример #6
0
 public static WarehouseShelfView ConvertToWarehouseShelfView(this WarehouseShelf model)
 {
     return(Mapper.Map <WarehouseShelf, WarehouseShelfView>(model));
 }