Ejemplo n.º 1
0
        public Kv CheckoutAccount()
        {
            Kv          kv          = new Kv();
            string      VoucherNo   = Kv.Get("VoucherNo");
            UserVoucher UserVoucher = UserVoucher.CheckoutAccount(base.Kv.Cxt, VoucherNo);

            if (UserVoucher != null)
            {
                User User = User.GetUserByID(base.Kv.Cxt, UserVoucher.UserID);
                kv.Set("Payment", User.Fini);
                kv.Set("ExpiryDate", UserVoucher.ExpiryDate);
                if (UserVoucher.IsUsed == false)
                {
                    kv.Set("Message", "0");
                }
                else
                {
                    kv.Set("Message", "1");
                }
            }
            else
            {
                kv.Set("Message", "2");
            }
            return(kv);
        }
Ejemplo n.º 2
0
        public bool AddUser()
        {
            User item = new User();

            item.SetColumn("RoomID", Kv.Get("RoomID"));
            item.SetColumn("UserStatusID", Kv.Get("UserStatusID"));
            item.SetColumn("RankID", Kv.Get("RankID"));
            item.SetColumn("CountryID", Kv.Get("CountryID"));
            item.SetColumn("NearestCityID", Kv.Get("NearestCityID"));
            item.SetColumn("GenderID", Kv.Get("GenderID"));
            item.SetColumn("FideTitleID", Kv.Get("FideTitleID"));
            item.SetColumn("IccfTitleID", Kv.Get("IccfTitleID"));
            item.SetColumn("FideStrength", Kv.Get("FideStrength"));
            item.SetColumn("IccfStrength", Kv.Get("IccfStrength"));
            item.SetColumn("ScocialID", Kv.Get("ScocialID"));
            item.SetColumn("UserName", Kv.Get("UserName"));
            item.SetColumn("Email", Kv.Get("Email"));
            item.SetColumn("FirstName", Kv.Get("FirstName"));
            item.SetColumn("LastName", Kv.Get("LastName"));
            item.SetColumn("Engine", Kv.Get("Engine"));
            item.SetColumn("PasswordHint", Kv.Get("PasswordHint"));
            item.SetColumn("PersonalNotes", Kv.Get("PersonalNotes"));
            item.SetColumn("Url", Kv.Get("Url"));
            item.SetColumn("DateLastLogin", Kv.Get("DateLastLogin"));
            item.SetColumn("DateOfBirth", Kv.Get("DateOfBirth"));
            item.SetColumn("Password", UCrypto.Encrypt(Kv.Get("Password")));
            item.Save();


            return(false);
        }
Ejemplo n.º 3
0
 private void Init()
 {
     if (string.IsNullOrEmpty(Kv.Get(Kv.DataTable, "WhiteUseTablebases")))
     {
         WhiteUseTablebases = false;
     }
     if (string.IsNullOrEmpty(Kv.Get(Kv.DataTable, "WhiteHashTableSize")))
     {
         WhiteHashTableSize = 311;
     }
     if (string.IsNullOrEmpty(Kv.Get(Kv.DataTable, "BlackUseTablebases")))
     {
         BlackUseTablebases = false;
     }
     if (string.IsNullOrEmpty(Kv.Get(Kv.DataTable, "BlackHashTableSize")))
     {
         BlackHashTableSize = 311;
     }
     Save();
 }
Ejemplo n.º 4
0
        public void UpdateGame()
        {
            App.Model.Db.Game item = new App.Model.Db.Game(base.Kv.Cxt, Kv.GetInt32("GameID"));

            if (!string.IsNullOrEmpty(Kv.Get("GameXml")))
            {
                item.GameXml = Kv.Get("GameXml");
            }

            item.GameResultID = Kv.GetInt32("GameResult");
            item.GameFlags    = Kv.Get("GameFlags");
            item.Save();
        }
Ejemplo n.º 5
0
        public DataTable GetUserByName()
        {
            Kv kv1 = new Kv();

            kv1.DataTable = User.GetUserByName(base.Kv.Cxt, Kv.Get("UserName"));
            if (kv1.DataTable.Rows.Count > 0)
            {
                DataColumn dc = new DataColumn("UserImage");
                kv1.DataTable.Columns.Add(dc);
                kv1.DataTable.Rows[0]["UserImage"] = GetUserImage(Ap.WebFolderUserImages + kv1.DataTable.Rows[0]["UserID"]);//kv1.GetInt32("UserID"));
            }
            return(kv1.DataTable);
        }
