示例#1
0
 public void AddMiscOrderDetail(MiscOrderDetail miscOrderDetail)
 {
     if (this.MiscOrderDetails == null)
     {
         this.MiscOrderDetails = new List <MiscOrderDetail>();
     }
     this.MiscOrderDetails.Add(miscOrderDetail);
 }
    private bool buildMiscOrderDetails(bool saveHead)
    {
        bool result = true;
        int rowCount = saveHead ? this.MiscOrderDetailsGV.Rows.Count - 1 : this.MiscOrderDetailsGV.Rows.Count;
        IList<MiscOrderDetail> miscOrderDetails = new List<MiscOrderDetail>();
        for (int i = 0; i < rowCount; i++)
        {
            MiscOrderDetail miscOrderDetail = new MiscOrderDetail();
            Controls_TextBox tbItemCode = this.MiscOrderDetailsGV.Rows[i].FindControl("tbItemCode") as Controls_TextBox;
            if (tbItemCode.Text.Length == 0)
            {
                Label lblItemCode = this.MiscOrderDetailsGV.Rows[i].FindControl("lblItemCode") as Label;
                if (lblItemCode.Text.Length == 0)
                {
                    continue;
                }
                else
                {
                    miscOrderDetail.Item = TheItemMgr.LoadItem(lblItemCode.Text);
                }
            }
            else
            {
                miscOrderDetail.Item = TheItemMgr.LoadItem(tbItemCode.Text);
            }

            TextBox tbGridQtyTextBox = this.MiscOrderDetailsGV.Rows[i].FindControl("tbQty") as TextBox;
            string gridRowInputQty = tbGridQtyTextBox.Text.Trim();
            //int m;
            //if (!int.TryParse(gridRowInputQty, out m))
            //{
            //    ShowErrorMessage("MasterData.MiscOrder.WarningMessage.InputNoIntegerValue");
            //    result = false;
            //}
            //decimal InputQty = decimal.Parse(gridRowInputQty);
            //if ((this.ModuleType.Equals(BusinessConstants.CODE_MASTER_MISC_ORDER_TYPE_VALUE_GI)
            //    || this.ModuleType.Equals(BusinessConstants.CODE_MASTER_MISC_ORDER_TYPE_VALUE_GR)) && InputQty <= 0)
            //{
            //    ShowErrorMessage("MasterData.MiscOrder.WarningMessage.InputQtyMustThanZero");
            //    result = false;
            //    return result;
            //}
            //if (this.ModuleType.Equals(BusinessConstants.CODE_MASTER_MISC_ORDER_TYPE_VALUE_ADJ) && InputQty == 0)
            //{
            //    ShowErrorMessage("MasterData.MiscOrder.WarningMessage.InputQtyDontEqualsZero");
            //    result = false;
            //    return result;
            //}
            miscOrderDetail.Qty = decimal.Parse(tbGridQtyTextBox.Text.Trim());

            miscOrderDetail.IsBlankDetail = false;
            miscOrderDetails.Add(miscOrderDetail);
        }
        MiscOrder.MiscOrderDetails = miscOrderDetails;
        return result;
    }
示例#3
0
        public IList<InventoryTransaction> InventoryIn(MiscOrderDetail miscOrderDetail, User user, string binCode)
        {
            IList<InventoryTransaction> inventoryTransactionList = InventoryIn(miscOrderDetail, user);

            if (binCode != null && binCode != string.Empty && inventoryTransactionList != null && inventoryTransactionList.Count > 0)
            {
                foreach (InventoryTransaction inventoryTransaction in inventoryTransactionList)
                {
                    LocationLotDetail locationLotDetail = this.locationLotDetailMgr.LoadLocationLotDetail(inventoryTransaction.LocationLotDetailId);
                    locationLotDetail.NewStorageBin = this.storageBinMgr.LoadStorageBin(binCode);
                    inventoryTransaction.StorageBin = locationLotDetail.NewStorageBin;

                    InventoryPut(locationLotDetail, user);
                }
            }

            return inventoryTransactionList;
        }
示例#4
0
        public IList<InventoryTransaction> InventoryIn(MiscOrderDetail miscOrderDetail, User user)
        {
            #region ���¿��
            IList<InventoryTransaction> inventoryTransactionList = RecordInventory(
                miscOrderDetail.Item,
                miscOrderDetail.MiscOrder.Location,
                miscOrderDetail.HuId,
                miscOrderDetail.LotNo,
                miscOrderDetail.Qty,
                false,
                null,
                BusinessConstants.CODE_MASTER_LOCATION_TRANSACTION_TYPE_VALUE_RCT_UNP,
                null,
                //true,
                user,
                false,
                false,
                null
                );
            #endregion

            #region ��¼�������
            foreach (InventoryTransaction inventoryTransaction in inventoryTransactionList)
            {
                this.locationTransactionMgr.RecordLocationTransaction(miscOrderDetail, inventoryTransaction, user);
            }

            return inventoryTransactionList;
            #endregion
        }
