public static bool IsStorageBinEqual(StorageBin storageBin1, StorageBin storageBin2)
        {
            if (storageBin1 == null && storageBin2 == null)
            {
                return true;
            }

            if (storageBin1 == null && storageBin2 != null)
            {
                return false;
            }

            if (storageBin1 != null && storageBin2 == null)
            {
                return false;
            }

            if (storageBin1.Code == storageBin2.Code)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
 public virtual void DeleteStorageBin(StorageBin entity)
 {
     Delete(entity);
 }
 public virtual void UpdateStorageBin(StorageBin entity)
 {
     Update(entity);
 }
 public virtual void CreateStorageBin(StorageBin entity)
 {
     Create(entity);
 }
Beispiel #5
0
        public IList<InventoryTransaction> InspectIn(LocationLotDetail locationLotDetail, Location locIn, StorageBin bin, User user, bool needSettle, string inspectNo, string inrNo, int? inspectDetailId)
        {
            bool isBillSettled = false;  //�Ƿ��Ѿ��������
            if (needSettle && locationLotDetail.IsConsignment && locationLotDetail.PlannedBill.HasValue)
            {
                PlannedBill plannedBill = this.plannedBillMgr.LoadPlannedBill(locationLotDetail.PlannedBill.Value);
                if (plannedBill.SettleTerm == BusinessConstants.CODE_MASTER_BILL_SETTLE_TERM_VALUE_INSPECTION)
                {
                    isBillSettled = true;
                }
            }

            #region ���
            IList<InventoryTransaction> inventoryTransactionList = RecordInventory(
                    locationLotDetail.Item,
                    locIn,
                //�벻�ϸ�Ʒ��λ����Ҫ������
                    locIn.Code != BusinessConstants.SYSTEM_LOCATION_REJECT && locationLotDetail.Hu != null ? locationLotDetail.Hu.HuId : null,
                    locationLotDetail.LotNo,
                    locationLotDetail.CurrentInspectQty,     //��浥λ
                    isBillSettled ? false : locationLotDetail.IsConsignment,   //�Ѿ��������ֱ�Ӽ�Ϊ�Ǽ��ۿ��
                    isBillSettled ? null : (locationLotDetail.PlannedBill.HasValue ? this.plannedBillMgr.LoadPlannedBill(locationLotDetail.PlannedBill.Value) : null),      //�Ѿ��������ֱ�Ӽ�Ϊ�Ǽ��ۿ��
                    BusinessConstants.CODE_MASTER_LOCATION_TRANSACTION_TYPE_VALUE_RCT_INP,
                    null,
                //false,
                    user,
                    false,
                    false,
                    (locationLotDetail.Location.Code == BusinessConstants.SYSTEM_LOCATION_INSPECT && locIn.Code == BusinessConstants.SYSTEM_LOCATION_REJECT
                    ? locationLotDetail.RefLocation : (locIn.Code == BusinessConstants.SYSTEM_LOCATION_INSPECT ? locationLotDetail.Location.Code : null)) //�������λ���粻�ϸ�Ʒ��λ����Ҫ��RefLoc����ȥ
                    );
            #endregion

            #region ��¼�������
            if (inventoryTransactionList != null && inventoryTransactionList.Count > 0)
            {
                foreach (InventoryTransaction inventoryTransaction in inventoryTransactionList)
                {
                    this.locationTransactionMgr.RecordLocationTransaction(inventoryTransaction, BusinessConstants.CODE_MASTER_LOCATION_TRANSACTION_TYPE_VALUE_RCT_INP, user, inspectNo, locationLotDetail.Location, null, inrNo,inspectDetailId);
                }
            }
            #endregion

            #region �ϼ�
            if (bin != null)
            {
                LocationLotDetail oldLocationLotDetail = this.locationLotDetailMgr.LoadLocationLotDetail(inventoryTransactionList[0].LocationLotDetailId);
                this.InventoryPut(oldLocationLotDetail, user);
            }
            #endregion

            #region ��������״̬�Ϳ�λ
            if (locationLotDetail.Hu != null)
            {
                Hu hu = this.huMgr.LoadHu(locationLotDetail.Hu.HuId);
                if (locIn.Code == BusinessConstants.SYSTEM_LOCATION_REJECT)
                {
                    hu.Location = null;
                    hu.Qty = 0;
                    hu.Status = BusinessConstants.CODE_MASTER_HU_STATUS_VALUE_CLOSE;
                }
                else
                {
                    if (locIn != null)
                    {
                        hu.Location = locIn.Code;
                    }
                    hu.Status = BusinessConstants.CODE_MASTER_HU_STATUS_VALUE_INVENTORY;
                }
                this.huMgr.UpdateHu(hu);
            }
            #endregion

            return inventoryTransactionList;
        }
    protected void GV_Bin_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        StorageBin storageBin = new StorageBin();

        if(this.AreaCode != null && this.AreaCode != string.Empty)
        {
            storageBin.Area = TheStorageAreaMgr.LoadStorageArea(this.AreaCode);
        }
        storageBin.Code = ((Literal)this.GV_Bin.Rows[e.RowIndex].FindControl("ltlCode")).Text.Trim();
        storageBin.Description = ((TextBox)this.GV_Bin.Rows[e.RowIndex].FindControl("tbDescription")).Text.Trim();
        storageBin.IsActive = ((CheckBox)this.GV_Bin.Rows[e.RowIndex].FindControl("cbActive")).Checked;
        TheStorageBinMgr.UpdateStorageBin(storageBin);
        this.GV_Bin.EditIndex = -1;

        this.DoSearch();
        ShowSuccessMessage("MasterData.Location.UpdataBin.Successfully", storageBin.Code);
    }
 public virtual void UpdateStorageBin(StorageBin entity)
 {
     entityDao.UpdateStorageBin(entity);
 }
 public virtual void DeleteStorageBin(StorageBin entity)
 {
     entityDao.DeleteStorageBin(entity);
 }
 public virtual void CreateStorageBin(StorageBin entity)
 {
     entityDao.CreateStorageBin(entity);
 }
 private void BindData(bool includeBlank)
 {
     IList<StorageBin> binList = new List<StorageBin>();
     IListHelper.AddRange<StorageBin>(binList, this.StorageBinList);
     if (includeBlank)
     {
         StorageBin newBin = new StorageBin();
         newBin.IsBlank = true;
         binList.Add(newBin);
     }
     this.GV_List.DataSource = binList;
     this.GV_List.DataBind();
 }
        public IList<InventoryTransaction> InspectIn(LocationLotDetail locationLotDetail, Location locIn, StorageBin bin, User user, bool needSettle, string inspectNo)
        {
            bool isBillSettled = false;  //是否已经检验结算
            if (needSettle && locationLotDetail.IsConsignment && locationLotDetail.PlannedBill.HasValue)
            {
                PlannedBill plannedBill = this.plannedBillMgrE.LoadPlannedBill(locationLotDetail.PlannedBill.Value);
                if (plannedBill.SettleTerm == BusinessConstants.CODE_MASTER_BILL_SETTLE_TERM_VALUE_INSPECTION)
                {
                    isBillSettled = true;
                }
            }

            #region 入库
            IList<InventoryTransaction> inventoryTransactionList = RecordInventory(
                    locationLotDetail.Item,
                    locIn,
                //入不合格品库位,需要按数量
                    locIn.Code != BusinessConstants.SYSTEM_LOCATION_REJECT && locationLotDetail.Hu != null ? locationLotDetail.Hu.HuId : null,
                    locationLotDetail.LotNo,
                    locationLotDetail.CurrentInspectQty,     //库存单位
                    isBillSettled ? false : locationLotDetail.IsConsignment,   //已经检验结算直接记为非寄售库存
                    isBillSettled ? null : (locationLotDetail.PlannedBill.HasValue ? this.plannedBillMgrE.LoadPlannedBill(locationLotDetail.PlannedBill.Value) : null),      //已经检验结算直接记为非寄售库存
                    BusinessConstants.CODE_MASTER_LOCATION_TRANSACTION_TYPE_VALUE_RCT_INP,
                    null,
                //false,
                    user,
                    false,
                    false
                    );
            #endregion

            #region 记录库存事务
            if (inventoryTransactionList != null && inventoryTransactionList.Count > 0)
            {
                foreach (InventoryTransaction inventoryTransaction in inventoryTransactionList)
                {
                    this.locationTransactionMgrE.RecordLocationTransaction(inventoryTransaction, BusinessConstants.CODE_MASTER_LOCATION_TRANSACTION_TYPE_VALUE_RCT_INP, user, inspectNo, locationLotDetail.Location);
                }
            }
            #endregion

            #region 上架
            if (bin != null)
            {
                LocationLotDetail oldLocationLotDetail = this.locationLotDetailMgrE.LoadLocationLotDetail(inventoryTransactionList[0].LocationLotDetailId);
                this.InventoryPut(oldLocationLotDetail, user);
            }
            #endregion

            #region 更新条码状态和库位
            if (locationLotDetail.Hu != null)
            {
                Hu hu = this.huMgrE.LoadHu(locationLotDetail.Hu.HuId);
                if (locIn.Code == BusinessConstants.SYSTEM_LOCATION_REJECT)
                {
                    hu.Location = null;
                    hu.Qty = 0;
                    hu.Status = BusinessConstants.CODE_MASTER_HU_STATUS_VALUE_CLOSE;
                }
                else
                {
                    if (locIn != null)
                    {
                        hu.Location = locIn.Code;
                    }
                    hu.Status = BusinessConstants.CODE_MASTER_HU_STATUS_VALUE_INVENTORY;
                }
                this.huMgrE.UpdateHu(hu);
            }
            #endregion

            return inventoryTransactionList;
        }
Beispiel #12
0
 public void UpdateStorageBin(StorageBin storageBin)
 {
     TheStorageBinMgr.UpdateStorageBin(storageBin);
 }
Beispiel #13
0
 public void DeleteStorageBin(StorageBin storageBin)
 {
     TheStorageBinMgr.DeleteStorageBin(storageBin);
 }
Beispiel #14
0
 public void CreateStorageBin(StorageBin storageBin)
 {
     TheStorageBinMgr.CreateStorageBin(storageBin);
 }