Ejemplo n.º 6
0
        void pgn_OnGameLoaded(string gameXml)
        {
            //TestDebugger.Instance.WriteLog(gameXml);
            CurrentGameNo++;
            databaseGameNo++;
            try
            {
                Kv     kvGame   = new Kv(gameXml, true);
                string movesXml = Kv.Get(kvGame.DataTable, "Moves");
                if (movesXml == EmptyMoves)
                {
                    movesXml = TempMoves;
                }
                Kv kvMoves = new Kv(movesXml, true);

                if (isTotalGamesCalculated)
                {
                    backgroundWorker.ReportProgress(CurrentGameNo);
                }
                AddGame(kvGame, kvMoves);
            }
            catch (OutOfMemoryException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw;
                //TestDebugger.Instance.ErrorConvert(ex, gameXml);
            }

            if (backgroundWorker.CancellationPending)
            {
                if (workEventArgument != null)
                {
                    workEventArgument.Cancel = true;
                    pgn.Close();
                    return;
                }
            }
        }
Ejemplo n.º 7
0
        private GameData GetGameData(Kv kvGame)
        {
            //Game game = new Game();
            GameData gameData = new GameData(this.Game);

            gameData.Clear();
            // load game data

            if (!string.IsNullOrEmpty(kvGame.Get("Event")))
            {
                gameData.Tournament = kvGame.Get("Event");
            }
            else
            {
                gameData.Tournament = string.Empty;
            }

            if (!string.IsNullOrEmpty(kvGame.Get("Date")))
            {
                string[] date = kvGame.Get("Date").Split('.');
                if (date[0] != "????")
                {
                    gameData.Year   = Convert.ToDecimal(date[0]);
                    gameData.IsYear = true;
                }
                if (date[1] != "??")
                {
                    gameData.Month   = Convert.ToDecimal(date[1]);
                    gameData.IsMonth = true;
                }
                if (date[2] != "??")
                {
                    gameData.Day   = Convert.ToDecimal(date[2]);
                    gameData.IsDay = true;
                }
            }

            if (!string.IsNullOrEmpty(kvGame.Get("White")))
            {
                string[] white = kvGame.Get("White").Split(',');
                if (white.Length > 1)
                {
                    gameData.White1 = white[0];
                    gameData.White2 = white[1];
                }
                else
                {
                    gameData.White1 = white[0];
                }
            }
            else
            {
                gameData.White1 = string.Empty;
                gameData.White2 = string.Empty;
            }

            if (!string.IsNullOrEmpty(kvGame.Get("Black")))
            {
                string[] black = kvGame.Get("Black").Split(',');
                if (black.Length > 1)
                {
                    gameData.Black1 = black[0];
                    gameData.Black2 = black[1];
                }
                else
                {
                    gameData.Black1 = black[0];
                }
            }
            else
            {
                gameData.Black1 = string.Empty;
                gameData.Black2 = string.Empty;
            }

            if (!string.IsNullOrEmpty(kvGame.Get("BlackElo")))
            {
                gameData.EloBlack = Convert.ToDecimal(kvGame.Get("BlackElo"));
            }

            if (!string.IsNullOrEmpty(kvGame.Get("WhiteElo")))
            {
                gameData.EloWhite = Convert.ToDecimal(kvGame.Get("WhiteElo"));
            }

            if (!string.IsNullOrEmpty(kvGame.Get("Result")))
            {
                gameData.Result = kvGame.Get("Result");
            }
            else
            {
                gameData.Result = string.Empty;
            }
            return(gameData);
        }
Ejemplo n.º 8
0
 public static string Get(SysKv sysKv)
 {
     return(Kv.Get(SysKv, sysKv.ToString()));
 }
Ejemplo n.º 9
0
 public string Get(string key)
 {
     return(Kv.Get(DataTable, key));
 }
Ejemplo n.º 10
0
 public string Get(StdKv key)
 {
     return(Kv.Get(DataTable, key.ToString()));
 }