示例#5
0
        public IList<InventoryTransaction> InventoryOut(MiscOrderDetail miscOrderDetail, User user)
        {
            if (miscOrderDetail.HuId != null && miscOrderDetail.HuId.Trim() != string.Empty)
            {
                #region �ж��Ƿ���Ҫ�¼�
                LocationLotDetail locationLotDetail = this.locationLotDetailMgr.CheckLoadHuLocationLotDetail(miscOrderDetail.HuId.Trim(), miscOrderDetail.MiscOrder.Location);
                if (locationLotDetail.StorageBin != null)
                {
                    //�¼�
                    this.InventoryPick(locationLotDetail, user);
                }
                #endregion
            }

            #region ���¿��
            IList<InventoryTransaction> inventoryTransactionList = RecordInventory(
                miscOrderDetail.Item,
                miscOrderDetail.MiscOrder.Location,
                miscOrderDetail.HuId,
                miscOrderDetail.LotNo,
                (0 - miscOrderDetail.Qty),
                false,
                null,
                BusinessConstants.CODE_MASTER_LOCATION_TRANSACTION_TYPE_VALUE_ISS_UNP,
                null,
                //true,
                user,
                false,
                false,
                null
                );
            #endregion

            #region ��������״̬�Ϳ�λ
            if (miscOrderDetail.HuId != null && miscOrderDetail.HuId.Trim() != string.Empty
                && miscOrderDetail.Qty > 0)
            {
                Hu hu = this.huMgr.LoadHu(miscOrderDetail.HuId.Trim());
                hu.Location = null;
                hu.Status = BusinessConstants.CODE_MASTER_HU_STATUS_VALUE_CLOSE;
                this.huMgr.UpdateHu(hu);
            }
            #endregion

            #region ��¼�������
            foreach (InventoryTransaction inventoryTransaction in inventoryTransactionList)
            {
                this.locationTransactionMgr.RecordLocationTransaction(miscOrderDetail, inventoryTransaction, user);
            }
            #endregion

            return inventoryTransactionList;
        }
 public virtual void DeleteMiscOrderDetail(MiscOrderDetail entity)
 {
     entityDao.DeleteMiscOrderDetail(entity);
 }
 public virtual void UpdateMiscOrderDetail(MiscOrderDetail entity)
 {
     entityDao.UpdateMiscOrderDetail(entity);
 }
 public virtual void CreateMiscOrderDetail(MiscOrderDetail entity)
 {
     entityDao.CreateMiscOrderDetail(entity);
 }
        public void RecordLocationTransaction(MiscOrderDetail miscOrderDetail, InventoryTransaction inventoryTransaction, User user)
        {
            LocationTransaction locationTransaction = new LocationTransaction();
            MiscOrder miscOrder = miscOrderDetail.MiscOrder;

            locationTransaction.OrderNo = miscOrder.OrderNo;
            if (inventoryTransaction.Hu != null)
            {
                locationTransaction.HuId = inventoryTransaction.Hu.HuId;
                locationTransaction.LotNo = inventoryTransaction.Hu.LotNo;
            }
            if (locationTransaction.LotNo == null || locationTransaction.LotNo == string.Empty)
            {
                locationTransaction.LotNo = inventoryTransaction.LotNo;
            }
            locationTransaction.BatchNo = inventoryTransaction.LocationLotDetailId;
            locationTransaction.Item = miscOrderDetail.Item.Code;
            locationTransaction.ItemDescription = miscOrderDetail.Item.Description;
            locationTransaction.Uom = miscOrderDetail.Item.Uom.Code;
            locationTransaction.Qty = inventoryTransaction.Qty;
            locationTransaction.PartyFrom = miscOrder.Location.Region.Code;
            locationTransaction.PartyFromName = miscOrder.Location.Region.Name;
            locationTransaction.PartyTo = miscOrder.Location.Region.Code;
            locationTransaction.PartyToName = miscOrder.Location.Region.Name;
            locationTransaction.Location = miscOrder.Location.Code;
            if (locationTransaction.Location == BusinessConstants.SYSTEM_LOCATION_INSPECT)
            {
                throw new BusinessErrorException("Invalided.Location.Inspect");
            }
            if (locationTransaction.Location == BusinessConstants.SYSTEM_LOCATION_REJECT)
            {
                locationTransaction.RefLocation = inventoryTransaction.RefLocation;
            }

            locationTransaction.LocationName = miscOrder.Location.Name;
            locationTransaction.LocInOutReason = miscOrder.Reason;
            // CodeMaster codeMaster = null;
            if (miscOrder.Type == BusinessConstants.CODE_MASTER_MISC_ORDER_TYPE_VALUE_GI)
            {
                locationTransaction.TransactionType = BusinessConstants.CODE_MASTER_LOCATION_TRANSACTION_TYPE_VALUE_ISS_UNP;
                //codeMaster = codeMasterMgr.GetCachedCodeMaster(BusinessConstants.CODE_MASTER_STOCK_IN_REASON, miscOrder.Reason);
            }
            else if (miscOrder.Type == BusinessConstants.CODE_MASTER_MISC_ORDER_TYPE_VALUE_GR)
            {
                locationTransaction.TransactionType = BusinessConstants.CODE_MASTER_LOCATION_TRANSACTION_TYPE_VALUE_RCT_UNP;
                //codeMaster = codeMasterMgr.GetCachedCodeMaster(BusinessConstants.CODE_MASTER_STOCK_OUT_REASON, miscOrder.Reason);
            }
            else if (miscOrder.Type == BusinessConstants.CODE_MASTER_MISC_ORDER_TYPE_VALUE_ADJ)
            {
                locationTransaction.TransactionType = BusinessConstants.CODE_MASTER_LOCATION_TRANSACTION_TYPE_VALUE_CYC_CNT;
                //codeMaster = codeMasterMgr.GetCachedCodeMaster(BusinessConstants.CODE_MASTER_STOCK_ADJUST_REASON, miscOrder.Reason);
            }
            //if (codeMaster != null)
            //{
            //    locationTransaction.LocInOutReasonDescription = codeMaster.Description;
            //}
            locationTransaction.CreateDate = DateTime.Now;
            locationTransaction.CreateUser = user.Code;
            locationTransaction.EffectiveDate = DateTime.Parse(miscOrder.EffectiveDate.ToString("yyyy-MM-dd"));

            this.CreateLocationTransaction(locationTransaction);
        }
