예제 #1
0
        static byte IVUDefListSetupExist(short idx, string desc, out TableError lastError)
        {
            //TableError lastError;
            IVUDefListSetupTable.Key               = 1;
            IVUDefListSetupTable.Index.Value       = idx;
            IVUDefListSetupTable.Description.Value = desc;
            lastError = IVUDefListSetupTable.Get();

            if (lastError != TableError.NoError)
            {
                if (lastError != TableError.NotFound) //error other than NotFound
                {
                    //Microsoft.Dexterity.Applications.Dynamics.Forms.SyVisualStudioHelper.Functions.DexError.Invoke(lastError.ToString());
                    IVUDefListSetupTable.Close();
                    return(TABLE_ERROR);
                }
                else //NotFound
                {
                    IVUDefListSetupTable.Close();
                    return(ROW_NOT_FOUND);
                }
            }

            IVUDefListSetupTable.Close();
            return(ROW_FOUND);
        }
예제 #2
0
        static byte GLTrxLineExistByJournalEntry(int jrnEntry, out TableError lastError)
        {
            GLTrxLineWorkTable.Key = 4;
            GLTrxLineWorkTable.JournalEntry.Value = jrnEntry;
            GLTrxLineWorkTable.RangeStart();
            GLTrxLineWorkTable.RangeEnd();

            lastError = GLTrxLineWorkTable.GetFirst();

            if (lastError != TableError.NoError)
            {
                if (lastError != TableError.NotFound) //error other than not found
                {
                    GLTrxLineWorkTable.Close();
                    return(TABLE_ERROR);
                }
                else //Not Found
                {
                    return(ROW_NOT_FOUND);
                }
            }

            GLTrxLineWorkTable.Close();
            return(ROW_FOUND);
        }
예제 #3
0
    public void JoinRoom(byte roomid)
    {
        TableError pError = PlayerRole.Instance.TableManager.IsCanJoinTable(roomid, false);

        if (pError != TableError.TE_Sucess)
        {
            //进入房间失败了 我们进行处理
            tagJoinTableEvent pEvent = new tagJoinTableEvent(roomid, pError);
            MsgEventHandle.HandleMsg(pEvent);//无法进入房间的事件
            return;
        }
        GlobalEffectMgr.Instance.ShowLoadingMessage();

        //发送进入房间的命令到服务端去
        if (SceneMain.IsUserOldServer)
        {
            NetCmdJoinRoom ncr = new NetCmdJoinRoom();
            ncr.SetCmdType(NetCmdType.CMD_JOIN_ROOM);
            ncr.RoomType = roomid;
            NetServices.Instance.Send <NetCmdJoinRoom>(ncr);
        }
        else
        {
            CL_Cmd_JoinTable ncb = new CL_Cmd_JoinTable();
            ncb.SetCmdType(NetCmdType.CMD_CL_JoinTable);
            ncb.bTableType = roomid;
            NetServices.Instance.Send <CL_Cmd_JoinTable>(ncb);
        }
        State = HallState.HALL_JOIN_ROOM;
    }
예제 #4
0
        static byte UserDefinedExist(string IVTrx, string IVTrxType, out TableError lastError)
        {
            //TableError lastError;
            IVUDefTable.Key = 1;
            IVUDefTable.DocumentNumber.Value = IVTrx;
            IVUDefTable.DocumentType.Value   = Convert.ToInt16(IVTrxType);
            lastError = IVUDefTable.Get();

            if (lastError != TableError.NoError)
            {
                if (lastError != TableError.NotFound) //error other than NotFound
                {
                    //Microsoft.Dexterity.Applications.Dynamics.Forms.SyVisualStudioHelper.Functions.DexError.Invoke(lastError.ToString());
                    IVUDefTable.Close();
                    return(TABLE_ERROR);
                }
                else //NotFound
                {
                    IVUDefTable.Close();
                    return(ROW_NOT_FOUND);
                }
            }

            IVUDefTable.Close();
            return(ROW_FOUND);
        }
예제 #5
0
        static byte IVUDefListSetupExist(short idx, out TableError lastError)
        {
            //TableError lastError;
            IVUDefListSetupTable.Key = 2;
            IVUDefListSetupTable.Clear();
            IVUDefListSetupTable.Index.Value = idx;
            IVUDefListSetupTable.RangeStart();
            //IVUDefListSetupTable.Clear();
            //IVUDefListSetupTable.Index.Value = idx;
            IVUDefListSetupTable.RangeEnd();

            lastError = IVUDefListSetupTable.GetFirst();

            if (lastError != TableError.NoError)
            {
                if (lastError == TableError.NotFound | lastError == TableError.EndOfTable)  //NotFound or EndOfTable
                {
                    IVUDefListSetupTable.Close();
                    return(ROW_NOT_FOUND);
                }
                else
                {
                    //Microsoft.Dexterity.Applications.Dynamics.Forms.SyVisualStudioHelper.Functions.DexError.Invoke(lastError.ToString());
                    IVUDefListSetupTable.Close();
                    return(TABLE_ERROR);
                }
            }

            IVUDefListSetupTable.Close();
            return(ROW_FOUND);
        }
