public void ImportDataFromExcelEquity()
        {

            string excelFilePath = "C:/Users/ahksysuser06/Desktop/EDISData/International_Equity_Daily_Closing_Price_20131211.xlsx";
            // make sure your sheet name is correct, here sheet name is sheet1, so you can change the sheet name if have    different 
            string excelQuery = "select SecId,Name,Symbol from [Sheet1$]";
            try
            {
                string excelConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + excelFilePath +
                ";Extended Properties='Excel 12.0;HDR=YES;IMEX=1;'";
                OleDbConnection oleConn = new OleDbConnection(excelConnectionString);
                oleConn.Open();
                OleDbDataReader oleReader = new OleDbCommand(excelQuery, oleConn).ExecuteReader();
                //while (oleReader.Read())
                //{
                //    Domain.Portfolio.AggregateRoots.Asset.Equity equity = new AustralianEquity(edisRepo)
                //    {
                //        Name = oleReader.GetString(1),
                //        Sector = oleReader.GetString(0),
                //        Ticker = oleReader.GetString(2),
                //        EquityType = EquityTypes.AustralianEquity,
                //    };

                //    edisRepo.InsertEquityData(equity);
                //}
                while (oleReader.Read())
                {
                    Domain.Portfolio.AggregateRoots.Asset.Equity equity = new InternationalEquity(edisRepo)
                    {
                        Name = oleReader.GetString(1),
                        Sector = oleReader.GetString(0),
                        Ticker = oleReader.GetString(2),
                        EquityType = EquityTypes.InternationalEquity,
                    };

                    edisRepo.InsertEquityData(equity);
                }
                oleReader.Close();
                oleConn.Close();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
        public object[] DLookupA(string table, string fieldName, string clauses, string[] orderByFieldNames, bool orderByAsc)
        {
            List<object> data = new List<object>();
            bool connectedP = isConnectedDo;
            string query = "";
            try
            {
                query = "SELECT " + fieldName + " FROM " + table + " WHERE (" + clauses + ")" + ((orderByFieldNames.Length > 0) ? " ORDER BY " + getOrderByData(orderByFieldNames) + " " + ((orderByAsc) ? "ASC" : "DESC") : "");

                if (dbType == DatabaseType.MSSQL)
                {
                    getQueryDbChanger(query, SqlTypes.SELECT);
                    SqlDataReader Dr = new SqlCommand(query, MSSQLConn).ExecuteReader();
                    while (Dr.Read())
                    {
                        data.Add(Dr[0]);
                    }
                    Dr.Close();
                }
                else if (dbType == DatabaseType.MYSQL)
                {
                    MySqlDataReader Dr = new MySqlCommand(query, MySQLConn).ExecuteReader();
                    while (Dr.Read())
                    {
                        data.Add(Dr[0]);
                    }
                    Dr.Close();
                }
                else if (dbType == DatabaseType.MSACCESS2003 | dbType == DatabaseType.MSACCESS2007)
                {
                    OleDbDataReader Dr = new OleDbCommand(query, MSDBSQLConn).ExecuteReader();
                    while (Dr.Read())
                    {
                        data.Add(Dr[0]);
                    }
                    Dr.Close();
                }
            }
            catch (Exception eee)
            {
                OnError(eee);
                data.Clear();
                data.Add("ERROR: " + eee.Message);
                data.Add("ERRORI: " + table);
                data.Add("ERRORI: " + fieldName);
                data.Add("ERRORI: " + clauses);
                data.Add("ERRORI: " + query);
            }
            finally
            {
                if (!connectedP)
                    closeConnection();
            }
            return data.ToArray();
        }
        public object DLookup(string table, string fieldName, string clauses, string[] orderByFieldNames, bool orderByAsc)
        {
            object data = null;
            bool connectedP = isConnectedDo;
            try
            {
                string query = "SELECT TOP 1 " + fieldName + " FROM " + table + " WHERE (" + clauses + ")" + ((orderByFieldNames.Length > 0) ? " ORDER BY " + getOrderByData(orderByFieldNames) + " " + ((orderByAsc) ? "ASC" : "DESC") : "");

                if (dbType == DatabaseType.MSSQL)
                {
                    getQueryDbChanger(query, SqlTypes.SELECT);
                    SqlDataReader Dr = new SqlCommand(query, MSSQLConn).ExecuteReader();
                    if (Dr.Read())
                    {
                        data = Dr[0];
                    }
                    Dr.Close();
                }
                else if (dbType == DatabaseType.MYSQL)
                {
                    MySqlDataReader Dr = new MySqlCommand(query, MySQLConn).ExecuteReader();
                    if (Dr.Read())
                    {
                        data = Dr[0];
                    }
                    Dr.Close();
                }
                else if (dbType == DatabaseType.MSACCESS2003 | dbType == DatabaseType.MSACCESS2007)
                {
                    OleDbDataReader Dr = new OleDbCommand(query, MSDBSQLConn).ExecuteReader();
                    if (Dr.Read())
                    {
                        data = Dr[0];
                    }
                    Dr.Close();
                }
            }
            catch (Exception eee)
            {
                OnError(eee);
                data = eee.Message;
            }
            finally
            {
                if (!connectedP)
                    closeConnection();
            }
            return data;
        }
 public object DLookup(string sqlQuery)
 {
     object data = null;
     bool connectedP = isConnectedDo;
     try
     {
         if (dbType == DatabaseType.MSSQL)
         {
             getQueryDbChanger(sqlQuery, SqlTypes.SELECT);
             SqlDataReader Dr = new SqlCommand(sqlQuery, MSSQLConn).ExecuteReader();
             if (Dr.Read())
             {
                 data = Dr[0];
             }
             Dr.Close();
         }
         else if (dbType == DatabaseType.MYSQL)
         {
             MySqlDataReader Dr = new MySqlCommand(sqlQuery, MySQLConn).ExecuteReader();
             if (Dr.Read())
             {
                 data = Dr[0];
             }
             Dr.Close();
         }
         else if (dbType == DatabaseType.MSACCESS2003 | dbType == DatabaseType.MSACCESS2007)
         {
             OleDbDataReader Dr = new OleDbCommand(sqlQuery, MSDBSQLConn).ExecuteReader();
             if (Dr.Read())
             {
                 data = Dr[0];
             }
             Dr.Close();
         }
     }
     catch (Exception eee)
     {
         OnError(eee);
         data = eee.Message;
     }
     finally
     {
         if (!connectedP)
             closeConnection();
     }
     return data;
 }
Example #5
0
 public void Logined1()
 {
     OleDbCommand oleDbCommand = new OleDbCommand("SELECT * FROM Player Where Id=" + Conversions.ToString(this._My_Id), Data.conn_Account);
     OleDbDataReader oleDbDataReader = oleDbCommand.ExecuteReader();
     if (oleDbDataReader.Read())
     {
         this._My_Name = Conversions.ToString(oleDbDataReader["Name"]);
         this._My_Lv = Conversions.ToInteger(oleDbDataReader["Lv"]);
         this._My_Hp = Conversions.ToInteger(oleDbDataReader["Hp"]);
         this._My_HpMax = Conversions.ToInteger(oleDbDataReader["Hpmax"]);
         this._My_Sp = Conversions.ToInteger(oleDbDataReader["Sp"]);
         this._My_SpMax = Conversions.ToInteger(oleDbDataReader["Spmax"]);
         this._My_Point = Conversions.ToInteger(oleDbDataReader["Point"]);
         this._My_SkillPoint = Conversions.ToInteger(oleDbDataReader["SkillPoint"]);
         this._My_Int = Conversions.ToInteger(oleDbDataReader["Int"]);
         this._My_Atk = Conversions.ToInteger(oleDbDataReader["Atk"]);
         this._My_Def = Conversions.ToInteger(oleDbDataReader["Def"]);
         this._My_Hpx = Conversions.ToInteger(oleDbDataReader["Hpx"]);
         this._My_Spx = Conversions.ToInteger(oleDbDataReader["Spx"]);
         this._My_Agi = Conversions.ToInteger(oleDbDataReader["Agi"]);
         this._My_Int2 = Conversions.ToInteger(oleDbDataReader["Int2"]);
         this._My_Atk2 = Conversions.ToInteger(oleDbDataReader["Atk2"]);
         this._My_Def2 = Conversions.ToInteger(oleDbDataReader["Def2"]);
         this._My_Hpx2 = Conversions.ToInteger(oleDbDataReader["Hpx2"]);
         this._My_Spx2 = Conversions.ToInteger(oleDbDataReader["Spx2"]);
         this._My_Agi2 = Conversions.ToInteger(oleDbDataReader["Agi2"]);
         this._My_Texp = Conversions.ToInteger(oleDbDataReader["TExp"]);
         this._My_MapId = Conversions.ToInteger(oleDbDataReader["MapId"]);
         this._My_MapX = Conversions.ToInteger(oleDbDataReader["MapX"]);
         this._My_MapY = Conversions.ToInteger(oleDbDataReader["MapY"]);
         this._My_Reborn = Conversions.ToInteger(oleDbDataReader["Reborn"]);
         this._My_Job = Conversions.ToInteger(oleDbDataReader["Job"]);
         this._My_Sex = Conversions.ToInteger(oleDbDataReader["Sex"]);
         this._My_Hair = Conversions.ToInteger(oleDbDataReader["Hair"]);
         this._My_Thuoctinh = Conversions.ToInteger(oleDbDataReader["Thuoctinh"]);
         this._My_Ghost = Conversions.ToInteger(oleDbDataReader["Ghost"]);
         this._My_God = Conversions.ToInteger(oleDbDataReader["God"]);
         this._My_Color = Conversions.ToString(oleDbDataReader["Color"]);
         this._My_Gold = Conversions.ToInteger(oleDbDataReader["Gold"]);
         this._My_Tiengtam = Conversions.ToInteger(oleDbDataReader["Tiengtam"]);
         this._My_Gocnhin = Conversions.ToInteger(oleDbDataReader["Gocnhin"]);
         this._My_SttPetXuatChien = Conversions.ToInteger(oleDbDataReader["SttPetXuatChien"]);
         this._My_Pk = Conversions.ToInteger(oleDbDataReader["Pk"]);
         this._My_ThamChien = Conversions.ToInteger(oleDbDataReader["ThamChien"]);
     }
     oleDbDataReader.Close();
     Data.PlayerUpdateStatus(this._My_Id, DataStructure.Type_Status._hpx, this._My_Hpx);
     Data.PlayerUpdateStatus(this._My_Id, DataStructure.Type_Status._spx, this._My_Spx);
     Data.PlayerUpdateStatus(this._My_Id, DataStructure.Type_Status._atk, this._My_Atk);
     Data.PlayerUpdateStatus(this._My_Id, DataStructure.Type_Status._def, this._My_Def);
     Data.PlayerUpdateStatus(this._My_Id, DataStructure.Type_Status._Int, this._My_Int);
     Data.PlayerUpdateStatus(this._My_Id, DataStructure.Type_Status._agi, this._My_Agi);
     Data.PlayerUpdateStatus(this._My_Id, DataStructure.Type_Status._Hp, this._My_Hp);
     Data.PlayerUpdateStatus(this._My_Id, DataStructure.Type_Status._Sp, this._My_Sp);
     string text = "";
     string text2 = "";
     DataStructure.HomdoInfo homdoInfo = Data.TrangbiGetDataItem(this.conn, 1);
     DataStructure.HomdoInfo homdoInfo2 = Data.TrangbiGetDataItem(this.conn, 2);
     DataStructure.HomdoInfo homdoInfo3 = Data.TrangbiGetDataItem(this.conn, 3);
     DataStructure.HomdoInfo homdoInfo4 = Data.TrangbiGetDataItem(this.conn, 4);
     DataStructure.HomdoInfo homdoInfo5 = Data.TrangbiGetDataItem(this.conn, 5);
     DataStructure.HomdoInfo homdoInfo6 = Data.TrangbiGetDataItem(this.conn, 6);
     int iD = homdoInfo._ID;
     int iD2 = homdoInfo2._ID;
     int iD3 = homdoInfo3._ID;
     int iD4 = homdoInfo4._ID;
     int iD5 = homdoInfo5._ID;
     int iD6 = homdoInfo6._ID;
     int doben = homdoInfo._Doben;
     int doben2 = homdoInfo2._Doben;
     int doben3 = homdoInfo3._Doben;
     int doben4 = homdoInfo4._Doben;
     int doben5 = homdoInfo5._Doben;
     int doben6 = homdoInfo6._Doben;
     int @long = homdoInfo._Long;
     int long2 = homdoInfo2._Long;
     int long3 = homdoInfo3._Long;
     int long4 = homdoInfo4._Long;
     int long5 = homdoInfo5._Long;
     int long6 = homdoInfo6._Long;
     int giatriLong = homdoInfo._GiatriLong;
     int giatriLong2 = homdoInfo2._GiatriLong;
     int giatriLong3 = homdoInfo3._GiatriLong;
     int giatriLong4 = homdoInfo4._GiatriLong;
     int giatriLong5 = homdoInfo5._GiatriLong;
     int giatriLong6 = homdoInfo6._GiatriLong;
     int khang = homdoInfo._Khang;
     int khang2 = homdoInfo2._Khang;
     int khang3 = homdoInfo3._Khang;
     int khang4 = homdoInfo4._Khang;
     int khang5 = homdoInfo5._Khang;
     int khang6 = homdoInfo6._Khang;
     int tExp = homdoInfo._TExp;
     int tExp2 = homdoInfo2._TExp;
     int tExp3 = homdoInfo3._TExp;
     int tExp4 = homdoInfo4._TExp;
     int tExp5 = homdoInfo5._TExp;
     int tExp6 = homdoInfo6._TExp;
     checked
     {
         if (iD > 0)
         {
             text += Class5.smethod_11(iD);
             text2 = string.Concat(new string[]
             {
                 text2,
                 Class5.smethod_11(iD),
                 doben.ToString("X2"),
                 @long.ToString("X2"),
                 (giatriLong + 100).ToString("X2"),
                 khang.ToString("X2"),
                 Class5.smethod_12(tExp)
             });
         }
         if (iD2 > 0)
         {
             text += Class5.smethod_11(iD2);
             text2 = string.Concat(new string[]
             {
                 text2,
                 Class5.smethod_11(iD2),
                 doben2.ToString("X2"),
                 long2.ToString("X2"),
                 (giatriLong2 + 100).ToString("X2"),
                 khang2.ToString("X2"),
                 Class5.smethod_12(tExp2)
             });
         }
         if (iD3 > 0)
         {
             text += Class5.smethod_11(iD3);
             text2 = string.Concat(new string[]
             {
                 text2,
                 Class5.smethod_11(iD3),
                 doben3.ToString("X2"),
                 long3.ToString("X2"),
                 (giatriLong3 + 100).ToString("X2"),
                 khang3.ToString("X2"),
                 Class5.smethod_12(tExp3)
             });
         }
         if (iD4 > 0)
         {
             text += Class5.smethod_11(iD4);
             text2 = string.Concat(new string[]
             {
                 text2,
                 Class5.smethod_11(iD4),
                 doben4.ToString("X2"),
                 long4.ToString("X2"),
                 (giatriLong4 + 100).ToString("X2"),
                 khang4.ToString("X2"),
                 Class5.smethod_12(tExp4)
             });
         }
         if (iD5 > 0)
         {
             text += Class5.smethod_11(iD5);
             text2 = string.Concat(new string[]
             {
                 text2,
                 Class5.smethod_11(iD5),
                 doben5.ToString("X2"),
                 long5.ToString("X2"),
                 (giatriLong5 + 100).ToString("X2"),
                 khang5.ToString("X2"),
                 Class5.smethod_12(tExp5)
             });
         }
         if (iD6 > 0)
         {
             text += Class5.smethod_11(iD6);
             text2 = string.Concat(new string[]
             {
                 text2,
                 Class5.smethod_11(iD6),
                 doben6.ToString("X2"),
                 long6.ToString("X2"),
                 (giatriLong6 + 100).ToString("X2"),
                 khang6.ToString("X2"),
                 Class5.smethod_12(tExp6)
             });
         }
         this.UpdateStatusWhenUseItem();
         this.Sendpacket("F44402001408F4440300142100");
         this.Sendpacket(string.Concat(new string[]
         {
             "F444",
             Class5.smethod_11(33 + (int)Math.Round((double)text.Length / 2.0) + this._My_Name.Length),
             "03",
             Class5.smethod_12(this._My_Id),
             this._My_Sex.ToString("X2"),
             this._My_Ghost.ToString("X2"),
             this._My_God.ToString("X2"),
             Class5.smethod_11(this._My_MapId),
             Class5.smethod_11(this._My_MapX),
             Class5.smethod_11(this._My_MapY),
             this._My_Gocnhin.ToString("X2"),
             Class5.smethod_11(this._My_Hair),
             this._My_Color,
             ((int)Math.Round((double)text.Length / 4.0)).ToString("X2"),
             text,
             "0000000005",
             this._My_Reborn.ToString("X2"),
             this._My_Job.ToString("X2"),
             Class5.smethod_13(this._My_Name)
         }));
         this.Sendpacket(string.Concat(new string[]
         {
             "F444",
             Class5.smethod_11((int)Math.Round((double)this.GetlistSkill().Length / 2.0) + 113),
             "0503",
             this._My_Thuoctinh.ToString("X2"),
             Class5.smethod_11(this._My_Hp),
             Class5.smethod_11(this._My_Sp),
             Class5.smethod_11(this._My_Int),
             Class5.smethod_11(this._My_Atk),
             Class5.smethod_11(this._My_Def),
             Class5.smethod_11(this._My_Agi),
             Class5.smethod_11(this._My_Hpx),
             Class5.smethod_11(this._My_Spx),
             this._My_Lv.ToString("X2"),
             Class5.smethod_12(this._My_Texp),
             Class5.smethod_11(this._My_SkillPoint),
             Class5.smethod_11(this._My_Point),
             Class5.smethod_12(this._My_Tiengtam),
             Class5.smethod_11(this._My_HpMax),
             Class5.smethod_11(this._My_SpMax),
             Class5.smethod_12(this._My_Atk2),
             Class5.smethod_12(this._My_Def2),
             Class5.smethod_12(this._My_Int2),
             Class5.smethod_12(this._My_Agi2),
             Class5.smethod_12(this._My_Hpx2),
             Class5.smethod_12(this._My_Spx2),
             "F401F401F401F401F40100000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
             this.GetlistSkill()
         }));
         Server.ServerSend_PlayerOnline(this._My_Id, this._My_Sex, this._My_Thuoctinh, this._My_Lv, this._My_Ghost, this._My_God, this._My_MapId, this._My_MapX, this._My_MapY, this._My_Gocnhin, this._My_Hair, this._My_Color, Conversions.ToInteger(iD.ToString()), Conversions.ToInteger(iD2.ToString()), Conversions.ToInteger(iD3.ToString()), Conversions.ToInteger(iD4.ToString()), Conversions.ToInteger(iD5.ToString()), Conversions.ToInteger(iD6.ToString()), this._My_Reborn, this._My_Job, this._My_Name, this._My_SttPetXuatChien, this._My_Pk, this._My_ThamChien);
         Server.SendPalyerOnline(this._My_Id);
         Data.SendStatusAllPet(this._My_Id);
         Server.SendAllParty(this._My_Id);
         if (this._My_SttPetXuatChien > 0 & this._My_SttPetXuatChien <= 4)
         {
             Server.SendToClient(this._My_Id, "F44406001301" + Class5.smethod_12(Data.PetGetData(this.conn, this._My_SttPetXuatChien, DataStructure.Type_Pet._ID)));
         }
         Data.UpdateStatusPetWhenUseItemLogin(this._My_Id);
         this.Sendpacket("F44404002102" + this._My_Pk.ToString("X2") + this._My_ThamChien.ToString("X2"));
         string text3 = "";
         string text4 = "";
         string text5 = "";
         OleDbDataReader oleDbDataReader2 = new OleDbCommand("SELECT * FROM Homdo Where Id > 0", this.conn).ExecuteReader();
         while (oleDbDataReader2.Read())
         {
             int num = Conversions.ToInteger(oleDbDataReader2["Slot"]);
             int int_ = Conversions.ToInteger(oleDbDataReader2[DataStructure.Type_Homdo._ID]);
             int num2 = Conversions.ToInteger(oleDbDataReader2[DataStructure.Type_Homdo._Count]);
             int num3 = Conversions.ToInteger(oleDbDataReader2[DataStructure.Type_Homdo._Doben]);
             Conversions.ToInteger(oleDbDataReader2[DataStructure.Type_Homdo._Thuoctinh]);
             Conversions.ToInteger(oleDbDataReader2[DataStructure.Type_Homdo._GiatriThuoctinh]);
             int num4 = Conversions.ToInteger(oleDbDataReader2[DataStructure.Type_Homdo._Long]);
             int num5 = Conversions.ToInteger(oleDbDataReader2[DataStructure.Type_Homdo._GiatriLong]);
             int num6 = Conversions.ToInteger(oleDbDataReader2[DataStructure.Type_Homdo._Khang]);
             int int_2 = Conversions.ToInteger(oleDbDataReader2[DataStructure.Type_Homdo._TExp]);
             text3 = string.Concat(new string[]
             {
                 text3,
                 num.ToString("X2"),
                 Class5.smethod_11(int_),
                 num2.ToString("X2"),
                 num3.ToString("X2"),
                 num4.ToString("X2"),
                 (num5 + 100).ToString("X2"),
                 num6.ToString("X2"),
                 Class5.smethod_12(int_2)
             });
         }
         oleDbDataReader2.Close();
         oleDbDataReader2 = new OleDbCommand("SELECT * FROM Tuideo Where Id > 0", this.conn).ExecuteReader();
         while (oleDbDataReader2.Read())
         {
             int num7 = Conversions.ToInteger(oleDbDataReader2["Slot"]);
             int int_3 = Conversions.ToInteger(oleDbDataReader2[DataStructure.Type_Homdo._ID]);
             int num8 = Conversions.ToInteger(oleDbDataReader2[DataStructure.Type_Homdo._Count]);
             int num9 = Conversions.ToInteger(oleDbDataReader2[DataStructure.Type_Homdo._Doben]);
             Conversions.ToInteger(oleDbDataReader2[DataStructure.Type_Homdo._Thuoctinh]);
             Conversions.ToInteger(oleDbDataReader2[DataStructure.Type_Homdo._GiatriThuoctinh]);
             int num10 = Conversions.ToInteger(oleDbDataReader2[DataStructure.Type_Homdo._Long]);
             int num11 = Conversions.ToInteger(oleDbDataReader2[DataStructure.Type_Homdo._GiatriLong]);
             int num12 = Conversions.ToInteger(oleDbDataReader2[DataStructure.Type_Homdo._Khang]);
             int int_4 = Conversions.ToInteger(oleDbDataReader2[DataStructure.Type_Homdo._TExp]);
             text4 = string.Concat(new string[]
             {
                 text4,
                 num7.ToString("X2"),
                 Class5.smethod_11(int_3),
                 num8.ToString("X2"),
                 num9.ToString("X2"),
                 num10.ToString("X2"),
                 (num11 + 100).ToString("X2"),
                 num12.ToString("X2"),
                 Class5.smethod_12(int_4)
             });
         }
         oleDbDataReader2.Close();
         oleDbDataReader2 = new OleDbCommand("SELECT * FROM Luulang Where Id > 0", this.conn).ExecuteReader();
         while (oleDbDataReader2.Read())
         {
             int num13 = Conversions.ToInteger(oleDbDataReader2["Slot"]);
             int int_5 = Conversions.ToInteger(oleDbDataReader2[DataStructure.Type_Homdo._ID]);
             int num14 = Conversions.ToInteger(oleDbDataReader2[DataStructure.Type_Homdo._Count]);
             int num15 = Conversions.ToInteger(oleDbDataReader2[DataStructure.Type_Homdo._Doben]);
             Conversions.ToInteger(oleDbDataReader2[DataStructure.Type_Homdo._Thuoctinh]);
             Conversions.ToInteger(oleDbDataReader2[DataStructure.Type_Homdo._GiatriThuoctinh]);
             int num16 = Conversions.ToInteger(oleDbDataReader2[DataStructure.Type_Homdo._Long]);
             int num17 = Conversions.ToInteger(oleDbDataReader2[DataStructure.Type_Homdo._GiatriLong]);
             int num18 = Conversions.ToInteger(oleDbDataReader2[DataStructure.Type_Homdo._Khang]);
             int int_6 = Conversions.ToInteger(oleDbDataReader2[DataStructure.Type_Homdo._TExp]);
             text5 = string.Concat(new string[]
             {
                 text5,
                 num13.ToString("X2"),
                 Class5.smethod_11(int_5),
                 num14.ToString("X2"),
                 num15.ToString("X2"),
                 num16.ToString("X2"),
                 (num17 + 100).ToString("X2"),
                 num18.ToString("X2"),
                 Class5.smethod_12(int_6)
             });
         }
         oleDbDataReader2.Close();
         string text6 = "";
         if (text3.Length > 0)
         {
             text6 = "F444" + Class5.smethod_11(2 + (int)Math.Round((double)text3.Length / 2.0)) + "1705" + text3;
         }
         if (text4.Length > 0)
         {
             text6 = string.Concat(new string[]
             {
                 text6,
                 "F444",
                 Class5.smethod_11(2 + (int)Math.Round((double)text4.Length / 2.0)),
                 "172F",
                 text4
             });
         }
         if (text5.Length > 0)
         {
             text6 = string.Concat(new string[]
             {
                 text6,
                 "F444",
                 Class5.smethod_11(2 + (int)Math.Round((double)text5.Length / 2.0)),
                 "1766",
                 text5
             });
         }
         if (text6.Length > 0)
         {
             this.Sendpacket(text6);
         }
         this.Sendpacket("F444" + Class5.smethod_11(2 + (int)Math.Round((double)text2.Length / 2.0)) + "170B" + text2);
         this.Sendpacket("F4440A001A04" + Class5.smethod_12(this._My_Gold) + "00000000");
         string text7 = Class5.smethod_17("TSVN");
         this.Sendpacket(string.Concat(new string[]
         {
             "F444",
             Class5.smethod_11(text7.Length + 11),
             "2709",
             Class5.smethod_12(this._My_Id),
             "C4000000",
             text7.Length.ToString("X2"),
             Class5.smethod_13(text7)
         }));
         this.Sendpacket("F44402000504F44402000F0A");
         this.Sendpacket("F4441000020B00000000323031322F30382F3136");
         string text8 = Class5.smethod_17("http://tsonline.ns01.us");
         this.Sendpacket("F444" + Class5.smethod_11(text8.Length + 6) + "020B00000000" + Class5.smethod_13(text8));
         text8 = Class5.smethod_17("Chúc các bạn vui vẻ!");
         this.Sendpacket("F444" + Class5.smethod_11(text8.Length + 6) + "020B00000000" + Class5.smethod_13(text8));
         string text9 = "";
         int num19 = 1;
         do
         {
             int num20 = this.SkillSaveGetId(num19);
             if (num20 > 0)
             {
                 text9 = text9 + "02" + Class5.smethod_11(num20) + num19.ToString("X2");
             }
             num19++;
         }
         while (num19 <= 10);
         if (text9.Length > 0)
         {
             text9 = "2801" + text9;
             this.Sendpacket("F444" + Class5.smethod_11((int)Math.Round((double)text9.Length / 2.0)) + text9);
         }
         Data.GetDataItemOnMap(this._My_Id);
         this.method_0(9999999);
         if (this._My_Hp <= 0)
         {
             Data.PlayerUpdateDataId(this._My_Id, DataStructure.Type_Player._Hp, 1);
         }
         int num21 = 1;
         do
         {
             if (Data.PetGetData(this.conn, num21, DataStructure.Type_Pet._ID) > 0 && Data.PetGetData(this.conn, num21, DataStructure.Type_Pet._Hp) <= 0)
             {
                 Data.PetUpdateData(this._My_Id, num21, DataStructure.Type_Pet._Hp, 1);
             }
             num21++;
         }
         while (num21 <= 4);
         this._My_Logined = 1;
     }
 }
Example #6
0
 public virtual string getFieldList(string argString)
 {
     string cmdText = argString;
     string argObject = "";
     try
     {
         string connStr = this.connStr;
         string argRoutestr = cls.getParameter(connStr, "Data Source");
         string newValue = HttpContext.Current.Server.MapPath(cls.getActualRoute(argRoutestr));
         OleDbConnection connection = new OleDbConnection(connStr.Replace(argRoutestr, newValue));
         connection.Open();
         OleDbDataReader reader = new OleDbCommand(cmdText, connection).ExecuteReader();
         int fieldCount = reader.FieldCount;
         for (int i = 0; i < fieldCount; i++)
         {
             argObject = argObject + reader.GetName(i) + "|";
         }
         if (!cls.isEmpty(argObject))
         {
             argObject = cls.getLRStr(argObject, "|", "leftr");
         }
         reader.Close();
         connection.Close();
     }
     catch (Exception exception)
     {
         argObject = "";
         this.eMessage = exception.Message;
     }
     return argObject;
 }
Example #7
0
 public virtual object[] getDataAry(string argString)
 {
     this.rState = 0;
     string cmdText = argString;
     object[] objArray = null;
     try
     {
         string connStr = this.connStr;
         string argRoutestr = cls.getParameter(connStr, "Data Source");
         string newValue = HttpContext.Current.Server.MapPath(cls.getActualRoute(argRoutestr));
         OleDbConnection connection = new OleDbConnection(connStr.Replace(argRoutestr, newValue));
         connection.Open();
         OleDbDataReader reader = new OleDbCommand(cmdText, connection).ExecuteReader();
         int fieldCount = reader.FieldCount;
         object[,] objArray2 = null;
         while (reader.Read())
         {
             objArray2 = new object[fieldCount, 2];
             for (int i = 0; i < fieldCount; i++)
             {
                 objArray2[i, 0] = reader.GetName(i);
                 objArray2[i, 1] = reader.GetValue(i);
             }
             objArray = cls.mergeAry(objArray, objArray2);
         }
         reader.Close();
         connection.Close();
     }
     catch (Exception exception)
     {
         this.rState = 1;
         objArray = null;
         this.eMessage = exception.Message;
     }
     return objArray;
 }
Example #8
0
 public virtual string getFieldList(string argString)
 {
     string cmdText = argString;
     string argObject = "";
     try
     {
         OleDbConnection connection = new OleDbConnection(this.connStr);
         connection.Open();
         OleDbDataReader reader = new OleDbCommand(cmdText, connection).ExecuteReader();
         int fieldCount = reader.FieldCount;
         for (int i = 0; i < fieldCount; i++)
         {
             argObject = argObject + reader.GetName(i) + "|";
         }
         reader.Close();
         connection.Close();
     }
     catch (Exception exception)
     {
         argObject = "";
         this.eMessage = exception.Message;
     }
     return argObject;
 }
Example #9
0
		public virtual Dictionary<string, object>[] getDataAry(string strSQL)
        {
            this.rState = 0;
			Dictionary<string, object>[] rsArray = null;
			if ((string)strSQL != "")
            {
				try
				{
					OleDbConnection connection = new OleDbConnection(this.connStr);
					connection.Open();
					OleDbDataReader reader = new OleDbCommand(strSQL, connection).ExecuteReader();
					Dictionary<int, object> rsList = new Dictionary<int, object>();
					int fieldCount = reader.FieldCount;
					int num = 0;
					while (reader.Read())
					{
						Dictionary<string, object> rec = new Dictionary<string, object>();
						for (int i = 0; i < fieldCount; i++)
						{
							rec.Add(reader.GetName(i), reader.GetValue(i));
						}
						rsList.Add(num, rec);
						num ++;
					}
					reader.Close();
					connection.Close();

					rsArray = new Dictionary<string, object>[num];
					foreach (var kv in rsList)
					{
						rsArray[kv.Key] = (Dictionary<string, object>)kv.Value;
					}
				}
				catch (Exception exception)
				{
					this.rState = 1;
					var errMsg = new Dictionary<string, object>();
					errMsg.Add("msg", "Operate DB Error: " + exception.Message);
					rsArray = new Dictionary<string, object>[] { errMsg };
					this.eMessage = exception.Message;
				}
			}
			else
			{
				this.rState = 999;
			}
			return rsArray;
        }