示例#1
0
 /// <summary>
 /// 删除方法
 /// </summary>
 /// <returns></returns>
 public override bool Delete()
 {
     try
     {
         DataSet dsReturn = null;
         //调用远程对象
         IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();
         //远程对象调用成功
         if (null != serverFactory)
         {
             //调用远程对象的删除线边仓数据的方法,根据主键删除线边仓数据
             dsReturn  = serverFactory.CreateIStoreEngine().DeleteStore(_storeKey);
             _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
             if (_errorMsg != "")
             {
                 MessageService.ShowError(_errorMsg);
                 return(false);
             }
             else
             {
                 this.ClearData();
             }
         }
     }
     catch (Exception ex)
     {
         MessageService.ShowError(ex);
     }
     finally
     {
         CallRemotingService.UnregisterChannel();
     }
     return(true);
 }
示例#2
0
        /// <summary>
        /// Get storemat info
        /// </summary>
        /// <returns>DataTable for storemat info</returns>
        public DataSet GetStoreMatInfo(DataTable paramTable)
        {
            DataSet dsReturn = new DataSet();

            try
            {
                IServerObjFactory factor = CallRemotingService.GetRemoteObject();
                if (null != factor)
                {
                    dsReturn = factor.CreateIStoreEngine().GetStoreMatInfo(paramTable);
                    string msg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                    if (msg != string.Empty)
                    {
                        MessageService.ShowError(msg);
                        return(null);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageService.ShowError(ex);
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }

            return(dsReturn);
        }
示例#3
0
        public override bool Insert()
        {
            DataSet   dataSet    = new DataSet();
            DataTable storeTable = DataTableHelper.CreateDataTableForInsertStore();
            Dictionary <string, string> dataRow = new Dictionary <string, string>()
            {
                { WST_STORE_FIELDS.FIELD_CREATOR, Creator },
                { WST_STORE_FIELDS.FIELD_CREATE_TIMEZONE, CreateTimeZone },
                { WST_STORE_FIELDS.FIELD_DESCRIPTION, _description },
                { WST_STORE_FIELDS.FIELD_LOCATION_KEY, _locationKey },
                { WST_STORE_FIELDS.FIELD_OBJECT_STATUS, _objectStatus },
                { WST_STORE_FIELDS.FIELD_STORE_KEY, _storeKey },
                { WST_STORE_FIELDS.FIELD_STORE_NAME, _storeName },
                { WST_STORE_FIELDS.FIELD_STORE_TYPE, _storeType },
                { WST_STORE_FIELDS.FIELD_TYPE_NAME, _typeName },
                { WST_STORE_FIELDS.FIELD_OPERATION_NAME, _operationName },
                { WST_STORE_FIELDS.FIELD_REQUEST_FLAG, _requestFlag },
            };

            FanHai.Hemera.Utils.Common.Utils.AddRowDataToDataTable(ref storeTable, dataRow);
            dataSet.Tables.Add(storeTable);
            try
            {
                DataSet           dsReturn      = null;
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();
                if (null != serverFactory)
                {
                    dsReturn  = serverFactory.CreateIStoreEngine().AddStore(dataSet);
                    _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                    if (_errorMsg != "")
                    {
                        MessageService.ShowError(_errorMsg);
                        return(false);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageService.ShowError(ex);
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
            return(true);
        }
示例#4
0
        public void TransferFromStore()
        {
            DataSet dsReturn = new DataSet();

            #region build DataSet
            DataSet   dsFrom    = new DataSet();
            Hashtable hashData  = new Hashtable();
            DataTable dataTable = new DataTable();
            if (_rowKey != "")
            {
                hashData.Add(WST_STORE_MAT_FIELDS.FIELD_ROW_KEY, _rowKey);
            }
            if (_itemNo != "")
            {
                hashData.Add(WST_STORE_MAT_FIELDS.FIELD_ITEM_NO, _itemNo);
            }
            if (hashData.Count > 0)
            {
                hashData.Add(WST_STORE_MAT_FIELDS.FIELD_EDITOR, Editor);
                hashData.Add(WST_STORE_MAT_FIELDS.FIELD_EDIT_TIMEZONE, EditTimeZone);
                dataTable           = FanHai.Hemera.Share.Common.CommonUtils.ParseToDataTable(hashData);
                dataTable.TableName = WST_STORE_MAT_FIELDS.DATABASE_TABLE_NAME;
                dsFrom.Tables.Add(dataTable);
            }
            #endregion
            try
            {
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();
                if (null != serverFactory)
                {
                    dsReturn  = serverFactory.CreateIStoreEngine().TransferFromStore(dsFrom);
                    _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                }
            }
            catch (Exception ex)
            {
                _errorMsg = ex.Message;
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
        }
示例#5
0
 /// <summary>
 /// 获取线上仓数据集合。
 /// </summary>
 /// <returns>
 /// 包含线上仓数据的数据集对象。
 /// [STORE_KEY, STORE_NAME,STORE_TYPE]
 /// </returns>
 public DataTable GetStoreName()
 {
     try
     {
         IServerObjFactory factor   = CallRemotingService.GetRemoteObject();
         DataSet           dsReturn = factor.CreateIStoreEngine().GetStoreName();
         _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
         if (string.IsNullOrEmpty(_errorMsg))
         {
             return(dsReturn.Tables[0]);
         }
     }
     catch (Exception ex)
     {
         _errorMsg = ex.Message;
     }
     finally
     {
         CallRemotingService.UnregisterChannel();
     }
     return(null);
 }
示例#6
0
        public DataSet GetLotsInStore()
        {
            DataSet dsReturn = new DataSet();

            try
            {
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();
                if (null != serverFactory)
                {
                    dsReturn  = serverFactory.CreateIStoreEngine().GetLotsInStore(_storeKey);
                    _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                }
            }
            catch (Exception ex)
            {
                _errorMsg = ex.Message;
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
            return(dsReturn);
        }
示例#7
0
        public DataSet GetErrorMessageInfor(string strUser)
        {
            DataSet dsReturn = new DataSet();

            try
            {
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();
                if (null != serverFactory)
                {
                    dsReturn = serverFactory.CreateIStoreEngine().GetErrorMessageInfor(strUser);
                    //dsReturn = serverFactory.CreateIWipJobAutoTrack().GetErrorMessageInfor(strUser);
                    _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                }
            }
            catch (Exception ex)
            {
                MessageService.ShowMessage(ex.Message);
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
            return(dsReturn);
        }
示例#8
0
        public override bool Update()
        {
            //if (IsDirty)
            //{
            DataSet dataSet = new DataSet();

            if (this.DirtyList.Count > 1)
            {
                DataTable storeTable = DataTableHelper.CreateDataTableForUpdateBasicData(WST_STORE_FIELDS.DATABASE_TABLE_NAME);

                foreach (string Key in this.DirtyList.Keys)
                {
                    Dictionary <string, string> rowData = new Dictionary <string, string>()
                    {
                        { COMMON_FIELDS.FIELD_COMMON_UPDATE_KEY, _storeKey },
                        { COMMON_FIELDS.FIELD_COMMON_UPDATE_NAME, Key },
                        { COMMON_FIELDS.FIELD_COMMON_UPDATE_OLD_VALUE, this.DirtyList[Key].FieldOriginalValue },
                        { COMMON_FIELDS.FIELD_COMMON_UPDATE_NEW_VALUE, this.DirtyList[Key].FieldNewValue }
                    };
                    FanHai.Hemera.Utils.Common.Utils.AddRowDataToDataTable(ref storeTable, rowData);
                }
                if (storeTable.Rows.Count > 0)
                {
                    dataSet.Tables.Add(storeTable);
                }
                try
                {
                    DataSet           dsReturn      = null;
                    IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();
                    if (null != serverFactory)
                    {
                        dsReturn  = serverFactory.CreateIStoreEngine().UpdateStore(dataSet);
                        _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                        if (_errorMsg != "")
                        {
                            if (_errorMsg == COMMON_FIELDS.FIELD_COMMON_EDITTIME_EXP)
                            {
                                //提示“数据已经被修改,请刷新后再操作!”信息
                                MessageService.ShowWarning("${res:Global.RecordExpired}");
                            }
                            else
                            {
                                MessageService.ShowError(_errorMsg);
                            }
                            return(false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageService.ShowError(ex);
                }
                finally
                {
                    CallRemotingService.UnregisterChannel();
                }
            }
            else
            {
                MessageService.ShowMessage("${res:FanHai.Hemera.Addins.FMM.Msg.UpdateError}", "${res:Global.SystemInfo}");
            }
            //}
            //else
            //{
            //    MessageService.ShowMessage("${res:FanHai.Hemera.Addins.FMM.Msg.UpdateError}", "${res:Global.SystemInfo}");
            //}
            return(true);
        }