Пример #1
0
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        DateTime?createDate = null;

        try
        {
            if (this.tbCreateDate.Text.Trim() != string.Empty)
            {
                createDate = DateTime.Parse(this.tbCreateDate.Text.Trim());
            }
        }
        catch
        {
            ShowErrorMessage("Common.Date.Error");
        }

        IList <LocationLotDetail> huLocationLotDetailList = TheLocationLotDetailMgr.GetHuLocationLotDetail(this.tbLocation.Text, this.tbArea.Text,
                                                                                                           this.tbBin.Text, this.tbHuId.Text, this.tbItem.Text, this.tbLotNo.Text, false, null, null, null, false, false, createDate, 501);

        if (huLocationLotDetailList.Count() > 500)
        {
            string count = huLocationLotDetailList.Count().ToString();
            huLocationLotDetailList = huLocationLotDetailList.Take(500).ToList();
            ShowWarningMessage("Common.ListCount.Warning.GreatThan500");
        }

        this.ucList.InitPageParameter(huLocationLotDetailList);
        this.ucList.Visible = true;
    }
Пример #2
0
    public void DoPick()
    {
        if (ConfirmEvent != null)
        {
            int      resultCount = 0;
            PickList pickList    = ThePickListMgr.LoadPickList(this.PickListNo);
            pickList.PickListDetails = new List <PickListDetail>();
            foreach (GridViewRow row in GV_List.Rows)
            {
                Label lblLoc = (Label)row.FindControl("lblLoc");

                HiddenField hfId      = (HiddenField)row.FindControl("hfId");
                Hu_HuInput  ucHuInput = (Hu_HuInput)row.FindControl("ucHuInput");

                PickListDetail pickListDetail = ThePickListDetailMgr.LoadPickListDetail(int.Parse(hfId.Value), true);

                IList <Hu> huList = ucHuInput.GetHuList();
                if (huList != null && huList.Count > 0)
                {
                    foreach (Hu hu in huList)
                    {
                        IList <LocationLotDetail> locationLotDetailList = TheLocationLotDetailMgr.GetHuLocationLotDetail(lblLoc.Text.Trim(), hu.HuId);
                        if (locationLotDetailList != null && locationLotDetailList.Count > 0)
                        {
                            PickListResult pickListResult = new PickListResult();
                            pickListResult.LocationLotDetail = locationLotDetailList[0];
                            pickListResult.PickListDetail    = pickListDetail;
                            pickListResult.Qty = hu.Qty * pickListDetail.OrderLocationTransaction.UnitQty;
                            pickListDetail.AddPickListResult(pickListResult);

                            resultCount++;
                        }
                    }
                }
                pickList.AddPickListDetail(pickListDetail);
            }

            if (resultCount == 0)
            {
                ShowErrorMessage("MasterData.No.PickListResult");
                return;
            }
            try
            {
                ThePickListMgr.DoPick(pickList, this.CurrentUser);
                ShowSuccessMessage("MasterData.PickList.Pick.Successfully", pickList.PickListNo);
                ConfirmEvent(this.PickListNo, null);
            }
            catch (BusinessErrorException ex)
            {
                ShowErrorMessage(ex);
            }
        }
    }
