Exemplo n.º 1
0
 public void addFeaturedView(Database db, string id, string FeatType, string FeatLabel)
 {
     db.Execute("insert into Favorites (FavId,FaveType,FavLabel) values(" + id + "," + FeatType + ",'" + FeatLabel + "')");
 }
Exemplo n.º 2
0
        public void SaveRun(Database db, List<string> stats, Action<string> callback)
        {
            bool cont = true;
            string MissingField = "";
            if (stats[0] == "")
            {
                MissingField = "Horse Name";
                cont = false;
            }
            if (stats[1] == "")
            {
                MissingField = "Track";
                cont = false;
            }
            if (stats[2] == "")
            {
                MissingField = "Time Ran";
                cont = false;
            }
            if (stats[3] == "")
            {
                MissingField = "Distance";
                cont = false;
            }
            if (stats[4] == "")
            {
                MissingField = "Date Ran";
                cont = false;
            }
            if (cont)
            {
                string sdfsdff = FigureSIr(db, stats[2], stats[3]);

                try
                {
                    stats[4] = stats[4].Substring(0, stats[4].IndexOf(" "));
                    string sqlStr = "insert into FTH_History (HorseName,Track,RunTime,DateRan,Distance) values('";
                    sqlStr += stats[0] + "','";
                    sqlStr += stats[1] + "','";
                    sqlStr += stats[2] + "','";
                    sqlStr += stats[4] + "','";
                    sqlStr += stats[3] + "')";
                    db.Execute(sqlStr);
                }
                catch (Exception oe)
                {
                    MissingField = oe.ToString();
                }
            }
            else
            {
                callback("Sorry. " + MissingField + " is empty");
            }
        }