Esempio n. 1
0
        /// <summary>
        /// 执行批次合并操作。
        /// </summary>
        public void ExecuteMergeLot()
        {
            DataSet dataSet  = new DataSet();
            DataSet dsReturn = new DataSet();

            //add the Merge lot to wip_transaction
            if (_codeTable.Rows.Count > 0)
            {
                _codeTable.TableName = BASE_PARAMETER_FIELDS.DATABASE_TABLE_NAME;
                dataSet.Tables.Add(_codeTable);
            }

            //update the quantity of parent Lot ---update por_lot
            Hashtable mainDataHashTable = new Hashtable();
            DataTable mainlotDataTable  = new DataTable();

            mainDataHashTable.Add(POR_LOT_FIELDS.FIELD_LOT_KEY, _lotKey);
            mainDataHashTable.Add(POR_LOT_FIELDS.FIELD_LOT_NUMBER, _lotNumber);
            mainDataHashTable.Add(POR_LOT_FIELDS.FIELD_QUANTITY, _quantity);
            mainDataHashTable.Add(WIP_TRANSACTION_FIELDS.FIELD_ACTIVITY_COMMENT, _comment);
            mainDataHashTable.Add(WIP_TRANSACTION_FIELDS.FIELD_EDITOR, _editor);
            mainDataHashTable.Add(WIP_TRANSACTION_FIELDS.FIELD_EDIT_TIMEZONE_KEY, _editTimeZone);
            mainDataHashTable.Add(WIP_TRANSACTION_FIELDS.FIELD_EDIT_TIME, _editTime);

            string operComputerName = PropertyService.Get(PROPERTY_FIELDS.COMPUTER_NAME);
            string shiftName        = _shiftName;
            string shiftKey         = string.Empty;
            Shift  shift            = new Shift();

            if (string.IsNullOrEmpty(shiftName))
            {
                shiftName = shift.GetCurrShiftName();
            }
            shiftKey = shift.IsShiftValueExists(shiftName);
            mainDataHashTable.Add(WIP_TRANSACTION_FIELDS.FIELD_OPR_COMPUTER, operComputerName);
            mainDataHashTable.Add(WIP_TRANSACTION_FIELDS.FIELD_SHIFT_KEY, shiftKey);
            mainDataHashTable.Add(WIP_TRANSACTION_FIELDS.FIELD_SHIFT_NAME, shiftName);
            mainlotDataTable           = SolarViewer.Hemera.Share.Common.CommonUtils.ParseToDataTable(mainDataHashTable);
            mainlotDataTable.TableName = TRANS_TABLES.TABLE_MAIN_DATA;

            dataSet.Tables.Add(mainlotDataTable);

            try
            {
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();
                if (null != serverFactory)
                {
                    dsReturn  = serverFactory.CreateIWipEngine().MergeLot(dataSet);
                    _errorMsg = SolarViewer.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                }
            }
            catch (Exception ex)
            {
                _errorMsg = ex.Message;
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 将线边仓中的批次进行合并。
        /// </summary>
        /// comment by peter 2012-2-23
        public void ExecuteMergeLotInStore()
        {
            DataSet dataSet  = new DataSet();
            DataSet dsReturn = new DataSet();

            //add the Merge lot to wip_transaction
            if (_codeTable.Rows.Count > 0)
            {
                _codeTable.TableName = BASE_PARAMETER_FIELDS.DATABASE_TABLE_NAME;
                dataSet.Tables.Add(_codeTable);//待合并的批次返工或退库数据
            }

            Hashtable mainDataHashTable = new Hashtable();
            DataTable mainlotDataTable  = new DataTable();

            mainDataHashTable.Add(WST_STORE_MAT_FIELDS.FIELD_ROW_KEY, _rowKey);                     //合并到批次的返工或退库记录的主键
            mainDataHashTable.Add(POR_LOT_FIELDS.FIELD_LOT_NUMBER, _lotNumber);                     //合并到批次的批次号
            mainDataHashTable.Add(POR_LOT_FIELDS.FIELD_QUANTITY, _quantity);                        //合并后批次的数量
            mainDataHashTable.Add(WIP_TRANSACTION_FIELDS.FIELD_EDITOR, _editor);                    //编辑人
            mainDataHashTable.Add(WIP_TRANSACTION_FIELDS.FIELD_EDIT_TIMEZONE_KEY, _editTimeZone);   //编辑时区
            mainDataHashTable.Add(WIP_TRANSACTION_FIELDS.FIELD_EDIT_TIME, _editTime);               //编辑时间
            mainDataHashTable.Add(POR_LOT_FIELDS.FIELD_LOT_KEY, _lotKey);                           //批次主键
            mainlotDataTable           = SolarViewer.Hemera.Share.Common.CommonUtils.ParseToDataTable(mainDataHashTable);
            mainlotDataTable.TableName = TRANS_TABLES.TABLE_MAIN_DATA;
            dataSet.Tables.Add(mainlotDataTable);

            try
            {
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();
                if (null != serverFactory)
                {
                    dsReturn  = serverFactory.CreateIWipEngine().MergeLotInStore(dataSet);
                    _errorMsg = SolarViewer.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                }
            }
            catch (Exception ex)
            {
                _errorMsg = ex.Message;
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Search Conform Lot
        /// </summary>
        public DataSet SearchLotsForMerge()
        {
            DataSet dsReturn = new DataSet();

            try
            {
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();
                if (null != serverFactory)
                {
                    dsReturn  = serverFactory.CreateIWipEngine().GetLotsForMerge(_lotKey);
                    _errorMsg = SolarViewer.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                }
            }
            catch (Exception ex)
            {
                _errorMsg = ex.Message;
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
            return(dsReturn);
        }