예제 #6
0
        public bool OnEnterRoom(byte roomid)
        {
            TableError pError = TableManager.Instance.IsCanEnterTable(roomid, false);

            if (pError != TableError.TE_Sucess)
            {
                //进入房间失败了 我们进行处理

                /*tagJoinTableEvent pEvent = new tagJoinTableEvent(roomid, pError);
                 * MsgEventHandle.HandleMsg(pEvent);//无法进入房间的事件*/
                UIManager.Instance.ShowMessage(pError.Description(), MessageBoxEnum.Style.Ok, null);
                return(false);
            }
            _curRoomId = roomid;
            State      = RoomState.HALL_JOIN_ROOM;
            //GlobalEffectMgr.Instance.ShowLoadingMessage();

            //发送进入房间的命令到服务端去
            //            CL_Cmd_JoinTable ncb = new CL_Cmd_JoinTable();
            //            ncb.SetCmdType(NetCmdType.CMD_CL_JoinTable);
            //            ncb.bTableType = roomid;
            //            NetManager.Instance.Send<CL_Cmd_JoinTable>(ncb);
            //            State = RoomState.HALL_JOIN_ROOM;
            return(true);
        }
예제 #7
0
        //static public void ClosePOPUserDefinedTable()
        //{
        //    POPUserDefinedTable.Close();
        //}

        //static byte OpenPOPUserDefinedTable(string POPReceipt)
        //{
        //    TableError lastError;
        //    POPUserDefinedTable.Key = 1;
        //    POPUserDefinedTable.PopReceiptNumber.Value = POPReceipt;
        //    lastError = POPUserDefinedTable.Get();

        //    if (lastError != TableError.NoError)
        //    {
        //        if (lastError != TableError.NotFound)
        //        {
        //            Microsoft.Dexterity.Applications.Dynamics.Forms.SyVisualStudioHelper.Functions.DexError.Invoke(lastError.ToString());
        //            POPUserDefinedTable.Close();
        //            return Constants.TABLE_ERROR;
        //        }
        //        else //NotFound
        //        {
        //            POPUserDefinedTable.Close();
        //            return Constants.ROW_NOT_FOUND;
        //        }
        //    }

        //    POPUserDefinedTable.Close();
        //    return Constants.ROW_FOUND;
        //}

        static byte UserDefinedExist(string POPReceipt, out TableError lastError)
        {
            //TableError lastError;
            POPUserDefinedTable.Key = 1;
            POPUserDefinedTable.PopReceiptNumber.Value = POPReceipt;
            lastError = POPUserDefinedTable.Get();

            if (lastError != TableError.NoError)
            {
                if (lastError != TableError.NotFound) //error other than NotFound
                {
                    Microsoft.Dexterity.Applications.Dynamics.Forms.SyVisualStudioHelper.Functions.DexError.Invoke(lastError.ToString());
                    POPUserDefinedTable.Close();
                    return(TABLE_ERROR);
                }
                else //NotFound
                {
                    POPUserDefinedTable.Close();
                    return(ROW_NOT_FOUND);
                }
            }

            POPUserDefinedTable.Close();
            return(ROW_FOUND);
        }
예제 #8
0
        public void DropErrorInDataBase()
        {
            int total = WebLink.LinkCauseError.Count;

            for (int i = 0; i < total; i++)
            {
                //----TableError----
                m_tableError = new TableError { Link = WebLink.LinkCauseError[0].Link, Date = WebLink.LinkCauseError[0].VisitedDate, MessageError = WebLink.LinkCauseError[0].ErrorMessage };

                m_dataBase.TableError.InsertOnSubmit(m_tableError);
                m_dataBase.SubmitChanges();

                WebLink.LinkCauseError.RemoveAt(0);
            }

            WebLink.LinkCauseError.Clear();
        }
예제 #9
0
            /// <summary>
            /// Get an account index from an account number
            /// </summary>
            public DataTable GetAccount(string accountNumberString)
            {
                var result = GLHelper.CreateBlankGLTable();

                // get the account index for the account master key requirement
                var accountIndex = this.GetAccountIndex(accountNumberString);

                // if there is an error, return null
                if (this.TableError != TableError.NoError)
                {
                    return(null);
                }

                try
                {
                    // set the required key for the table
                    this.GL00100.Key = (short)GL00100Keys.Index;
                    this.GL00100.AccountIndex.Value = accountIndex;

                    // get the data
                    this.TableError = this.GL00100.Get();

                    // check for an error, and set the return value, or return the error
                    if (this.TableError == TableError.NoError)
                    {
                        // add the data row using a mapping helper
                        result.AddGLRow(this.GL00100);
                    }
                    else
                    {
                        throw new Exception(this.TableError.ToString());
                    }
                }
                catch (Exception ex)
                {
                    throw new Exception("Error encountered: " + ex.Message);
                }
                finally
                {
                    // close the connection to the table accessed
                    // if not, users will receive a system processes are running message when attempting to close GP
                    this.GL00100.Close();
                }

                return(result);
            }