Пример #3
0
    private void HuInput(string huId)
    {
        try
        {
            if (MiscOrder.MiscOrderDetails != null)
            {
                foreach (MiscOrderDetail miscOrderDetail in MiscOrder.MiscOrderDetails)
                {
                    if (miscOrderDetail.HuId == huId)
                    {
                        ShowErrorMessage("MasterData.MiscOrder.Location.Exists");
                    }
                }
            }
            if (this.ModuleType != BusinessConstants.CODE_MASTER_MISC_ORDER_TYPE_VALUE_GR)
            {
                if (this.tbMiscOrderLocation.Text.Trim() == string.Empty)
                {
                    ShowErrorMessage("MasterData.MiscOrder.Location.Empty");
                    return;
                }
                IList <LocationLotDetail> locationLotDetailList = TheLocationLotDetailMgr.GetHuLocationLotDetail(this.tbMiscOrderLocation.Text.Trim(), huId);
                if (locationLotDetailList.Count == 0)
                {
                    ShowErrorMessage("MasterData.MiscOrder.Location.NotExists.Hu", huId);
                }
            }
            Hu hu = TheHuMgr.LoadHu(huId);
            MiscOrderDetail newMiscOrderDetail = new MiscOrderDetail();
            newMiscOrderDetail.HuId  = huId;
            newMiscOrderDetail.Item  = hu.Item;
            newMiscOrderDetail.LotNo = hu.LotNo;
            newMiscOrderDetail.Qty   = hu.Qty * hu.UnitQty;
            MiscOrder.AddMiscOrderDetail(newMiscOrderDetail);

            BindMiscOrderDetails();
        }
        catch (BusinessErrorException ex)
        {
            ShowErrorMessage(ex);
        }
    }
Пример #4
0
    protected void tbHuScan_TextChanged(object sender, EventArgs e)
    {
        string huId = this.tbHuScan.Text.Trim();

        foreach (Hu hu in this.huList)
        {
            if (hu.HuId == huId)
            {
                ShowErrorMessage("Warehouse.Error.HuNotExist", huId);
                return;
            }
        }

        IList <LocationLotDetail> locationLotDetailList = TheLocationLotDetailMgr.GetHuLocationLotDetail(huId);

        if (locationLotDetailList.Count == 0)
        {
            ShowErrorMessage("Warehouse.Error.HuNotExist", huId);
            return;
        }
        if (this.LocationCode == null)
        {
            this.LocationCode = locationLotDetailList[0].Location.Code;
        }
        if (this.LocationCode != locationLotDetailList[0].Location.Code)
        {
            ShowErrorMessage("Hu.Error.Location.NotEqual");
            return;
        }
        this.huList.Add(locationLotDetailList[0].Hu);
        this.GV_HuList.DataSource = this.huList;
        this.GV_HuList.DataBind();

        this.lTitle.Visible   = true;
        this.fdHuList.Visible = true;
        InitialHuScan();
    }
