Пример #1
0
        ///方法
        private void BindData()
        {
            string strPartId     = txtPartId.Text.Trim();
            string strPartType   = txtPartType.Text.Trim();
            string strPartModule = txtMoudle.Text.Trim();
            string strPartClass  = txtClass.Text.Trim();
            ByProductPartEntity ByProductPartEntity = new ByProductPartEntity();
            PagingQueryConfig   config = new PagingQueryConfig()
            {
                PageNo   = pgnQueryResult.PageNo,
                PageSize = pgnQueryResult.PageSize
            };
            DataSet dsReturn = ByProductPartEntity.GetByFourParameters(strPartId, strPartType, strPartModule, strPartClass, ref config);

            pgnQueryResult.Pages   = config.Pages;
            pgnQueryResult.Records = config.Records;
            if (!string.IsNullOrEmpty(ByProductPartEntity.ErrorMsg))
            {
                MessageService.ShowMessage(ByProductPartEntity.ErrorMsg);
                return;
            }
            if (dsReturn.Tables.Count > 0)
            {
                gcList.DataSource = dsReturn.Tables[0].DefaultView;
                gcList.MainView   = gvList;
                gvList.BestFitColumns();
            }
        }
Пример #2
0
        private void BindWorkOrderInfo()
        {
            PagingQueryConfig config = new PagingQueryConfig()
            {
                PageNo   = pgnWorkOrderInfoList.PageNo,
                PageSize = pgnWorkOrderInfoList.PageSize
            };
            WorkOrders workOrders = new WorkOrders();

            this.Factory     = this.cbeFactory.Text;
            this.Status      = this.cbeStatus.Text;
            this.WorkOrderNo = this.teWorkOrderNo.Text;
            this.PartNo      = this.tePart.Text;
            this.Type        = this.cbeType.Text;
            this.Store       = this.teStore.Text;
            DataSet ds = workOrders.GetWorkOrderByCondition(this.Factory, this.WorkOrderNo,
                                                            this.PartNo, this.Type, this.Store, this.Status, ref config);

            pgnWorkOrderInfoList.Pages   = config.Pages;
            pgnWorkOrderInfoList.Records = config.Records;
            if (string.IsNullOrEmpty(workOrders.ErrorMsg))
            {
                Content.MainView   = gridView1;
                Content.DataSource = ds.Tables[0];
                gridView1.BestFitColumns();
            }
            else
            {
                MessageService.ShowMessage(workOrders.ErrorMsg);
            }
        }
Пример #3
0
        /// <summary>
        /// 绑定领料项目列表。
        /// </summary>
        /// <param name="paramTable"></param>
        private void BindReceiveMaterialList(DataTable paramTable)
        {
            ReceiveMaterialEntity receiveMaterial = new ReceiveMaterialEntity();
            PagingQueryConfig     config          = new PagingQueryConfig()
            {
                PageNo   = pgnQueryResult.PageNo,
                PageSize = pgnQueryResult.PageSize
            };
            DataSet dsReturn = receiveMaterial.GetReceiveMaterialHistory(paramTable, ref config);

            pgnQueryResult.Pages   = config.Pages;
            pgnQueryResult.Records = config.Records;

            if (string.IsNullOrEmpty(receiveMaterial.ErrorMsg))
            {
                gdcView.MainView   = gdvReceiveMaterialList;
                gdcView.DataSource = dsReturn.Tables[0];
                gdvReceiveMaterialList.Invalidate();
                gdvReceiveMaterialList.OptionsView.ColumnAutoWidth = false;
                gdvReceiveMaterialList.BestFitColumns();
            }
            else
            {
                MessageBox.Show(receiveMaterial.ErrorMsg);
            }
        }
Пример #4
0
        /// <summary>
        /// 工单清单。
        /// </summary>
        /// <param name="pconfig">分页设置对象。</param>
        /// <returns>包含工单数据的数据集。</returns>
        public DataSet GetWorkOrderInfoList(ref PagingQueryConfig config)
        {
            DataSet dsReturn = new DataSet();

            try
            {
                //调用远程对象
                IServerObjFactory factor = CallRemotingService.GetRemoteObject();
                if (null != factor)
                {
                    dsReturn = factor.CreateIWorkOrders().GetWorkOrderInfoList(ref config);
                    string returnMessage = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                    //若返回错误消息,则显示
                    if (returnMessage.Length > 0)
                    {
                        MessageService.ShowError(returnMessage);
                    }
                    else
                    {
                        return(dsReturn);
                    }
                }
            }
            catch (Exception e)
            {
                MessageService.ShowError(e);
            }
            finally
            {
                //注销通道
                CallRemotingService.UnregisterChannel();
            }
            return(dsReturn);
        }
Пример #5
0
        /// <summary>
        /// 绑定查询数据。
        /// </summary>
        public void BindData()
        {
            OnlineMaterialQueryModel model = new OnlineMaterialQueryModel(this.Model);

            if (string.IsNullOrEmpty(model.StoreName))
            {
                model.StoreName = PropertyService.Get(PROPERTY_FIELDS.STORES);
            }
            if (string.IsNullOrEmpty(model.OperationName))
            {
                model.OperationName = PropertyService.Get(PROPERTY_FIELDS.OPERATIONS);
            }
            PagingQueryConfig config = new PagingQueryConfig()
            {
                PageNo   = pgnQueryResult.PageNo,
                PageSize = pgnQueryResult.PageSize
            };
            DataSet dsReturn = this._entity.Query(model, ref config);

            pgnQueryResult.Pages   = config.Pages;
            pgnQueryResult.Records = config.Records;
            if (!string.IsNullOrEmpty(this._entity.ErrorMsg))
            {
                MessageService.ShowMessage(this._entity.ErrorMsg);
                return;
            }
            if (dsReturn.Tables.Count > 0)
            {
                gcResult.DataSource = dsReturn.Tables[0];
                gcResult.MainView   = gvResult;
                gvResult.BestFitColumns();
            }
        }
Пример #6
0
        /// <summary>
        /// 绑定预设暂停的批次数据到控件中。
        /// </summary>
        private void BindFutureHoldLotToControl()
        {
            FutureHoldEntity entity   = new FutureHoldEntity();
            DataSet          dsParams = new DataSet();

            Hashtable htParams = new Hashtable();

            if (!string.IsNullOrEmpty(this._factoryRoomKey))
            {
                htParams.Add(POR_LOT_FIELDS.FIELD_FACTORYROOM_KEY, this._factoryRoomKey);
            }
            if (!string.IsNullOrEmpty(this._lotNo))
            {
                htParams.Add(WIP_FUTUREHOLD_FIELDS.FIELDS_LOT_NUMBER, this._lotNo);
            }
            if (!string.IsNullOrEmpty(this._operationName))
            {
                htParams.Add(WIP_FUTUREHOLD_FIELDS.FIELDS_OPERATION_NAME, this._operationName);
            }
            if (!string.IsNullOrEmpty(this._workOrderNo))
            {
                htParams.Add(WIP_FUTUREHOLD_FIELDS.FIELDS_WORKORDER_NUMBER, this._workOrderNo);
            }
            if (!string.IsNullOrEmpty(this._action))
            {
                htParams.Add(WIP_FUTUREHOLD_FIELDS.FIELDS_ACTION_NAME, this._action);
            }
            DataTable dtParams = FanHai.Hemera.Share.Common.CommonUtils.ParseToDataTable(htParams);

            dsParams.Tables.Add(dtParams);
            PagingQueryConfig config = new PagingQueryConfig()
            {
                PageNo   = pgnQueryResult.PageNo,
                PageSize = pgnQueryResult.PageSize
            };
            DataSet ds = entity.Query(dsParams, ref config);

            pgnQueryResult.Pages   = config.Pages;
            pgnQueryResult.Records = config.Records;
            if (string.IsNullOrEmpty(entity.ErrorMsg))
            {
                this.gcLot.DataSource = ds.Tables[0];
                gvLot.BestFitColumns();
            }
            else
            {
                MessageService.ShowMessage(entity.ErrorMsg, MESSAGEBOX_CAPTION);
            }
        }
Пример #7
0
        /// <summary>
        /// 接口方法的实现
        /// </summary>
        /// Q.001
        private void paginationControl1_DataPaging()
        {
            PagingQueryConfig config = new PagingQueryConfig()
            {
                PageNo   = paginationControl1.PageNo,
                PageSize = paginationControl1.PageSize
            };
            DataSet dsHis = edcPoint.GetEdcPointParamsTrans(ref config);

            if (dsHis.Relations.Count > 0)
            {
                paginationControl1.Pages         = config.Pages;
                paginationControl1.Records       = config.Records;
                this.gcHistoryResults.DataSource = dsHis.Relations[0].ParentTable;
            }
        }
Пример #8
0
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void QueryBtn_Click(object sender, EventArgs e)
        {
            DataSet           dsParams = this.GetQueryCondition();
            PagingQueryConfig config   = new PagingQueryConfig()
            {
                PageNo   = pgnQueryResult.PageNo,
                PageSize = pgnQueryResult.PageSize
            };
            DataSet dsReturn = this._entity.Query(dsParams, ref config);

            if (!string.IsNullOrEmpty(this._entity.ErrorMsg))
            {
                MessageService.ShowMessage(this._entity.ErrorMsg);
                return;
            }
            pgnQueryResult.Pages   = config.Pages;
            pgnQueryResult.Records = config.Records;
            if (dsReturn.Tables.Count > 0)
            {
                DataTable dt = dsReturn.Tables[0];

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if (dt.Rows[i]["ISSYN"].ToString() == "0")
                    {
                        dt.Rows[i]["ISSYN"] = "未同步";
                    }
                    else
                    {
                        dt.Rows[i]["ISSYN"] = "已同步";
                    }
                }

                gridControl1.DataSource    = dt;
                this.gridControl1.MainView = gridView1;
            }
            if (gridView1.RowCount > 0)
            {
                gridView1.SelectRow(0);
                SelectedRowChanged(gridView1);
            }
            else
            {
                gridControl2.DataSource = null;
            }
        }