예제 #10
0
            /// <summary>
            /// Get an account index from an account number
            /// </summary>
            public DataTable GetAccountRange(string accountNumberStart, string accountNumberEnd)
            {
                var result    = GLHelper.CreateBlankGLTable();
                var indexList = this.GetAccountIndexRange(accountNumberStart, accountNumberEnd);


                try
                {
                    // for each account integer in the index list
                    // get the account data row, and map to the GL data table
                    foreach (int index in indexList)
                    {
                        // set the required key for the table
                        this.GL00100.Key = (short)GL00100Keys.Index;
                        this.GL00100.AccountIndex.Value = index;

                        // get the data
                        this.TableError = this.GL00100.Get();

                        // check for an error, and set the return value, or return the error
                        if (this.TableError == TableError.NoError)
                        {
                            // add the data row using a mapping helper
                            result.AddGLRow(this.GL00100);
                        }
                        else
                        {
                            throw new Exception(this.TableError.ToString());
                        }
                    }
                }
                catch (Exception ex)
                {
                    throw new Exception(ex.Message);
                }
                finally
                {
                    // close the connection to the table accessed
                    // if not, users will receive a system processes are running message when attempting to close GP
                    this.GL00100.Close();
                }

                return(result);
            }
예제 #11
0
        static public TableError SetIVUDefListSetup(byte idx, List <string> list)
        {
            TableError lastError;
            byte       checkExist;

            lastError = new TableError();

            foreach (string listItem in list)
            {
                checkExist = IVUDefListSetupExist(idx, listItem, out lastError);
                switch (checkExist)
                {
                case TABLE_ERROR:
                    return(lastError);

                case ROW_FOUND:
                    IVUDefListSetupTable.Key               = 1;
                    IVUDefListSetupTable.Index.Value       = idx;
                    IVUDefListSetupTable.Description.Value = listItem;
                    lastError = IVUDefListSetupTable.Change();
                    break;

                case ROW_NOT_FOUND:
                    lastError = IVUDefListSetupTable.Clear();
                    break;
                }
                if (lastError != TableError.NoError)
                {
                    //error retrieving/locking/clearing record
                    return(lastError);
                }
                IVUDefListSetupTable.Key               = 1;
                IVUDefListSetupTable.Index.Value       = idx;
                IVUDefListSetupTable.Description.Value = listItem;
                lastError = IVUDefListSetupTable.Save();
            }

            IVUDefListSetupTable.Close();
            return(lastError);
        }
예제 #12
0
        private void cmdSave_Click(object sender, EventArgs e)
        {
            TableError    err;
            List <string> list;

            err = new TableError();

            list = new List <string>();
            list.Clear();

            foreach (string obj in lstListItem.Items)
            {
                list.Add(obj);
            }

            err = DataAccessHelper.DeleteIVUDefListValues(_IVUDefListIdx);

            if (err == TableError.NoError | err == TableError.NotFound | err == TableError.EndOfTable)
            {
                //all deleted or not found, now save the new list
                err = DataAccessHelper.SetIVUDefListSetup(_IVUDefListIdx, list);
                if (err != TableError.NoError)
                {
                    //not saved/partial saved
                    Microsoft.Dexterity.Applications.Dynamics.Forms.SyVisualStudioHelper.Functions.DexError.Invoke(err.ToString());
                }
                else
                {
                    this.Close();
                }
            }
            else
            {
                //not deleted
                Microsoft.Dexterity.Applications.Dynamics.Forms.SyVisualStudioHelper.Functions.DexError.Invoke(err.ToString());
            }
        }
예제 #13
0
            /// <summary>
            /// Get an account index from an account number
            /// </summary>
            public int GetAccountIndex(string accountNumberString)
            {
                var index = 0;

                try
                {
                    // set the required key for the table
                    this.GL00105.Key = (short)GL00105Keys.NumberString;
                    this.GL00105.AccountNumberString.Value = accountNumberString;

                    // get a data row
                    this.TableError = this.GL00105.Get();

                    // check for an error, and set the return value, or return the error
                    if (this.TableError == TableError.NoError)
                    {
                        index = this.GL00105.AccountIndex;
                    }
                    else
                    {
                        throw new Exception(this.TableError.ToString());
                    }
                }
                catch (Exception ex)
                {
                    throw new Exception("Error encountered: " + ex.Message);
                }
                finally
                {
                    // close the connection to the table accessed
                    // if not, users will receive a system processes are running message when attempting to close GP
                    this.GL00105.Close();
                }

                return(index);
            }