示例#10
0
    private void BindMiscOrderDetails(bool includeBlank)
    {
        IList<MiscOrderDetail> miscOrderDetailList = new List<MiscOrderDetail>();
        foreach (MiscOrderDetail miscOrderDetail in this.MiscOrder.MiscOrderDetails)
        {
            miscOrderDetailList.Add(miscOrderDetail);
        }

        if (includeBlank)
        {
            MiscOrderDetail blankMiscOrderDetail = new MiscOrderDetail();
            blankMiscOrderDetail.Qty = 0;
            blankMiscOrderDetail.IsBlankDetail = true;
            miscOrderDetailList.Add(blankMiscOrderDetail);
        }
        this.MiscOrderDetailsGV.DataSource = miscOrderDetailList;
        this.MiscOrderDetailsGV.DataBind();
    }
示例#11
0
    protected void lbtnAdd_Click(object sender, EventArgs e)
    {
        int rowIndex = ((GridViewRow)(((DataControlFieldCell)(((LinkButton)(sender)).Parent)).Parent)).RowIndex;
        GridViewRow row = this.MiscOrderDetailsGV.Rows[rowIndex];
        RequiredFieldValidator rfvItemCode = (RequiredFieldValidator)row.FindControl("rfvItemCode");

        if (rfvItemCode.IsValid)
        {
            UpdateMiscOrderDetails();

            //int rowCount = this.MiscOrderDetailsGV.Rows.Count - 1;
            MiscOrderDetail miscOrderDetail = new MiscOrderDetail();
            Controls_TextBox tbItemCode = row.FindControl("tbItemCode") as Controls_TextBox;
            miscOrderDetail.Item = TheItemMgr.LoadItem(tbItemCode.Text.Trim());
            TextBox tbGridQtyTextBox = row.FindControl("tbQty") as TextBox;
            miscOrderDetail.Qty = decimal.Parse(tbGridQtyTextBox.Text.Trim());
            miscOrderDetail.IsBlankDetail = false;
            this.MiscOrder.AddMiscOrderDetail(miscOrderDetail);

            BindMiscOrderDetails(true);
        }
    }
示例#12
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 miscOrderDetail = new MiscOrderDetail();
                miscOrderDetail.HuId = huId;
                miscOrderDetail.Item = hu.Item;
                miscOrderDetail.LotNo = hu.LotNo;
                miscOrderDetail.Qty = hu.Qty;
                MiscOrder.AddMiscOrderDetail(miscOrderDetail);

                BindMiscOrderDetails();
            }
        }
        catch (BusinessErrorException ex)
        {
            ShowErrorMessage(ex);
        }

    }
示例#13
0
    private void updateGridView(bool needBlank)
    {
        if (needBlank)
        {
            MiscOrderDetail blankMiscOrderDetail = new MiscOrderDetail();
            blankMiscOrderDetail.Qty = 0;
            MiscOrder.MiscOrderDetails.Add(blankMiscOrderDetail);
            blankMiscOrderDetail.IsBlankDetail = true;
        }
        this.MiscOrderDetailsGV.DataSource = MiscOrder.MiscOrderDetails;
        this.MiscOrderDetailsGV.DataBind();

    }
 public virtual void DeleteMiscOrderDetail(MiscOrderDetail entity)
 {
     Delete(entity);
 }
 public virtual void UpdateMiscOrderDetail(MiscOrderDetail entity)
 {
     Update(entity);
 }
 public virtual void CreateMiscOrderDetail(MiscOrderDetail entity)
 {
     Create(entity);
 }