Пример #9
0
        /// <summary>
        /// 查询外向交货单出库记录
        /// </summary>
        /// <param name="dsParam"></param>
        /// <param name="PQConf"></param>
        /// <param name="status"></param>
        /// <returns></returns>
        public DataSet Query(DataSet dsParam, ref PagingQueryConfig PQConf)
        {
            DataSet dsReturn = null;

            try
            {
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();
                dsReturn = serverFactory.Get <IOutboundOperationEngine>().Query(dsParam, ref PQConf);
            }
            catch (Exception ex)
            {
                _errorMsg = ex.Message;
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
            return(dsReturn);
        }
Пример #10
0
        /// <summary>
        /// 查询入库单记录。
        /// </summary>
        /// <param name="dsParams">包含查询条件的数据集。</param>
        /// <param name="config">分页配置对象。</param>
        /// <returns>包含出货信息的数据集对象。</returns>
        public DataSet Query(DataSet dsParams, ref PagingQueryConfig config)
        {
            DataSet dsReturn = null;

            try
            {
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();
                dsReturn  = serverFactory.Get <IWarehouseWarrantOperationEngine>().QueryWarehouseWarrant(dsParams, ref config);
                _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
            }
            catch (Exception ex)
            {
                _errorMsg = ex.Message;
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
            return(dsReturn);
        }
Пример #11
0
        /// <summary>
        /// 捞取修改抽检点的his
        /// </summary>
        /// <param name="?"></param>
        /// <returns></returns>
        /// Q.003
        public DataSet GetEdcPointParamsTrans(ref PagingQueryConfig config)
        {
            DataSet dsReturn = new DataSet();

            try
            {
                IServerObjFactory obj = CallRemotingService.GetRemoteObject();
                dsReturn  = obj.CreateIEDCPiont().GetEdcPiontParamsTrans(_pointRowKey, ref config);
                _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
            }
            catch (Exception ex)
            {
                _errorMsg = ex.Message;
            }
            finally
            {
                CallRemotingService.GetRemoteObject();
            }
            return(dsReturn);
        }
Пример #12
0
        /// <summary>
        /// 查询在线物料信息。
        /// </summary>
        /// <param name="model">
        /// 包含查询条件对象。
        /// </param>
        /// <param name="pconfig">
        /// 分页查询的配置对象。
        /// </param>
        /// <returns>包含在线物料信息的数据集。</returns>
        public DataSet Query(OnlineMaterialQueryModel model, ref PagingQueryConfig pconfig)
        {
            DataSet dsReturn = null;

            try
            {
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();
                dsReturn  = serverFactory.CreateIOnlineMaterialQueryEngine().Query(model, ref pconfig);
                _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
            }
            catch (Exception ex)
            {
                _errorMsg = ex.Message;
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
            return(dsReturn);
        }
Пример #13
0
        /// <summary>
        /// 查询包含托盘信息及其组件序列号的数据集。
        /// </summary>
        /// <param name="dsSearch">
        /// 包含查询条件的数据集。
        /// </param>
        /// <param name="pconfig">
        /// 分页查询的配置对象。
        /// </param>
        /// <returns>包含托盘信息及其组件序列号的数据集。。</returns>
        public DataSet QueryDetail(DataSet dsParams, ref PagingQueryConfig pconfig)
        {
            DataSet dsReturn = null;

            try
            {
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();
                dsReturn  = serverFactory.Get <IPalletQueryEngine>().SearchPalletDetailList(dsParams, ref pconfig);
                _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
            }
            catch (Exception ex)
            {
                _errorMsg = ex.Message;
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
            return(dsReturn);
        }
Пример #14
0
        public DataSet GetMaterialSendingList(DataTable paramTable, ref PagingQueryConfig config)
        {
            DataSet dsReturn = new DataSet();

            try
            {
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();
                dsReturn  = serverFactory.CreateIMaterialReqOrReturnEngine().GetMaterialSendingList(paramTable, ref config);
                _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
            }
            catch (Exception ex)
            {
                _errorMsg = ex.Message;
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }

            return(dsReturn);
        }
Пример #15
0
        /// <summary>
        /// 绑定查询结果。
        /// </summary>
        private void BindQueryResult()
        {
            string palletNo = this.tePalletNo.Text.Trim();
            //查询批次
            PagingQueryConfig config = new PagingQueryConfig()
            {
                PageNo   = pgnQueryResult.PageNo,
                PageSize = pgnQueryResult.PageSize
            };
            //组织查询参数。
            DataSet   dsParams = new DataSet();
            Hashtable htParams = new Hashtable();

            htParams.Add(WIP_CONSIGNMENT_FIELDS.FIELDS_VIRTUAL_PALLET_NO, palletNo);
            if (!string.IsNullOrEmpty(this._model.RoomKey))
            {
                htParams.Add(WIP_CONSIGNMENT_FIELDS.FIELDS_ROOM_KEY, this._model.RoomKey);
            }
            htParams.Add(WIP_CONSIGNMENT_FIELDS.FIELDS_CS_DATA_GROUP, (int)this._model.PalletState);
            DataTable dtParams = CommonUtils.ParseToDataTable(htParams);

            dtParams.TableName = TRANS_TABLES.TABLE_MAIN_DATA;
            dsParams.Tables.Add(dtParams);
            //进行查询
            DataSet dsReturn = _entity.Query(dsParams, ref config);

            pgnQueryResult.Pages   = config.Pages;
            pgnQueryResult.Records = config.Records;
            if (!string.IsNullOrEmpty(_entity.ErrorMsg))
            {
                MessageService.ShowMessage(_entity.ErrorMsg);
                return;
            }
            else
            {
                gcResult.DataSource = dsReturn.Tables[0];
                gcResult.MainView   = gvResult;
            }
        }
Пример #16
0
        /// <summary>
        /// 查询离线数据采集数据。
        /// </summary>
        /// <param name="dtParams">数据采集实例。</param>
        /// <param name="config">分页配置对象。</param>
        /// <returns>包含数据采集数据的数据集对象。</returns>
        public DataSet QueryEDCData(DataTable dtParams, ref PagingQueryConfig config)
        {
            DataSet dsReturn = new DataSet();

            try
            {
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();
                if (null != serverFactory)
                {
                    dsReturn  = serverFactory.CreateIEDCEngine().QueryEDCData(dtParams, ref config);
                    _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                }
            }
            catch (Exception ex)
            {
                _errorMsg = ex.Message;
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
            return(dsReturn);
        }
Пример #17
0
        /// <summary>
        /// 查询按钮Click事件。
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnQuery_Click(object sender, EventArgs e)
        {
            DataSet           dsParams = this.GetQueryCondition();
            PagingQueryConfig config   = new PagingQueryConfig()
            {
                PageNo   = pgnQueryResult.PageNo,
                PageSize = pgnQueryResult.PageSize
            };
            DataSet dsReturn = this._entity.Query(dsParams, ref config);

            pgnQueryResult.Pages   = config.Pages;
            pgnQueryResult.Records = config.Records;
            if (!string.IsNullOrEmpty(this._entity.ErrorMsg))
            {
                MessageService.ShowMessage(this._entity.ErrorMsg);
                return;
            }
            if (dsReturn.Tables.Count > 0)
            {
                gcList.DataSource = dsReturn.Tables[0];
                gcList.MainView   = gvList;
                gvList.BestFitColumns();
            }
        }
Пример #18
0
        /// <summary>
        /// 绑定设备物料看板。
        /// </summary>
        /// <param name="paramTable"></param>
        private void BindMaterialList(DataTable paramTable)
        {
            PagingQueryConfig config = new PagingQueryConfig()
            {
                PageNo   = pgnQueryResult.PageNo,
                PageSize = pgnQueryResult.PageSize
            };
            DataSet dsReturn = materialReqOrReturnEntity.GetEquMaterialInf(paramTable, ref config);

            pgnQueryResult.Pages   = config.Pages;
            pgnQueryResult.Records = config.Records;

            if (string.IsNullOrEmpty(materialReqOrReturnEntity.ErrorMsg))
            {
                gdcView.MainView   = gdvMaterialList;
                gdcView.DataSource = dsReturn.Tables[0];
                gdvMaterialList.Invalidate();
                gdvMaterialList.BestFitColumns();
            }
            else
            {
                MessageBox.Show(materialReqOrReturnEntity.ErrorMsg);
            }
        }
Пример #19
0
        /// <summary>
        /// 绑定查询结果。
        /// </summary>
        private void BindQueryResult()
        {
            string lotNumber = this.teLotNumber.Text.Trim();
            //查询批次
            PagingQueryConfig config = new PagingQueryConfig()
            {
                PageNo   = pgnQueryResult.PageNo,
                PageSize = pgnQueryResult.PageSize
            };
            //组织查询参数。
            DataSet   dsParams = new DataSet();
            Hashtable htParams = new Hashtable();

            htParams.Add(POR_LOT_FIELDS.FIELD_LOT_NUMBER, lotNumber);
            htParams.Add(POR_LOT_FIELDS.FIELD_FACTORYROOM_KEY, this._model.RoomKey);
            switch (_model.OperationType)
            {
            case LotOperationType.CellScrap:
            case LotOperationType.CellDefect:
            case LotOperationType.ReturnMaterial:
                htParams.Add(POR_LOT_FIELDS.FIELD_HOLD_FLAG, 0);                    //0:未暂停的批次;1:暂停的批次。
                htParams.Add(POR_LOT_FIELDS.FIELD_DELETED_TERM_FLAG, 0);            //0:未结束未删除 1:已结束 2:已删除
                break;

            case LotOperationType.Scrap:
            case LotOperationType.Defect:
            case LotOperationType.Terminal:
            case LotOperationType.Merge:
            case LotOperationType.Split:
                htParams.Add(POR_LOT_FIELDS.FIELD_HOLD_FLAG, 0);                    //0:未暂停的批次;1:暂停的批次。
                htParams.Add(POR_LOT_FIELDS.FIELD_LOT_TYPE, "N");                   //N:生产批次 L:组件补片批次
                htParams.Add(POR_LOT_FIELDS.FIELD_DELETED_TERM_FLAG, 0);            //0:未结束未删除 1:已结束 2:已删除
                break;

            case LotOperationType.CellPatch:
            case LotOperationType.CellRecovered:
                htParams.Add(POR_LOT_FIELDS.FIELD_HOLD_FLAG, 0);                    //0:未暂停的批次;1:暂停的批次。
                htParams.Add(POR_LOT_FIELDS.FIELD_LOT_TYPE, "L");                   //N:生产批次 L:组件补片批次
                htParams.Add(POR_LOT_FIELDS.FIELD_DELETED_TERM_FLAG, 0);            //0:未结束未删除 1:已结束 2:已删除
                break;

            case LotOperationType.Adjust:
            case LotOperationType.BatchAdjust:
            case LotOperationType.Hold:
            case LotOperationType.BatchHold:
                htParams.Add(POR_LOT_FIELDS.FIELD_HOLD_FLAG, 0);                //0:未暂停的批次;1:暂停的批次。
                htParams.Add(POR_LOT_FIELDS.FIELD_DELETED_TERM_FLAG, 0);        //0:未结束未删除 1:已结束 2:已删除
                break;

            case LotOperationType.Release:
            case LotOperationType.BatchRelease:
            case LotOperationType.Rework:
            case LotOperationType.BatchRework:
                htParams.Add(POR_LOT_FIELDS.FIELD_HOLD_FLAG, 1);                //0:未暂停的批次;1:暂停的批次。
                htParams.Add(POR_LOT_FIELDS.FIELD_DELETED_TERM_FLAG, 0);        //0:未结束未删除 1:已结束 2:已删除
                break;

            case LotOperationType.Dispatch:
                htParams.Add(POR_LOT_FIELDS.FIELD_HOLD_FLAG, 0);                                                    //0:未暂停的批次;1:暂停的批次。
                htParams.Add(POR_LOT_FIELDS.FIELD_LOT_TYPE, "N");                                                   //N:生产批次 L:组件补片批次
                htParams.Add(POR_LOT_FIELDS.FIELD_DELETED_TERM_FLAG, 0);                                            //0:未结束未删除 1:已结束 2:已删除
                htParams.Add(POR_ROUTE_OPERATION_VER_FIELDS.FIELD_ROUTE_OPERATION_NAME, this._model.OperationName); //工序名称
                break;

            default:
                break;
            }
            DataTable dtParams = CommonUtils.ParseToDataTable(htParams);

            dtParams.TableName = TRANS_TABLES.TABLE_MAIN_DATA;
            dsParams.Tables.Add(dtParams);
            //进行查询
            DataSet dsReturn = _entity.Query(dsParams, ref config);

            pgnQueryResult.Pages   = config.Pages;
            pgnQueryResult.Records = config.Records;
            if (!string.IsNullOrEmpty(_entity.ErrorMsg))
            {
                MessageService.ShowMessage(_entity.ErrorMsg);
                return;
            }
            else
            {
                gcResult.DataSource = dsReturn.Tables[0];
                gcResult.MainView   = gvResult;
            }
        }
Пример #20
0
        /// <summary>
        /// 查询在线物料。
        /// </summary>
        /// <param name="model">查询条件。</param>
        /// <param name="pconfig">分页对象。</param>
        /// <returns>包含在线物料信息的数据集对象。</returns>
        public DataSet Query(OnlineMaterialQueryModel model, ref PagingQueryConfig pconfig)
        {
            DataSet       dsReturn = new DataSet();
            StringBuilder sbSql    = new StringBuilder();

            try
            {
                sbSql.Append(@"SELECT A.STORE_MATERIAL_KEY ,
                                  SUM(A.CURRENT_QTY)AS QTY,
                                  C.STORE_NAME AS STORE_NAME,
                                  D.MATERIAL_CODE AS  MATERIAL_CODE,
                                  D.MATERIAL_NAME AS  MATERIAL_NAME,
                                  D.UNIT AS  UNIT, 
                                  E.LOCATION_NAME AS ROOM_NAME,
                                  C.OPERATION_NAME AS  OPERATION_NAME  
                            FROM WST_STORE_MATERIAL_DETAIL A 
                            LEFT JOIN WST_STORE_MATERIAL B ON A.STORE_MATERIAL_KEY=B.STORE_MATERIAL_KEY
                            LEFT JOIN WST_STORE C ON B.STORE_KEY=C.STORE_KEY
                            LEFT JOIN POR_MATERIAL D ON B.MATERIAL_KEY=D.MATERIAL_KEY
                            LEFT JOIN FMM_LOCATION E ON C.LOCATION_KEY=E.LOCATION_KEY
                            WHERE CURRENT_QTY>0 ");
                if (!string.IsNullOrEmpty(model.OperationName))
                {
                    sbSql.AppendFormat(UtilHelper.BuilderWhereConditionString("C.OPERATION_NAME", model.OperationName.Split(',')));
                }

                if (!string.IsNullOrEmpty(model.StoreName))
                {
                    sbSql.AppendFormat(UtilHelper.BuilderWhereConditionString("C.STORE_NAME", model.StoreName.Split(',')));
                }

                if (!string.IsNullOrEmpty(model.MaterialCode))
                {
                    sbSql.AppendFormat(" AND D.MATERIAL_CODE  LIKE '{0}%'", model.MaterialCode.PreventSQLInjection());
                }
                if (!string.IsNullOrEmpty(model.MaterialLot))
                {
                    sbSql.AppendFormat(" AND A.MATERIAL_LOT  LIKE '{0}%'", model.MaterialLot.PreventSQLInjection());
                }
                if (!string.IsNullOrEmpty(model.RoomName))
                {
                    sbSql.AppendFormat(" AND E.LOCATION_NAME  LIKE '{0}%'", model.RoomName.PreventSQLInjection());
                }
                if (!string.IsNullOrEmpty(model.SupplierName))
                {
                    sbSql.AppendFormat(" AND A.MATERIAL_SUPPLIER  LIKE '{0}%'", model.SupplierName.PreventSQLInjection());
                }

                sbSql.Append(@" GROUP BY A.STORE_MATERIAL_KEY,C.STORE_NAME,D.MATERIAL_CODE,E.LOCATION_NAME,
                               D.MATERIAL_NAME,D.UNIT, E.LOCATION_NAME,C.OPERATION_NAME ");
                int pages   = 0;
                int records = 0;
                AllCommonFunctions.CommonPagingData(sbSql.ToString(),
                                                    pconfig.PageNo,
                                                    pconfig.PageSize,
                                                    out pages,
                                                    out records,
                                                    db,
                                                    dsReturn,
                                                    "WST_STORE_MATERIAL",
                                                    "MATERIAL_CODE ASC");
                pconfig.Pages   = pages;
                pconfig.Records = records;
                ReturnMessageUtils.AddServerReturnMessage(dsReturn, string.Empty);
            }
            catch (Exception ex)
            {
                ReturnMessageUtils.AddServerReturnMessage(dsReturn, ex.Message);
                LogService.LogError("SearchLotList Error: " + ex.Message);
            }
            return(dsReturn);
        }
Пример #21
0
        //查询按钮事件
        private void tsbSearch_Click(object sender, EventArgs e)
        {
            string OutboundNo = this.txtOutboundNo.Text.Trim();
            string VbelnNo    = this.txtVbeln.Text.Trim();
            bool   QcResult   = true;

            if ((OutboundNo.Length == 0) && (VbelnNo.Length == 0))
            {
                MessageBox.Show("请输入出货单号或外向交货单号!");
                gcList.DataSource = null;
                this.txtOutboundNo.Select();
                return;
            }

            //根据外向交货单号或出库单号取抬头数据
            DataSet dsOutboudInfo = this._entity.getOutboudInfo(OutboundNo, VbelnNo, "", "");

            if (dsOutboudInfo.Tables[0].Rows.Count <= 0)
            {
                MessageBox.Show("没有您指定查询条件下的出货单抬头信息!");
                return;
            }
            else if (dsOutboudInfo.Tables[0].Rows.Count > 1)
            {
                ShowBillNo SBillNo = new ShowBillNo(dsOutboudInfo.Tables[0]);
                SBillNo.pOutboundQCControl = this;
                SBillNo.ShowDialog();
            }
            else
            {
                retIdx = 0;
            }
            if (retIdx >= 0)
            {
                DataRow dr = dsOutboudInfo.Tables[0].Rows[retIdx];
                txtCreatedate.Text  = (dr["ERDAT"].ToString()).Substring(0, 10); //
                txtCreator.Text     = dr["CREATED_BY"].ToString();               //
                txtSalesto.Text     = dr["SALESTO"].ToString();                  //
                txtSalestoName.Text = dr["SHIPTO"].ToString();                   //
                txtShipto.Text      = dr["SALESTO_NAME"].ToString();             //
                txtShiptoName.Text  = dr["SHIPTO_NAME"].ToString();              //
                txtVbeln.Text       = dr["VBELN"].ToString();                    //
                txtOutboundNo.Text  = dr["OUTBANDNO"].ToString();                //
                txtStatus.Text      = dr["status"].ToString();                   //
            }


            PagingQueryConfig config = new PagingQueryConfig()
            {
                PageNo   = pgnQueryResult.PageNo,
                PageSize = pgnQueryResult.PageSize
            };
            //根据查询条件取外向交货单明细数据
            DataSet dsParam = this.GetQueryCondition();

            DataSet dsReturn = this._entity.Query(dsParam, ref config);

            pgnQueryResult.Pages   = config.Pages;
            pgnQueryResult.Records = config.Records;

            if (!string.IsNullOrEmpty(this._entity.ErrorMsg))
            {
                MessageService.ShowMessage(this._entity.ErrorMsg);
                return;
            }
            if (dsReturn.Tables.Count > 0)
            {
                //DataSet dsView=null;
                //if (this.txtStatus.Text.Trim() == "已确认")
                //{
                //    dsView = this.AddColumnDataSet(dsReturn);
                //}
                //else
                //    dsView = dsReturn;

                gcList.DataSource = dsReturn.Tables[0];
                gcList.MainView   = gvList;
                gvList.BestFitColumns();
                this.gvList.OptionsView.ColumnAutoWidth = false;
                this.SetComboBox();

                if (this.txtStatus.Text.Trim() == "已检验")
                {
                    gvList.OptionsBehavior.ReadOnly = true;
                    DataTable dt = dsReturn.Tables[0];
                    foreach (DataRow dr in dt.Rows)
                    {
                        if (Convert.ToString(dr["QC_RESULT"]) == "不合格")
                        {
                            QcResult = false;
                        }
                    }
                    this.tsbSave.Enabled    = false;
                    this.tsbEdit.Enabled    = true;
                    this.tsbDelete.Enabled  = true;
                    this.tsbComfirm.Enabled = false;
                    if (QcResult == true)
                    {
                        this.tsbComfirm.Enabled = true;
                    }
                }
                else if (this.txtStatus.Text.Trim() == "已确认")
                {
                    gvList.OptionsBehavior.ReadOnly = false;
                    this.tsbSave.Enabled            = true;
                    this.tsbComfirm.Enabled         = false;
                    this.tsbEdit.Enabled            = false;
                    this.tsbDelete.Enabled          = false;
                }
                else if (this.txtStatus.Text.Trim() == "已过账")
                {
                    gvList.OptionsBehavior.ReadOnly = true;
                    this.tsbSave.Enabled            = false;
                    this.tsbComfirm.Enabled         = false;
                    this.tsbEdit.Enabled            = false;
                    this.tsbDelete.Enabled          = true;
                }
            }
            else
            {
                MessageBox.Show("没有您指定查询条件下的出货单明细!");
                return;
            }
        }
Пример #22
0
        /// <summary>
        /// 查询按钮Click事件。
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnQuery_Click(object sender, EventArgs e)
        {
            string palletNo = this.tePalletNo.Text.Trim();

            if (palletNo.Length > 2048)
            {
                MessageBox.Show("托盘号长度必须小于等于2048个字符。");
                this.tePalletNo.Select();
                return;
            }
            DataSet           dsParams = this.GetQueryCondition();
            PagingQueryConfig config   = new PagingQueryConfig()
            {
                PageNo   = pgnQueryResult.PageNo,
                PageSize = pgnQueryResult.PageSize
            };
            DataSet dsReturn = this._entity.Query(dsParams, ref config);

            pgnQueryResult.Pages   = config.Pages;
            pgnQueryResult.Records = config.Records;
            if (!string.IsNullOrEmpty(this._entity.ErrorMsg))
            {
                MessageService.ShowMessage(this._entity.ErrorMsg);
                return;
            }
            if (dsReturn.Tables.Count > 0)
            {
                DataTable dt = dsReturn.Tables[0];
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    string strtest = dt.Rows[i]["SHIPMENT_TYPE"].ToString().Equals("0").ToString();
                    if (dt.Rows[i]["CUSTCHECK"].ToString() == "0")
                    {
                        dt.Rows[i]["CUSTCHECK"] = "未客检";
                    }
                    else if (dt.Rows[i]["CUSTCHECK"].ToString() == "1")
                    {
                        dt.Rows[i]["CUSTCHECK"] = "已客检";
                    }

                    if (dt.Rows[i]["CONTAINER_NO"].ToString().Equals(""))
                    {
                        dt.Rows[i]["HFLAG"] = "1";
                    }
                    //if (dt.Rows[i]["SHIPMENT_NO"].ToString().Equals(""))
                    //{
                    //    dt.Rows[i].Delete();
                    //}
                    //if (dt.Rows[i]["SHIPMENT_TYPE"].ToString().Equals("0"))
                    //{
                    //    dt.Rows[i]["SHIPMENT_TYPE"] = "陆运";
                    //}
                    //else if(dt.Rows[i]["SHIPMENT_TYPE"].ToString().Equals("1"))
                    //{
                    //    dt.Rows[i]["SHIPMENT_TYPE"] = "海运";
                    //}
                    //else if(dt.Rows[i]["SHIPMENT_TYPE"].ToString().Equals("2"))
                    //{
                    //    dt.Rows[i]["SHIPMENT_TYPE"] = "空运";
                    //}
                    switch (dt.Rows[i]["SHIPMENT_TYPE"].ToString())
                    {
                    case "0":
                        dt.Rows[i]["SHIPMENT_TYPE"] = "陆运";
                        break;

                    case "1":
                        dt.Rows[i]["SHIPMENT_TYPE"] = "海运";
                        break;

                    case "2":
                        dt.Rows[i]["SHIPMENT_TYPE"] = "空运";
                        break;

                    default:
                        dt.Rows[i]["SHIPMENT_TYPE"] = "";
                        break;
                    }
                }
                gcList.DataSource = dt;
                gcList.MainView   = gvList;
                gvList.BestFitColumns();
            }
        }
Пример #23
0
        /// <summary>
        /// 查询包含批次信息的数据集。
        /// </summary>
        /// <param name="dsSearch">
        /// 包含查询条件的数据集。
        /// </param>
        /// <param name="pconfig">
        /// 分页查询的配置对象。
        /// </param>
        /// <param name="isPaging">
        /// 是否分页查询。
        /// </param>
        /// <returns>包含批次信息的数据集。</returns>
        private DataSet SearchLotList(DataSet dsSearch, ref PagingQueryConfig pconfig, bool isPaging)
        {
            DataSet       dsReturn = new DataSet();
            StringBuilder sBuilder = new StringBuilder();

            try
            {
                sBuilder.Append(@"SELECT  A.[LOT_KEY],A.[LOT_NUMBER],A.[WORK_ORDER_KEY],A.[WORK_ORDER_NO],A.[WORK_ORDER_SEQ]
                                ,A.[PART_VER_KEY],A.[PART_NUMBER],A.[PRO_ID],A.[PRO_LEVEL],A.[PRIORITY],A.[QUANTITY_INITIAL]
                                ,A.[LOT_LINE_CODE],A.[LOT_LINE_KEY]
                                ,A.[QUANTITY],A.[ROUTE_ENTERPRISE_VER_KEY],A.[CUR_ROUTE_VER_KEY],A.[CUR_STEP_VER_KEY]
                                ,A.[CUR_PRODUCTION_LINE_KEY],A.[LINE_NAME],A.[START_WAIT_TIME],A.[START_PROCESS_TIME]
                                ,A.[EDC_INS_KEY],A.[STATE_FLAG],A.[IS_MAIN_LOT],A.[SPLIT_FLAG],A.[LOT_SEQ],A.[REWORK_FLAG]
                                ,A.[HOLD_FLAG],A.[SHIPPED_FLAG],A.[DELETED_TERM_FLAG],A.[IS_PRINT],A.[LOT_TYPE],A.[CREATE_TYPE]
                                ,A.[COLOR],A.[PALLET_NO],A.[PALLET_TIME],A.[STATUS],A.[OPERATOR],A.[OPR_LINE],A.[OPR_COMPUTER]
                                ,A.[OPR_LINE_PRE],A.[CHILD_LINE],A.[MATERIAL_CODE],A.[MATERIAL_LOT],A.[SUPPLIER_NAME],A.[SI_LOT]
                                ,A.[EFFICIENCY],A.[FACTORYROOM_KEY],A.[FACTORYROOM_NAME],A.[CREATE_OPERTION_NAME],A.[CREATOR]
                                ,A.[CREATE_TIME],A.[CREATE_TIMEZONE_KEY],A.[EDITOR],A.[EDIT_TIME],A.[EDIT_TIMEZONE],A.[SHIFT_NAME]
                                ,A.[DESCRIPTIONS],A.[LOT_SIDECODE],A.[LOT_CUSTOMERCODE],A.[ORG_WORK_ORDER_NO],w.PART_NUMBER AS ORG_PART_NUMBER,
                                E.ENTERPRISE_NAME,
                                D.ROUTE_NAME,
                                B.ROUTE_STEP_NAME,
                               (SELECT TOP 1 EQUIPMENT_KEY 
                                 FROM EMS_LOT_EQUIPMENT 
                                 WHERE LOT_KEY=A.LOT_KEY
                                 AND STEP_KEY=A.CUR_STEP_VER_KEY
                                 AND END_TIMESTAMP IS NULL) AS EQUIPMENT_KEY,
                                 
                               (SELECT EQUIPMENT_NAME
                                FROM EMS_EQUIPMENTS
                                WHERE EQUIPMENT_KEY=(SELECT TOP 1 EQUIPMENT_KEY 
                                                    FROM EMS_LOT_EQUIPMENT 
                                                    WHERE LOT_KEY=A.LOT_KEY
                                                    AND STEP_KEY=A.CUR_STEP_VER_KEY
                                                    AND END_TIMESTAMP IS NULL)) AS EQUIPMENT_NAME
                                FROM POR_LOT A
                                LEFT JOIN POR_WORK_ORDER w ON w.ORDER_NUMBER=A.ORG_WORK_ORDER_NO
                                LEFT JOIN POR_ROUTE_STEP B ON A.CUR_STEP_VER_KEY= B.ROUTE_STEP_KEY
                                LEFT JOIN POR_ROUTE_ROUTE_VER D ON A.CUR_ROUTE_VER_KEY=D.ROUTE_ROUTE_VER_KEY 
                                LEFT JOIN POR_ROUTE_ENTERPRISE_VER E ON  A.ROUTE_ENTERPRISE_VER_KEY =E.ROUTE_ENTERPRISE_VER_KEY
                                WHERE A.STATUS < 2");
                if (dsSearch != null && dsSearch.Tables.Contains(TRANS_TABLES.TABLE_MAIN_DATA))
                {
                    DataTable dtParams = dsSearch.Tables[TRANS_TABLES.TABLE_MAIN_DATA];
                    Hashtable htParams = CommonUtils.ConvertToHashtable(dtParams);
                    if (htParams.ContainsKey(POR_LOT_FIELDS.FIELD_FACTORYROOM_KEY))
                    {
                        string roomKey = Convert.ToString(htParams[POR_LOT_FIELDS.FIELD_FACTORYROOM_KEY]);
                        sBuilder.AppendFormat(" AND A.FACTORYROOM_KEY ='{0}'", roomKey.PreventSQLInjection());
                    }
                    if (htParams.ContainsKey(POR_LOT_FIELDS.FIELD_LOT_NUMBER))
                    {
                        string lotNumber = Convert.ToString(htParams[POR_LOT_FIELDS.FIELD_LOT_NUMBER]);
                        sBuilder.AppendFormat(" AND A.LOT_NUMBER LIKE '%{0}%'", lotNumber.PreventSQLInjection());
                    }
                    if (htParams.ContainsKey(POR_LOT_FIELDS.FIELD_LOT_NUMBER + "_START"))
                    {
                        string lotNumber = Convert.ToString(htParams[POR_LOT_FIELDS.FIELD_LOT_NUMBER + "_START"]);
                        sBuilder.AppendFormat(" AND A.LOT_NUMBER >='{0}'", lotNumber.PreventSQLInjection());
                    }
                    if (htParams.ContainsKey(POR_LOT_FIELDS.FIELD_LOT_NUMBER + "_END"))
                    {
                        string lotNumber = Convert.ToString(htParams[POR_LOT_FIELDS.FIELD_LOT_NUMBER + "_END"]);
                        sBuilder.AppendFormat(" AND A.LOT_NUMBER <='{0}'", lotNumber.PreventSQLInjection());
                    }
                    if (htParams.ContainsKey(POR_LOT_FIELDS.FIELD_HOLD_FLAG))
                    {
                        string holdFalg = Convert.ToString(htParams[POR_LOT_FIELDS.FIELD_HOLD_FLAG]);
                        sBuilder.AppendFormat(" AND A.HOLD_FLAG={0}", holdFalg.PreventSQLInjection());
                    }
                    if (htParams.ContainsKey(POR_LOT_FIELDS.FIELD_LOT_TYPE))
                    {
                        string lotType = Convert.ToString(htParams[POR_LOT_FIELDS.FIELD_LOT_TYPE]);
                        sBuilder.AppendFormat(" AND A.LOT_TYPE='{0}'", lotType.PreventSQLInjection());
                    }
                    if (htParams.ContainsKey(POR_LOT_FIELDS.FIELD_STATE_FLAG))
                    {
                        string stateFlag = Convert.ToString(htParams[POR_LOT_FIELDS.FIELD_STATE_FLAG]);
                        sBuilder.AppendFormat(" AND A.STATE_FLAG={0}", stateFlag.PreventSQLInjection());
                    }
                    if (htParams.ContainsKey(POR_LOT_FIELDS.FIELD_CREATOR))
                    {
                        string creator = Convert.ToString(htParams[POR_LOT_FIELDS.FIELD_CREATOR]);
                        sBuilder.AppendFormat(" AND A.CREATOR='{0}'", creator.PreventSQLInjection());
                    }
                    if (htParams.ContainsKey(POR_LOT_FIELDS.FIELD_DELETED_TERM_FLAG))
                    {
                        string deletedTermFlag = Convert.ToString(htParams[POR_LOT_FIELDS.FIELD_DELETED_TERM_FLAG]);
                        sBuilder.AppendFormat(" AND A.DELETED_TERM_FLAG={0}", deletedTermFlag.PreventSQLInjection());
                    }
                    if (htParams.ContainsKey(POR_LOT_FIELDS.FIELD_SHIPPED_FLAG))
                    {
                        string flag = Convert.ToString(htParams[POR_LOT_FIELDS.FIELD_SHIPPED_FLAG]);
                        sBuilder.AppendFormat(" AND A.SHIPPED_FLAG={0}", flag.PreventSQLInjection());
                    }
                    if (htParams.ContainsKey(POR_LOT_FIELDS.FIELD_PRO_ID))
                    {
                        string proId = Convert.ToString(htParams[POR_LOT_FIELDS.FIELD_PRO_ID]);
                        sBuilder.AppendFormat(" AND A.PRO_ID LIKE '%{0}%'", proId.PreventSQLInjection());
                    }

                    if (htParams.ContainsKey(POR_LOT_FIELDS.FIELD_PART_NUMBER))
                    {
                        string partNumber = Convert.ToString(htParams[POR_LOT_FIELDS.FIELD_PART_NUMBER]);
                        sBuilder.AppendFormat(" AND A.PART_NUMBER LIKE '%{0}%'", partNumber.PreventSQLInjection());
                    }
                    if (htParams.ContainsKey(POR_LOT_FIELDS.FIELD_WORK_ORDER_NO))
                    {
                        string orderNumber = Convert.ToString(htParams[POR_LOT_FIELDS.FIELD_WORK_ORDER_NO]);
                        sBuilder.AppendFormat(" AND A.WORK_ORDER_NO LIKE '%{0}%'", orderNumber.PreventSQLInjection());
                    }

                    if (htParams.ContainsKey(POR_LOT_FIELDS.FIELD_ORG_WORK_ORDER_NO))
                    {
                        string orderNumber = Convert.ToString(htParams[POR_LOT_FIELDS.FIELD_ORG_WORK_ORDER_NO]);
                        sBuilder.AppendFormat(" AND A.ORG_WORK_ORDER_NO LIKE '%{0}%'", orderNumber.PreventSQLInjection());
                    }

                    if (htParams.ContainsKey(POR_LOT_FIELDS.FIELD_PALLET_NO))
                    {
                        string palletNo = Convert.ToString(htParams[POR_LOT_FIELDS.FIELD_PALLET_NO]);
                        sBuilder.AppendFormat(" AND A.PALLET_NO LIKE '%{0}%'", palletNo.PreventSQLInjection());
                    }
                    if (htParams.ContainsKey(POR_LOT_FIELDS.FIELD_LINE_NAME))
                    {
                        string lineName = Convert.ToString(htParams[POR_LOT_FIELDS.FIELD_LINE_NAME]);
                        sBuilder.AppendFormat(" AND A.LINE_NAME ='{0}'", lineName.PreventSQLInjection());
                    }
                    if (htParams.ContainsKey(POR_LOT_FIELDS.FIELD_SHIFT_NAME))
                    {
                        string shiftName = Convert.ToString(htParams[POR_LOT_FIELDS.FIELD_SHIFT_NAME]);
                        sBuilder.AppendFormat(" AND A.SHIFT_NAME='{0}'", shiftName.PreventSQLInjection());
                    }
                    if (htParams.ContainsKey(POR_ROUTE_ENTERPRISE_VER_FIELDS.FIELD_ENTERPRISE_NAME))
                    {
                        string enterpriseName = Convert.ToString(htParams[POR_ROUTE_ENTERPRISE_VER_FIELDS.FIELD_ENTERPRISE_NAME]);
                        sBuilder.AppendFormat(" AND E.ENTERPRISE_NAME='{0}'", enterpriseName.PreventSQLInjection());
                    }
                    if (htParams.ContainsKey(POR_ROUTE_ROUTE_VER_FIELDS.FIELD_ROUTE_NAME))
                    {
                        string routeName = Convert.ToString(htParams[POR_ROUTE_ROUTE_VER_FIELDS.FIELD_ROUTE_NAME]);
                        sBuilder.AppendFormat(" AND D.ROUTE_NAME='{0}'", routeName.PreventSQLInjection());
                    }
                    if (htParams.ContainsKey(POR_ROUTE_OPERATION_VER_FIELDS.FIELD_ROUTE_OPERATION_NAME))
                    {
                        string stepName = Convert.ToString(htParams[POR_ROUTE_OPERATION_VER_FIELDS.FIELD_ROUTE_OPERATION_NAME]);
                        sBuilder.AppendFormat(" AND B.ROUTE_STEP_NAME='{0}'", stepName.PreventSQLInjection());
                    }
                    if (htParams.ContainsKey(POR_LOT_FIELDS.FIELD_CREATE_TIME + "_START"))
                    {
                        string createStartTime = Convert.ToString(htParams[POR_LOT_FIELDS.FIELD_CREATE_TIME + "_START"]);
                        sBuilder.AppendFormat(" AND A.CREATE_TIME >='{0}'", createStartTime.PreventSQLInjection());
                    }
                    if (htParams.ContainsKey(POR_LOT_FIELDS.FIELD_CREATE_TIME + "_END"))
                    {
                        string createEndTime = Convert.ToString(htParams[POR_LOT_FIELDS.FIELD_CREATE_TIME + "_END"]);
                        sBuilder.AppendFormat(" AND A.CREATE_TIME<='{0}'", createEndTime.PreventSQLInjection());
                    }
                }
                if (!isPaging)
                {
                    sBuilder.Append(" ORDER BY A.LOT_NUMBER ASC,A.CREATE_TIME DESC");
                    dsReturn = this._dbRead.ExecuteDataSet(CommandType.Text, sBuilder.ToString());
                }
                else
                {
                    int pages   = 0;
                    int records = 0;
                    AllCommonFunctions.CommonPagingData(sBuilder.ToString(),
                                                        pconfig.PageNo,
                                                        pconfig.PageSize,
                                                        out pages,
                                                        out records,
                                                        this._dbRead,
                                                        dsReturn,
                                                        POR_LOT_FIELDS.DATABASE_TABLE_NAME,
                                                        "ASC",
                                                        new string[] { "LOT_NUMBER", "CREATE_TIME" });
                    dsReturn.Tables[0].Columns[POR_LOT_FIELDS.FIELD_START_WAIT_TIME].DateTimeMode    = DataSetDateTime.Unspecified;
                    dsReturn.Tables[0].Columns[POR_LOT_FIELDS.FIELD_START_PROCESS_TIME].DateTimeMode = DataSetDateTime.Unspecified;
                    dsReturn.Tables[0].Columns[POR_LOT_FIELDS.FIELD_EDIT_TIME].DateTimeMode          = DataSetDateTime.Unspecified;
                    pconfig.Pages   = pages;
                    pconfig.Records = records;
                }
                FanHai.Hemera.Share.Common.ReturnMessageUtils.AddServerReturnMessage(dsReturn, string.Empty);
            }
            catch (Exception ex)
            {
                FanHai.Hemera.Share.Common.ReturnMessageUtils.AddServerReturnMessage(dsReturn, ex.Message);
                LogService.LogError("SearchLotList Error: " + ex.Message);
            }
            return(dsReturn);
        }
Пример #24
0
        /// <summary>
        /// 获取设备信息。
        /// </summary>
        /// <param name="equipmentCode">设备编码,左匹配模糊查询。</param>
        /// <param name="equipmentName">设备名称,左匹配模糊查询。</param>
        /// <param name="equipmentType">设备类型。如果为空,则查询所有类型的设备。</param>
        /// <param name="pconfig">数据分页查询的配置对象。</param>
        /// <returns>包含设备数据信息的数据集对象。</returns>
        public DataSet GetEquipments(string equipmentCode, string equipmentName, string equipmentType, ref PagingQueryConfig pconfig)
        {
            DataSet dsReturn = null;

            try
            {
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();
                dsReturn      = serverFactory.CreateIEquipments().GetEquipments(equipmentCode, equipmentName, equipmentType, ref pconfig);
                this.ErrorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
            }
            catch (Exception ex)
            {
                this.ErrorMsg = ex.Message;
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
            return(dsReturn);
        }
Пример #25
0
        /// <summary>
        /// 绑定批次信息。
        /// </summary>
        private void BindLotInfo()
        {
            string factoryRoomKey = Convert.ToString(this.lueFactoryRoom.EditValue);;

            if (string.IsNullOrEmpty(factoryRoomKey))
            {
                MessageService.ShowMessage("请选择车间。", "系统提示");
                this.lueFactoryRoom.Select();
                return;
            }
            //开始时间>结束时间
            if (this.deStartCreateDate.DateTime > this.deEndCreateDate.DateTime)
            {
                MessageService.ShowMessage("开始时间必须小于结束时间。", "系统提示");
                this.deStartCreateDate.Select();
                return;
            }
            string    DeletedFlag     = Convert.ToString(this.lueDeletedFlag.EditValue);
            string    HoldFlag        = Convert.ToString(this.lueHoldFlag.EditValue);
            string    LotNumber       = this.teLotNumber.Text.ToUpper().Trim();
            string    LotType         = Convert.ToString(this.lueLotType.EditValue);
            string    OperationName   = Convert.ToString(this.lueOperation.EditValue);
            string    ProId           = this.teProId.Text.ToUpper().Trim();
            string    ReworkFlag      = Convert.ToString(this.lueReworkFlag.EditValue);
            string    RoomKey         = factoryRoomKey;
            string    RoomName        = Convert.ToString(this.lueFactoryRoom.Text);
            string    ShippedFlag     = Convert.ToString(this.lueShippedFlag.EditValue);
            string    StateFlag       = Convert.ToString(this.lueState.EditValue);
            string    PalletNo        = this.tePalletNo.Text.Trim();
            string    WorkOrderNumber = this.teWorkOrderNumber.Text.ToUpper().Trim();
            string    StartCreateDate = this.deStartCreateDate.DateTime.ToString("yyyy-MM-dd HH:mm:ss");
            string    EndCreateDate   = this.deEndCreateDate.DateTime.ToString("yyyy-MM-dd HH:mm:ss");
            string    Creator         = this.teCreator.Text.Trim();
            string    LotNumber1      = this.teLotNumberEnd.Text.Trim();
            string    PartNumber      = this.tePartNumber.Text.Trim();
            string    OrgOrderNumber  = this.teOrgOrderNumber.Text.Trim();
            Hashtable htParams        = new Hashtable();
            DataSet   dsParams        = new DataSet();
            DataSet   dsReturn        = new DataSet();

            //车间主键。
            htParams.Add(POR_LOT_FIELDS.FIELD_FACTORYROOM_KEY, RoomKey);
            //工序名称不为空
            if (!string.IsNullOrEmpty(OperationName))
            {
                htParams.Add(POR_ROUTE_OPERATION_VER_FIELDS.FIELD_ROUTE_OPERATION_NAME, OperationName);
            }
            //批次号不为空
            if (!string.IsNullOrEmpty(LotNumber1) && !string.IsNullOrEmpty(LotNumber))
            {
                htParams.Add(POR_LOT_FIELDS.FIELD_LOT_NUMBER + "_START", LotNumber);
                htParams.Add(POR_LOT_FIELDS.FIELD_LOT_NUMBER + "_END", LotNumber1);
            }
            //批次号不为空
            else if (!string.IsNullOrEmpty(LotNumber))
            {
                htParams.Add(POR_LOT_FIELDS.FIELD_LOT_NUMBER, LotNumber);
            }
            //工单号不为空
            if (!string.IsNullOrEmpty(WorkOrderNumber))
            {
                htParams.Add(POR_LOT_FIELDS.FIELD_WORK_ORDER_NO, WorkOrderNumber);
            }
            //工单号不为空
            if (!string.IsNullOrEmpty(OrgOrderNumber))
            {
                htParams.Add(POR_LOT_FIELDS.FIELD_ORG_WORK_ORDER_NO, OrgOrderNumber);
            }
            //产品ID号不为空
            if (!string.IsNullOrEmpty(ProId))
            {
                htParams.Add(POR_LOT_FIELDS.FIELD_PRO_ID, ProId);
            }

            //产品料不为空
            if (!string.IsNullOrEmpty(PartNumber))
            {
                htParams.Add(POR_LOT_FIELDS.FIELD_PART_NUMBER, PartNumber);
            }
            //托盘号不为空
            if (!string.IsNullOrEmpty(PalletNo))
            {
                htParams.Add(POR_LOT_FIELDS.FIELD_PALLET_NO, PalletNo);
            }
            //暂停标记不为空
            if (!string.IsNullOrEmpty(HoldFlag))
            {
                htParams.Add(POR_LOT_FIELDS.FIELD_HOLD_FLAG, HoldFlag);
            }
            //重工标记不为空
            if (!string.IsNullOrEmpty(ReworkFlag))
            {
                htParams.Add(POR_LOT_FIELDS.FIELD_IS_REWORKED, ReworkFlag);
            }
            //删除标记不为空
            if (!string.IsNullOrEmpty(DeletedFlag))
            {
                htParams.Add(POR_LOT_FIELDS.FIELD_DELETED_TERM_FLAG, DeletedFlag);
            }
            //出货标记不为空
            if (!string.IsNullOrEmpty(ShippedFlag))
            {
                htParams.Add(POR_LOT_FIELDS.FIELD_SHIPPED_FLAG, ShippedFlag);
            }
            //状态不为空
            if (!string.IsNullOrEmpty(StateFlag))
            {
                htParams.Add(POR_LOT_FIELDS.FIELD_STATE_FLAG, StateFlag);
            }
            //批次类型不为空
            if (!string.IsNullOrEmpty(LotType))
            {
                htParams.Add(POR_LOT_FIELDS.FIELD_LOT_TYPE, LotType);
            }
            //创建人
            if (!string.IsNullOrEmpty(Creator))
            {
                htParams.Add(POR_LOT_FIELDS.FIELD_CREATOR, Creator);
            }
            //创建日期-起不为空
            if (!string.IsNullOrEmpty(StartCreateDate))
            {
                htParams.Add(POR_LOT_FIELDS.FIELD_CREATE_TIME + "_START", StartCreateDate);
            }
            //创建日期-止不为空
            if (!string.IsNullOrEmpty(EndCreateDate))
            {
                htParams.Add(POR_LOT_FIELDS.FIELD_CREATE_TIME + "_END", EndCreateDate);
            }
            DataTable dtParams = CommonUtils.ParseToDataTable(htParams);

            dtParams.TableName = TRANS_TABLES.TABLE_MAIN_DATA;
            dsParams.Tables.Add(dtParams);
            //查询批次
            LotQueryEntity    entity = new LotQueryEntity();
            PagingQueryConfig config = new PagingQueryConfig()
            {
                PageNo   = pgnQueryResult.PageNo,
                PageSize = pgnQueryResult.PageSize
            };

            dsReturn               = entity.Query(dsParams, ref config);
            pgnQueryResult.Pages   = config.Pages;
            pgnQueryResult.Records = config.Records;
            if (!string.IsNullOrEmpty(entity.ErrorMsg))
            {
                MessageService.ShowMessage(entity.ErrorMsg);
                return;
            }
            if (dsReturn.Tables.Count > 0)
            {
                gcLot.DataSource = dsReturn.Tables[0];
                gcLot.MainView   = gvLot;
                gvLot.BestFitColumns();
            }
        }
Пример #26
0
        /// <summary>
        /// 绑定托盘信息。
        /// </summary>
        private void BindPalletInfo()
        {
            PalletQueryConditionModel model = this.Model;
            Hashtable htParams = new Hashtable();
            DataSet   dsParams = new DataSet();

            //车间主键。
            htParams.Add(WIP_CONSIGNMENT_FIELDS.FIELDS_ROOM_KEY, model.RoomKey);
            //批次号不为空
            if (!string.IsNullOrEmpty(model.PalletNo1) && !string.IsNullOrEmpty(model.PalletNo))
            {
                htParams.Add(WIP_CONSIGNMENT_FIELDS.FIELDS_VIRTUAL_PALLET_NO + "_START", model.PalletNo);
                htParams.Add(WIP_CONSIGNMENT_FIELDS.FIELDS_VIRTUAL_PALLET_NO + "_END", model.PalletNo1);
            }
            //批次号不为空
            else if (!string.IsNullOrEmpty(model.PalletNo))
            {
                htParams.Add(WIP_CONSIGNMENT_FIELDS.FIELDS_VIRTUAL_PALLET_NO, model.PalletNo);
            }
            //工单号不为空
            if (!string.IsNullOrEmpty(model.WorkOrderNumber))
            {
                htParams.Add(WIP_CONSIGNMENT_FIELDS.FIELDS_WORKNUMBER, model.WorkOrderNumber);
            }
            //产品ID号不为空
            if (!string.IsNullOrEmpty(model.ProId))
            {
                htParams.Add(WIP_CONSIGNMENT_FIELDS.FIELDS_PRO_ID, model.ProId);
            }
            //产品料号不为空
            if (!string.IsNullOrEmpty(model.PartNumber))
            {
                htParams.Add(WIP_CONSIGNMENT_FIELDS.FIELDS_SAP_NO, model.PartNumber);
            }
            //状态不为空
            if (!string.IsNullOrEmpty(model.StateFlag))
            {
                htParams.Add(WIP_CONSIGNMENT_FIELDS.FIELDS_CS_DATA_GROUP, model.StateFlag);
            }
            //创建日期-起不为空
            if (!string.IsNullOrEmpty(model.StartCreateDate))
            {
                htParams.Add(WIP_CONSIGNMENT_FIELDS.FIELDS_CREATE_TIME + "_START", model.StartCreateDate);
            }
            //创建日期-止不为空
            if (!string.IsNullOrEmpty(model.EndCreateDate))
            {
                htParams.Add(WIP_CONSIGNMENT_FIELDS.FIELDS_CREATE_TIME + "_END", model.EndCreateDate);
            }
            //入库检日期-起不为空
            if (!string.IsNullOrEmpty(model.StartCheckDate))
            {
                htParams.Add(WIP_CONSIGNMENT_FIELDS.FIELDS_CHECK_TIME + "_START", model.StartCheckDate);
            }
            //入库检日期-止不为空
            if (!string.IsNullOrEmpty(model.EndCheckDate))
            {
                htParams.Add(WIP_CONSIGNMENT_FIELDS.FIELDS_CHECK_TIME + "_END", model.EndCheckDate);
            }
            //入库日期-起不为空
            if (!string.IsNullOrEmpty(model.StartTowarehouseDate))
            {
                htParams.Add(WIP_CONSIGNMENT_FIELDS.FIELDS_TO_WH_TIME + "_START", model.StartTowarehouseDate);
            }
            //入库日期-止不为空
            if (!string.IsNullOrEmpty(model.EndTowarehouseDate))
            {
                htParams.Add(WIP_CONSIGNMENT_FIELDS.FIELDS_TO_WH_TIME + "_END", model.EndTowarehouseDate);
            }

            DataTable dtParams = CommonUtils.ParseToDataTable(htParams);

            dtParams.TableName = TRANS_TABLES.TABLE_MAIN_DATA;
            dsParams.Tables.Add(dtParams);
            //查询批次
            PagingQueryConfig config = new PagingQueryConfig()
            {
                PageNo   = pgnQueryResult.PageNo,
                PageSize = pgnQueryResult.PageSize
            };
            DataSet dsReturn = _entity.Query(dsParams, ref config);

            pgnQueryResult.Pages   = config.Pages;
            pgnQueryResult.Records = config.Records;
            if (!string.IsNullOrEmpty(_entity.ErrorMsg))
            {
                MessageService.ShowMessage(_entity.ErrorMsg);
                return;
            }
            if (dsReturn.Tables.Count > 0)
            {
                dsReturn.Tables[0].Columns.Add("ROW_NUM", typeof(Decimal));
                for (int i = 0; i < dsReturn.Tables[0].Rows.Count; i++)
                {
                    DataRow dr = dsReturn.Tables[0].Rows[i];

                    dr["ROW_NUM"] = i + 1;

                    string grade = Convert.ToString(dr[WIP_CONSIGNMENT_FIELDS.FIELDS_GRADE]);
                    dr[WIP_CONSIGNMENT_FIELDS.FIELDS_GRADE] = GetProductGradeDisplayText(grade);

                    object      val   = dr[WIP_CONSIGNMENT_FIELDS.FIELDS_CS_DATA_GROUP];
                    PalletState state = (PalletState)Convert.ToInt32(val);
                    dr[WIP_CONSIGNMENT_FIELDS.FIELDS_GRADE]         = GetProductGradeDisplayText(grade);
                    dr[WIP_CONSIGNMENT_FIELDS.FIELDS_CS_DATA_GROUP] = CommonUtils.GetEnumValueDescription(state);
                }
                gcPallet.DataSource = dsReturn.Tables[0];
                gcPallet.MainView   = gvPallet;
                gvPallet.BestFitColumns();
            }
        }
Пример #27
0
        public DataSet GetByFourParameters(string partId, string partType, string partModule, string partClass, ref PagingQueryConfig pconfig)
        {
            DataSet       dsReturn  = new DataSet();
            StringBuilder sqlCommon = new StringBuilder();

            try
            {
                sqlCommon.Append(@"SELECT PART_ID,PART_DESC,PART_TYPE,PART_MODULE,PART_CLASS,
	                                           (SELECT COUNT(1)
		                                        FROM  POR_PART_BYPRODUCT b
		                                        WHERE b.MAIN_PART_NUMBER=A.PART_ID
		                                        AND b.IS_USED='Y') AS TOTOL
                                        FROM dbo.POR_PART A WHERE 1=1 AND A.PART_STATUS = 1");
                if (!string.IsNullOrEmpty(partId))
                {
                    sqlCommon.AppendFormat(" AND PART_ID LIKE '{0}%'", partId);
                }
                if (!string.IsNullOrEmpty(partType))
                {
                    sqlCommon.AppendFormat(" AND PART_TYPE LIKE '{0}%'", partType);
                }
                if (!string.IsNullOrEmpty(partModule))
                {
                    sqlCommon.AppendFormat(" AND PART_MODULE LIKE '{0}%'", partModule);
                }
                if (!string.IsNullOrEmpty(partClass))
                {
                    sqlCommon.AppendFormat(" AND PART_CLASS LIKE '{0}%'", partClass);
                }
                int pages   = 0;
                int records = 0;
                AllCommonFunctions.CommonPagingData(sqlCommon.ToString(),
                                                    pconfig.PageNo,
                                                    pconfig.PageSize,
                                                    out pages,
                                                    out records,
                                                    db,
                                                    dsReturn,
                                                    "POR_PART",
                                                    "PART_ID ASC");
                pconfig.Pages   = pages;
                pconfig.Records = records;

                ReturnMessageUtils.AddServerReturnMessage(dsReturn, string.Empty);
            }
            catch (Exception ex)
            {
                ReturnMessageUtils.AddServerReturnMessage(dsReturn, ex.Message);
                LogService.LogError("GetByFourParameters Error: " + ex.Message);
            }
            return(dsReturn);
        }
Пример #28
0
        public DataSet GetByFourParameters(string partId, string partType, string partModule, string partClass, ref PagingQueryConfig pconfig)
        {
            DataSet dsReturn = new DataSet();

            try
            {
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();
                if (null != serverFactory)
                {
                    dsReturn  = serverFactory.CreateIByProductPartEngine().GetByFourParameters(partId, partType, partModule, partClass, ref pconfig);
                    _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                }
            }
            catch (Exception ex)
            {
                _errorMsg = ex.Message;
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
            return(dsReturn);
        }
Пример #29
0
        private DataSet Query(DataSet dsParams, ref PagingQueryConfig pConfig, bool ispaging)
        {
            DataSet       dsReturn = new DataSet();
            StringBuilder sBuilder = new StringBuilder();

            try
            {
                ////出库校验
                //if (status == "CKJY")
                //{
                sBuilder.Append(@"select OUTBANDNO,VBELN,POSNR,CPBH,XHGG,OBDQTY,QC_RESULT,BATCHNO,STATUS,QC_PERSON, 
                                             case PKG_MAT when 0 then '合格' when 1 then '不合格' else ''end as PKG_MAT,
                                             case BILL_BRND  when 0 then '合格' when 1 then '不合格'else '' end as BILL_BRND ,
                                             case CANTR  when 0 then '合格' when 1 then '不合格' else '' end as CANTR ,
                                             case F_OUTB_CUSTM  when 0 then '合格' when 1 then '不合格'else '' end as F_OUTB_CUSTM ,
                                             case EL  when 0 then '合格' when 1 then '不合格'else '' end as EL ,  
                                             case DATA_FORMT when 0 then '合格' when 1 then '不合格'else '' end as DATA_FORMT,
                                             case LIST_ABSENCE  when 0 then '合格' when 1 then '不合格'else '' end as LIST_ABSENCE ,
                                             case LiST_ERR  when 0 then '合格' when 1 then '不合格'else '' end as LiST_ERR ,
                                             case CELL  when 0 then '合格' when 1 then '不合格'else '' end as CELL ,
                                             case MOD_ERR  when 0 then '合格' when 1 then '不合格'else '' end as MOD_ERR , 
                                             case QLVL_ERR when 0 then '合格' when 1 then '不合格'else '' end as QLVL_ERR,
                                             case FRAME  when 0 then '合格' when 1 then '不合格'else '' end as FRAME ,
                                             case BRND_PARM_ERR  when 0 then '合格' when 1 then '不合格'else '' end as BRND_PARM_ERR ,
                                             case CONT_LOCK_BRK  when 0 then '合格' when 1 then '不合格'else '' end as CONT_LOCK_BRK ,
                                             case CUSTM_CK  when 0 then '合格' when 1 then '不合格'else '' end as CUSTM_CK       
                                       from (select OUTBANDNO,a.VBELN,a.POSNR,CPBH,XHGG,OBDQTY,a.QC_RESULT,a.BATCHNO,a.STATUS,a.QC_PERSON, 
                                                    PKG_MAT,BILL_BRND ,CANTR ,F_OUTB_CUSTM ,EL ,DATA_FORMT, LIST_ABSENCE , LiST_ERR , CELL ,
                                                    MOD_ERR ,QLVL_ERR,FRAME ,BRND_PARM_ERR ,CONT_LOCK_BRK ,CUSTM_CK                                    
                                               from AWMS_OUTB_ITEM a left join AWMS_OUTB_QC b on a.VBELN=b.VBELN and a.POSNR=b.POSNR
                                              where a.STATUS in('已确认') and b.STATUS is null
                                       union select distinct OUTBANDNO,a.VBELN,a.POSNR,CPBH,XHGG,OBDQTY,a.QC_RESULT,a.BATCHNO,a.STATUS,a.QC_PERSON, 
                                                    PKG_MAT=2,BILL_BRND=2 ,CANTR=2 ,F_OUTB_CUSTM= 2,EL=2 ,DATA_FORMT=2, 
                                                    LIST_ABSENCE=2 ,LiST_ERR=2 , CELL=2 ,MOD_ERR=2 , QLVL_ERR=2,FRAME=2 ,
                                                    BRND_PARM_ERR=2 ,CONT_LOCK_BRK=2 ,CUSTM_CK=2                                    
                                               from AWMS_OUTB_ITEM a left join AWMS_OUTB_QC b on a.VBELN=b.VBELN and a.POSNR=b.POSNR
                                              where a.STATUS in('已确认') and b.STATUS ='删除'      
                                       union select OUTBANDNO,a.VBELN,a.POSNR,CPBH,XHGG,OBDQTY,a.QC_RESULT,a.BATCHNO,a.STATUS,a.QC_PERSON, 
                                                    PKG_MAT,BILL_BRND ,CANTR ,F_OUTB_CUSTM ,EL ,DATA_FORMT, LIST_ABSENCE , LiST_ERR , CELL ,
                                                    MOD_ERR ,QLVL_ERR,FRAME ,BRND_PARM_ERR ,CONT_LOCK_BRK ,CUSTM_CK                                    
                                               from AWMS_OUTB_ITEM a left join AWMS_OUTB_QC b on a.VBELN=b.VBELN and a.POSNR=b.POSNR
                                              where a.STATUS in('已过账','已检验') and b.STATUS='正常') a  where 1=1
                                ");
                //}
//                //出库管理
//                else if (status == "CKGL")
//                {
//                    sBuilder.Append(@"select a.OUTBANDNO,a.VBELN,a.POSNR,a.status,CPBH,XHGG,QCQTY,OBDQTY,QC_RESULT,BATCHNO,
//                                             c.PALLET_NO from AWMS_OUTB_ITEM a,AWMS_CONTAINER_DETAIL b ,[dbo].WIP_CONSIGNMENT c
//                                       where a.Cabinet_NO=b.CONTAINER_CODE and a.Cabinet_KEY=b.CONTAINER_KEY and a.CPBH=c.SAP_NO
//                                             and b.PALLET_NO=c.PALLET_NO and a.STATUS in('已确认','已过账','已检验')
//                                    ");
//                }

                if (dsParams != null && dsParams.Tables.Contains(TRANS_TABLES.TABLE_MAIN_DATA))
                {
                    DataTable dtParam = dsParams.Tables[TRANS_TABLES.TABLE_MAIN_DATA];
                    Hashtable hsParam = CommonUtils.ConvertToHashtable(dtParam);
                    if (hsParam.ContainsKey(AWMS_OUTB_ITEM_FIELDS.Field_VBELN))
                    {
                        string vbelnNo = Convert.ToString(hsParam[AWMS_OUTB_ITEM_FIELDS.Field_VBELN]);
                        sBuilder.AppendFormat(" and a.VBELN like '{0}%'", vbelnNo.PreventSQLInjection());
                    }
                    if (hsParam.ContainsKey(AWMS_OUTB_ITEM_FIELDS.Field_OUTBANDNO))
                    {
                        string outboundNo = Convert.ToString(hsParam[AWMS_OUTB_ITEM_FIELDS.Field_OUTBANDNO]);
                        sBuilder.AppendFormat(" and a.OUTBANDNO like '{0}%'", outboundNo.PreventSQLInjection());
                    }
                    if (hsParam.ContainsKey(AWMS_CONTAINER_DETAIL_FIELDS.Field_PALLET_NO))
                    {
                        string outboundNo = Convert.ToString(hsParam[AWMS_CONTAINER_DETAIL_FIELDS.Field_PALLET_NO]);
                        sBuilder.AppendFormat(" and c.PALLET_NO like '{0}%'", outboundNo.PreventSQLInjection());
                    }
                }
                int pages   = 0;
                int records = 0;
                AllCommonFunctions.CommonPagingData(sBuilder.ToString(),
                                                    pConfig.PageNo,
                                                    pConfig.PageSize,
                                                    out pages,
                                                    out records,
                                                    db,
                                                    dsReturn,
                                                    POR_LOT_FIELDS.DATABASE_TABLE_NAME,
                                                    "");
                pConfig.Pages   = pages;
                pConfig.Records = records;

                ReturnMessageUtils.AddServerReturnMessage(dsReturn, string.Empty);
            }

            catch (Exception ex)
            {
                ReturnMessageUtils.AddServerReturnMessage(dsReturn, ex.Message);
                LogService.LogError("OutboundOperationEngine Query Error:" + ex.Message);
            }
            finally
            { }
            return(dsReturn);
        }
Пример #30
0
 //实现接口
 public DataSet Query(DataSet dsParams, ref PagingQueryConfig config)
 {
     return(Query(dsParams, ref config, true));
 }