예제 #14
0
 public tagJoinTableEvent(Byte TableID, TableError Error)
     : base(MsgEventType.MET_Table_Join)
 {
     this.TableID = TableID;
     this.Error   = Error;
 }
예제 #15
0
파일: RoleTable.cs 프로젝트: profiles/Fish
    public UInt32 GetTableErrorParam(Byte TableType, TableError Error)
    {
        if (!FishConfig.Instance.m_TableInfo.m_TableConfig.ContainsKey(TableType))
        {
            return(0);
        }

        switch (Error)
        {
        case TableError.TE_MinGlobel:
        {
            return(FishConfig.Instance.m_TableInfo.m_TableConfig[TableType].MinGlobelSum);
        }
        break;

        case TableError.TE_MaxGlobel:
        {
            return(FishConfig.Instance.m_TableInfo.m_TableConfig[TableType].MaxGlobelSum);
        }
        break;

        case TableError.TE_MinCurrcey:
        {
            return(FishConfig.Instance.m_TableInfo.m_TableConfig[TableType].MinCurreySum);
        }
        break;

        case TableError.TE_MaxCurrcey:
        {
            return(FishConfig.Instance.m_TableInfo.m_TableConfig[TableType].MaxCurreySum);
        }
        break;

        case TableError.TE_ItemError:
        {
            if (FishConfig.Instance.m_TableInfo.m_TableConfig[TableType].JoinItemMap.Count > 0)
            {
                for (int i = 0; i < FishConfig.Instance.m_TableInfo.m_TableConfig[TableType].JoinItemMap.Count; ++i)
                {
                    UInt32 ItemID  = FishConfig.Instance.m_TableInfo.m_TableConfig[TableType].JoinItemMap.Keys.ElementAt <UInt32>(i);
                    UInt32 ItemSum = FishConfig.Instance.m_TableInfo.m_TableConfig[TableType].JoinItemMap.Values.ElementAt <UInt32>(i);
                    if (PlayerRole.Instance.ItemManager.GetItemSum(ItemID) < ItemSum)
                    {
                        return(ItemID);
                    }
                }
            }
        }
        break;

        case TableError.TE_RateError:
        {
            return(FishConfig.Instance.m_TableInfo.m_TableConfig[TableType].MinRate);       //最低倍率不符合桌子的要求
        }
        break;

        case TableError.TE_MinLevel:
        {
            return(FishConfig.Instance.m_TableInfo.m_TableConfig[TableType].MinLevel);
        }
        break;

        case TableError.TE_MaxLevel:
        {
            return(FishConfig.Instance.m_TableInfo.m_TableConfig[TableType].MaxLevel);
        }
        break;
        }

        return(0);
    }
예제 #16
0
            /// <summary>
            /// Get an account index from an account number
            /// </summary>
            public List <int> GetAccountIndexRange(string accountNumberStart, string accountNumberEnd)
            {
                var index = new List <int>();

                try
                {
                    // set the required key for the table
                    this.GL00105.Key = (short)GL00105Keys.NumberString;


                    // set the start of the range
                    this.GL00105.Clear();
                    this.GL00105.AccountNumberString.Value = accountNumberStart;
                    this.GL00105.RangeStart();


                    // set the end of the range
                    this.GL00105.Clear();
                    this.GL00105.AccountNumberString.Value = accountNumberEnd;
                    this.GL00105.RangeEnd();


                    // get the first data row
                    this.TableError = this.GL00105.GetFirst();


                    // check for an error, and set the return value, or return the error
                    if (this.TableError == TableError.NoError)
                    {
                        index.Add(this.GL00105.AccountIndex.Value);
                    }
                    else
                    {
                        throw new Exception(this.TableError.ToString());
                    }


                    // loop through the remaining rows in the range, and add them to the dataset
                    while (this.TableError != TableError.EndOfTable)
                    {
                        // get the next record
                        this.TableError = this.GL00105.GetNext();

                        switch (this.TableError)
                        {
                        case TableError.NoError:
                            index.Add(this.GL00105.AccountIndex.Value);
                            break;

                        case TableError.EndOfTable:
                            break;

                        default:
                            throw new Exception(this.TableError.ToString());
                        }
                    }
                    ;
                }
                catch (Exception ex)
                {
                    throw new Exception("Error encountered: " + ex.Message);
                }
                finally
                {
                    // close the connection to the table accessed
                    // if not, users will receive a system processes are running message when attempting to close GP
                    this.GL00105.Close();
                }

                return(index);
            }