Esempio n. 1
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);
        }
Esempio n. 2
0
        /// <summary>
        /// 根据工厂车间和工序名称查询设备信息。
        /// </summary>
        /// <param name="factoryRoomKey">工厂车间的主键。</param>
        /// <param name="operationName">工序名称。</param>
        /// <returns>
        /// 包含设备信息的数据集。[EQUIPMENT_KEY,EQUIPMENT_NAME,EQUIPMENT_CODE]
        /// </returns>
        public DataSet GetEquipments(string factoryRoomKey, string operationName)
        {
            DataSet dsReturn = null;

            try
            {
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();
                dsReturn  = serverFactory.CreateIEquipments().GetEquipments(factoryRoomKey, operationName);
                _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
            }
            catch (Exception ex)
            {
                _errorMsg = ex.Message;
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
            return(dsReturn);
        }
Esempio n. 3
0
        public DataSet GetEquipments()
        {
            DataSet dsReturn = null;

            try
            {
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();
                dsReturn  = serverFactory.CreateIEquipments().GetEquipments();
                _errorMsg = ReturnMessageUtils.GetServerReturnMessage(dsReturn);
            }
            catch (Exception ex)
            {
                _errorMsg = ex.Message;
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
            return(dsReturn);
        }
Esempio n. 4
0
        public DataSet GetInitEquipmentChangeState()
        {
            DataSet resDS = new DataSet();

            try
            {
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();

                if (serverFactory != null)
                {
                    resDS = serverFactory.CreateIEquipments().GetInitEquipmentChangeState();
                }
            }
            catch (Exception ex)
            {
                MessageService.ShowError(ex);
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }

            return(resDS);
        }
Esempio n. 5
0
        public override bool Delete()
        {
            #region Variables

            DataSet reqDS = new DataSet();
            DataSet resDS = new DataSet();

            #endregion

            #region Build Input Parameters

            if (!string.IsNullOrEmpty(equipmentKey))
            {
                DataTable inputParamDataTable = PARAMETERS_INPUT.CreateDataTable();

                object inputKey      = DBNull.Value;
                object inputEditor   = DBNull.Value;
                object inputEditTime = DBNull.Value;

                if (!string.IsNullOrEmpty(equipmentKey))
                {
                    inputKey = equipmentKey;
                }

                if (!string.IsNullOrEmpty(Editor))
                {
                    inputEditor = Editor;
                }

                if (!string.IsNullOrEmpty(EditTime))
                {
                    inputEditTime = EditTime;
                }

                inputParamDataTable.Rows.Add(new object[] { inputKey, inputEditor, inputEditTime });
                inputParamDataTable.AcceptChanges();

                reqDS.Tables.Add(inputParamDataTable);
            }

            #endregion

            #region Call Remoting Interface

            try
            {
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();

                if (serverFactory != null)
                {
                    resDS = serverFactory.CreateIEquipments().DeleteEquipments(reqDS);
                }
            }
            catch (Exception ex)
            {
                MessageService.ShowError(ex);

                return(false);
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }

            #endregion

            #region Process Output Parameters

            string returnMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(resDS);

            if (string.IsNullOrEmpty(returnMsg))
            {
                return(true);
            }
            else
            {
                MessageService.ShowError(returnMsg);

                return(false);
            }

            #endregion
        }
Esempio n. 6
0
        public override bool Update()
        {
            #region Variables

            DataSet reqDS = new DataSet();
            DataSet resDS = new DataSet();

            #endregion

            #region Build Input Parameters

            if (!string.IsNullOrEmpty(equipmentKey))
            {
                DataTable inputParamDataTable = PARAMETERS_INPUT.CreateDataTable();

                object inputKey      = DBNull.Value;
                object inputEditor   = DBNull.Value;
                object inputEditTime = DBNull.Value;

                if (!string.IsNullOrEmpty(equipmentKey))
                {
                    inputKey = equipmentKey;
                }

                if (!string.IsNullOrEmpty(Editor))
                {
                    inputEditor = Editor;
                }

                if (!string.IsNullOrEmpty(EditTime))
                {
                    inputEditTime = EditTime;
                }

                inputParamDataTable.Rows.Add(new object[] { inputKey, inputEditor, inputEditTime });

                inputParamDataTable.AcceptChanges();

                reqDS.Tables.Add(inputParamDataTable);
            }

            #endregion

            #region Build Equipment Data

            this.DirtyList.Add(EMS_EQUIPMENTS_FIELDS.FIELD_EDIT_TIME, new DirtyItem(EMS_EQUIPMENTS_FIELDS.FIELD_EDIT_TIME, "", ""));

            Editor       = PropertyService.Get(PROPERTY_FIELDS.USER_NAME);
            EditTimeZone = PropertyService.Get(PROPERTY_FIELDS.TIMEZONE);

            DataTable equipmentsDataTable = EMS_EQUIPMENTS_FIELDS.CreateDataTable();

            FanHai.Hemera.Utils.Common.Utils.AddKeyValuesToDataTable(ref equipmentsDataTable, DirtyList);

            equipmentsDataTable.AcceptChanges();

            reqDS.Tables.Add(equipmentsDataTable);

            #endregion

            #region Call Remoting Interface

            try
            {
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();

                if (serverFactory != null)
                {
                    resDS = serverFactory.CreateIEquipments().UpdateEquipments(reqDS);
                }
            }
            catch (Exception ex)
            {
                MessageService.ShowError(ex);

                return(false);
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }

            #endregion

            #region Process Output Parameters

            string outputEditTime = string.Empty;

            string returnMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(resDS, ref outputEditTime);

            if (string.IsNullOrEmpty(returnMsg))
            {
                EditTime = outputEditTime;

                return(true);
            }
            else
            {
                MessageService.ShowError(returnMsg);

                return(false);
            }

            #endregion
        }
Esempio n. 7
0
        public override bool Insert(DataSet ds)
        {
            #region Variables

            DataSet reqDS = new DataSet();
            DataSet resDS = new DataSet();

            #endregion

            #region Build Equipment Data
            DataTable equipmentsDataTable = EMS_EQUIPMENTS_FIELDS.CreateDataTable();

            Dictionary <string, string> dataRow = new Dictionary <string, string>()
            {
                { EMS_EQUIPMENTS_FIELDS.FIELD_EQUIPMENT_KEY, equipmentKey },
                { EMS_EQUIPMENTS_FIELDS.FIELD_EQUIPMENT_NAME, equipmentName },
                { EMS_EQUIPMENTS_FIELDS.FIELD_DESCRIPTION, description },
                { EMS_EQUIPMENTS_FIELDS.FIELD_EQUIPMENT_CODE, equipmentCode },
                { EMS_EQUIPMENTS_FIELDS.FIELD_EQUIPMENT_MODE, equipmentMode },
                { EMS_EQUIPMENTS_FIELDS.FIELD_MAXQUANTITY, maxQuantity },
                { EMS_EQUIPMENTS_FIELDS.FIELD_MINQUANTITY, minQuantity },
                { EMS_EQUIPMENTS_FIELDS.FIELD_EQUIPMENT_TYPE, equipmentType },
                { EMS_EQUIPMENTS_FIELDS.FIELD_EQUIPMENT_GROUP_KEY, equipmentGroupKey },
                { EMS_EQUIPMENTS_FIELDS.FIELD_LOCATION_KEY, equipmentLocationKey },
                { EMS_EQUIPMENTS_FIELDS.FIELD_ISBATCH, isBatch },
                { EMS_EQUIPMENTS_FIELDS.FIELD_ISCHAMBER, IsChamber },
                { EMS_EQUIPMENTS_FIELDS.FIELD_CHAMBER_INDEX, chamberIndex },
                { EMS_EQUIPMENTS_FIELDS.FIELD_CHAMBER_TOTAL, chamberTotal },
                { EMS_EQUIPMENTS_FIELDS.FIELD_ISMULTICHAMBER, isMultiChamber },
                { EMS_EQUIPMENTS_FIELDS.FIELD_PARENT_EQUIPMENT_KEY, parentEquipmentKey },
                { EMS_EQUIPMENTS_FIELDS.FIELD_EQUIPMENT_STATE_KEY, equipmentStateKey },
                { EMS_EQUIPMENTS_FIELDS.FIELD_EQUIPMENT_CHANGE_STATE_KEY, equipmentChangeStateKey },
                { EMS_EQUIPMENTS_FIELDS.FIELD_EQUIPMENT_REAL_KEY, equipmentRealKey },
                { EMS_EQUIPMENTS_FIELDS.FIELD_CREATOR, Creator },
                { EMS_EQUIPMENTS_FIELDS.FIELD_CREATE_TIMEZONE_KEY, CreateTimeZone },
                { EMS_EQUIPMENTS_FIELDS.FIELD_CREATE_TIME, string.Empty },
                { EMS_EQUIPMENTS_FIELDS.FIELD_EQUIPMENT_ASSETSNO, equipment_assetsno },
                { EMS_EQUIPMENTS_FIELDS.FIELD_EQUIPMENT_AV_TIME, equipment_av_time },
                { EMS_EQUIPMENTS_FIELDS.FIELD_EQUIPMENT_WPH, equipment_wph },
                { EMS_EQUIPMENTS_FIELDS.FIELD_EQUIPMENT_TRACT_TIME, equipment_tract_time }
            };

            FanHai.Hemera.Utils.Common.Utils.AddKeyValuesToDataTable(ref equipmentsDataTable, dataRow);

            equipmentsDataTable.AcceptChanges();

            //reqDS.Tables.Add(equipmentsDataTable);
            ds.Tables.Add(equipmentsDataTable);

            #endregion

            #region Build Input Parameters

            if (!string.IsNullOrEmpty(equipmentKey))
            {
                DataTable inputParamDataTable = PARAMETERS_INPUT.CreateDataTable();

                object inputKey      = DBNull.Value;
                object inputEditor   = DBNull.Value;
                object inputEditTime = DBNull.Value;

                if (!string.IsNullOrEmpty(equipmentKey))
                {
                    inputKey = equipmentKey;
                }

                if (!string.IsNullOrEmpty(Creator))
                {
                    inputEditor = Creator;
                }

                if (!string.IsNullOrEmpty(CreateTime))
                {
                    inputEditTime = CreateTime;
                }

                inputParamDataTable.Rows.Add(new object[] { inputKey, inputEditor, inputEditTime });

                inputParamDataTable.AcceptChanges();

                //reqDS.Tables.Add(inputParamDataTable);
                ds.Tables.Add(inputParamDataTable);
            }

            #endregion

            #region Call Remoting Interface

            try
            {
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();

                if (serverFactory != null)
                {
                    resDS = serverFactory.CreateIEquipments().InsertEquipments(ds);
                }
            }
            catch (Exception ex)
            {
                MessageService.ShowError(ex);

                return(false);
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }

            #endregion

            #region Process Output Parameters

            string outputcreateTime = string.Empty;

            string returnMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(resDS, ref outputcreateTime);

            if (string.IsNullOrEmpty(returnMsg))
            {
                CreateTime = outputcreateTime;

                return(true);
            }
            else
            {
                MessageService.ShowError(returnMsg);

                return(false);
            }

            #endregion
        }
Esempio n. 8
0
        /// <summary>
        /// Load Equipment Data
        /// </summary>
        /// <param name="equipmentName"></param>
        /// Owner:Andy Gao 2010-08-11 14:54:17
        private void LoadEquipmentsData(string equipmentName)
        {
            #region Variables

            DataSet resDS = new DataSet();

            #endregion

            #region Call Remoting Interface

            try
            {
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();

                if (serverFactory != null)
                {
                    int pages;
                    int records;
                    int pageNo   = this.paginationEquipments.PageNo;
                    int pageSize = this.paginationEquipments.PageSize;

                    if (pageNo <= 0)
                    {
                        pageNo = 1;
                    }

                    if (pageSize <= 0)
                    {
                        pageSize = PaginationControl.DEFAULT_PAGESIZE;
                    }

                    resDS = serverFactory.CreateIEquipments().GetAllChildEquipments(equipmentName, pageNo, pageSize, out pages, out records);

                    if (pages > 0 && records > 0)
                    {
                        this.paginationEquipments.PageNo   = pageNo > pages ? pages : pageNo;
                        this.paginationEquipments.PageSize = pageSize;
                        this.paginationEquipments.Pages    = pages;
                        this.paginationEquipments.Records  = records;
                    }
                    else
                    {
                        this.paginationEquipments.PageNo   = 0;
                        this.paginationEquipments.PageSize = PaginationControl.DEFAULT_PAGESIZE;
                        this.paginationEquipments.Pages    = 0;
                        this.paginationEquipments.Records  = 0;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageService.ShowError(ex);

                return;
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }

            #endregion

            #region Process Output Parameters

            string returnMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(resDS);

            if (string.IsNullOrEmpty(returnMsg))
            {
                BindDataToEquipmentsGrid(resDS.Tables[EMS_EQUIPMENTS_FIELDS.DATABASE_TABLE_NAME]);
            }
            else
            {
                MessageService.ShowError(returnMsg);
            }

            #endregion
        }