Пример #5
0
    private void HuScan(Hu hu)
    {
        bool isMatch = false;

        #region  Hu拣货
        if (this.PickBy == BusinessConstants.CODE_MASTER_PICKBY_HU)
        {
            foreach (GridViewRow row in GV_List.Rows)
            {
                Label       lblOrderQty   = (Label)row.FindControl("lblOrderQty");
                TextBox     tbShipQty     = (TextBox)row.FindControl("tbShipQty");
                Label       lblHuId       = (Label)row.FindControl("lblHuId");
                Label       lblLoc        = (Label)row.FindControl("lblLoc");
                Label       lblStorageBin = (Label)row.FindControl("lblStorageBin");
                HiddenField hfId          = (HiddenField)row.FindControl("hfId");
                Hu_HuInput  ucHuInput     = (Hu_HuInput)row.FindControl("ucHuInput");
                if (ucHuInput.CheckExist(hu.HuId))
                {
                    this.lblMessage.Text = Resources.Language.MasterDataHuExist;
                    break;
                }
                if (hu.HuId == lblHuId.Text.Trim())
                {
                    IList <LocationLotDetail> locationLotDetList = TheLocationLotDetailMgr.GetHuLocationLotDetail(hu.HuId);
                    if (locationLotDetList != null && locationLotDetList.Count > 0)
                    {
                        LocationLotDetail locLotDet = locationLotDetList[0];
                        if (locLotDet.Location.Code == lblLoc.Text.Trim() && (locLotDet.StorageBin == null || locLotDet.StorageBin.Code.ToUpper() == lblStorageBin.Text.Trim().ToUpper()))
                        {
                            decimal orderQty = lblOrderQty.Text.Trim() == string.Empty ? 0 : decimal.Parse(lblOrderQty.Text.Trim());
                            decimal shipQty  = tbShipQty.Text.Trim() == string.Empty ? 0 : decimal.Parse(tbShipQty.Text.Trim());
                            if (orderQty >= shipQty + hu.Qty)
                            {
                                ucHuInput.HuInput(hu);
                                tbShipQty.Text = ucHuInput.SumQty().ToString("F2");
                                PickListResult pickListResult = new PickListResult();
                                pickListResult.LocationLotDetail = locLotDet;
                                pickListResult.PickListDetail    = ThePickListDetailMgr.LoadPickListDetail(int.Parse(hfId.Value));
                                pickListResult.Qty = hu.Qty;

                                isMatch = true;
                                InitialHuScan();
                                break;
                            }
                        }
                    }
                }
            }
        }
        #endregion

        #region  LotNo拣货
        else if (this.PickBy == BusinessConstants.CODE_MASTER_PICKBY_LOTNO)
        {
            foreach (GridViewRow row in GV_List.Rows)
            {
                Label       lblOrderQty   = (Label)row.FindControl("lblOrderQty");
                TextBox     tbShipQty     = (TextBox)row.FindControl("tbShipQty");
                Label       lblLotNo      = (Label)row.FindControl("lblLotNo");
                Label       lblItemCode   = (Label)row.FindControl("lblItemCode");
                Label       lblUnitCount  = (Label)row.FindControl("lblUnitCount");
                Label       lblUom        = (Label)row.FindControl("lblUom");
                Label       lblLoc        = (Label)row.FindControl("lblLoc");
                Label       lblStorageBin = (Label)row.FindControl("lblStorageBin");
                Hu_HuInput  ucHuInput     = (Hu_HuInput)row.FindControl("ucHuInput");
                HiddenField hfId          = (HiddenField)row.FindControl("hfId");
                if (ucHuInput.CheckExist(hu.HuId))
                {
                    this.lblMessage.Text = Resources.Language.MasterDataHuExist;
                    break;
                }
                if (lblLotNo.Text.Trim().ToUpper() == hu.LotNo.ToUpper() && lblItemCode.Text.Trim().ToUpper() == hu.Item.Code.ToUpper() && decimal.Parse(lblUnitCount.Text.Trim()) == hu.UnitCount && lblUom.Text.Trim().ToUpper() == hu.Uom.Code.ToUpper())
                {
                    IList <LocationLotDetail> locationLotDetList = TheLocationLotDetailMgr.GetHuLocationLotDetail(hu.HuId);
                    if (locationLotDetList != null && locationLotDetList.Count > 0)
                    {
                        LocationLotDetail locLotDet = locationLotDetList[0];
                        if (locLotDet.Location.Code == lblLoc.Text.Trim() && (locLotDet.StorageBin == null || locLotDet.StorageBin.Code == lblStorageBin.Text.Trim()))
                        {
                            decimal orderQty = lblOrderQty.Text.Trim() == string.Empty ? 0 : decimal.Parse(lblOrderQty.Text.Trim());
                            decimal shipQty  = tbShipQty.Text.Trim() == string.Empty ? 0 : decimal.Parse(tbShipQty.Text.Trim());
                            if (orderQty >= shipQty + hu.Qty)
                            {
                                ucHuInput.HuInput(hu);
                                tbShipQty.Text = ucHuInput.SumQty().ToString("F2");
                                PickListResult pickListResult = new PickListResult();
                                pickListResult.LocationLotDetail = locLotDet;
                                pickListResult.PickListDetail    = ThePickListDetailMgr.LoadPickListDetail(int.Parse(hfId.Value));
                                pickListResult.Qty = hu.Qty;

                                isMatch = true;
                                InitialHuScan();
                                break;
                            }
                        }
                    }
                }
            }
        }
        #endregion

        if (!isMatch)
        {
            this.lblMessage.Text = Resources.Language.MasterDataPickListNotExistHu;
            this.tbHuScan.Text   = string.Empty;
            this.tbHuScan.Focus();
        }
    }