Ejemplo n.º 1
0
 public DesisionTreeMainWindow()
 {
     InitializeComponent();
     dbHandler    = new DataBaseHandler();
     desTreeInfo  = new DataContainer <List <string[]> >();
     learningInfo = new DataContainer <DataContainer <List <string> > >();
     LoadInformationForUsingDesTrees();
 }
 public void Updatedata(string Url, string status)
 {
     try
     {
         string InsertQuery = "Update Url_tb Set Status='" + status + "'where SiteUrl='" + Url + "'";
         DataBaseHandler.PerformQuery(InsertQuery, "Url_tb");
     }
     catch { }
 }
        public void TestAddEmployeeToPayrollUsingThreadsofDataBaseHandlerClassPassListOfEmployeesAndReceiveTheNumberOfRowsAffected()
        {
            DateTime startDateTimeThread = DateTime.Now;
            int      rowsThread          = DataBaseHandler.AddEmployeeToPayrollUsingThreads(employeeDetails);
            DateTime endDateTimeThread   = DateTime.Now;

            Console.WriteLine("The time taken for execution is: " + (endDateTimeThread - startDateTimeThread));
            Assert.AreEqual(3, rowsThread);
        }
Ejemplo n.º 4
0
    private static void createCardDataBase()
    {
        string create;
        string insert;

        create = "CREATE TABLE IF NOT EXISTS cards (" +
                 "id TEXT PRIMARY KEY, " +
                 "teamId TEXT, " +
                 "player1Id TEXT, " +
                 "player2Id TEXT, " +
                 "value INTEGER, " +
                 "inAction TEXT, " +
                 "outAction TEXT " +
                 ")";

        Debug.Log(create);
        DataBaseHandler.executeNonQuery(create);

        StreamReader sr           = new StreamReader("Assets/Data/GameData/CardData.tsv");
        string       fileContents = sr.ReadToEnd();

        sr.Close();
        string[] lines = fileContents.Split(new Char[] { '\n' });

        int length = lines.Length;

        for (int i = 1; i < length; ++i)
        {
            string   line   = lines[i];
            string[] values = line.Split(new Char[] { '\t' });

            if (values[0].Trim() != String.Empty)
            {
                insert = "INSERT INTO cards (id, teamId, player1Id, player2Id, value, inAction, outAction) VALUES ( " +
                         "'" + values[0].Trim() + "', " +
                         "'" + values[1].Trim() + "', " +
                         "'" + values[2].Trim() + "', " +
                         "'" + values[3].Trim() + "', " +
                         "'" + values[4].Trim() + "', " +
                         "'" + values[5].Trim() + "', " +
                         "'" + values[6].Trim() + "')";
                Debug.Log(insert);
                try
                {
                    DataBaseHandler.executeNonQuery(insert);
                }
                catch (System.Exception error)
                {
                    Debug.Log(error.ToString());
                    DataBaseHandler.close();

                    break;
                }
            }
        }
    }
Ejemplo n.º 5
0
        private void ClearProxy()
        {
            try
            {
                if (dgvAccount.Rows.Count <= 1)
                {
                    MessageBox.Show("There are no Accounts in DataBase");
                    return;
                }
                else
                {
                    try
                    {
                        DataSet ds = new DataSet();

                        using (SQLiteConnection con = new SQLiteConnection(DataBaseHandler.CONstr))
                        {
                            //using (SQLiteDataAdapter ad = new SQLiteDataAdapter("SELECT * FROM tb_FBAccount WHERE ProxyAddress = '" + proxyAddress + "'", con))
                            using (SQLiteDataAdapter ad = new SQLiteDataAdapter("SELECT * FROM tb_LinkedInAccount", con))
                            {
                                ad.Fill(ds);

                                if (ds.Tables[0].Rows.Count >= 1)
                                {
                                    AddLoggerAccountLoad("[ " + DateTime.Now + " ] => [ Please Wait Process Is Running ...! ]");

                                    if (MessageBox.Show("Do you really want to clear all proxies from Accounts", "Confirmation", MessageBoxButtons.YesNo) == DialogResult.Yes)
                                    {
                                        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                                        {
                                            string UpdateQuery = "Update tb_LinkedInAccount Set IPAddress='" + "" + "', IPPort='" + "" + "', IPUserName='******', IPPassword='******' WHERE UserName='******'";
                                            DataBaseHandler.UpdateQuery(UpdateQuery, "tb_LinkedInAccount");
                                        }

                                        AddLoggerAccountLoad("[ " + DateTime.Now + " ] => [ All Proxy details has been cleared. ]");
                                        LoadDataGrid();//Refresh Datagrid
                                    }
                                }
                                else
                                {
                                    MessageBox.Show("No Proxies To Clear");
                                }
                            }
                        }
                    }

                    catch (Exception ex)
                    {
                        //GlobusFileHelper.AppendStringToTextfileNewLine("Error in Clearing Proxies :- " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_TwtErrorLogs);
                    }
                }
            }
            catch
            {
            }
        }
Ejemplo n.º 6
0
        public static void Remove(Patient patient)
        {
            MySqlCommand command;

            DataBaseHandler.Open();
            command = new("DELETE FROM patients WHERE id = @id;", DataBaseHandler.Connection);
            command.Parameters.Add("@id", MySqlDbType.Int32).Value = patient.ID;
            command.ExecuteNonQuery();
            DataBaseHandler.Close();
        }
        protected async void Page_Load(Object sender, EventArgs e)
        {
            if (!(this.IsPostBack))
            {
                await DataBaseHandler.getAllShips();

                Console.WriteLine("page_load");
                setDataTables();
            }
        }
        public AlgoTraderCreatorPage()
        {
            this.InitializeComponent();
            MySqlDataReader reader = DataBaseHandler.GetData("SELECT FullName FROM Stock");

            while (reader.Read())
            {
                StockNameBox.Items.Add((string)reader["FullName"]);
            }
        }
Ejemplo n.º 9
0
 // Use this for initialization
 void Start()
 {
     if (text != null)
     {
         DataBaseHandler db   = new DataBaseHandler();
         User            user = db.getUser(1);
         text.text = user.getName() + "のカフェ庭";
     }
     coupon_dialog.SetActive(false);
 }
Ejemplo n.º 10
0
    public void SetCouponInfo(int coupon_id)
    {
        DataBaseHandler db = new DataBaseHandler();

        Coupon coupon = db.getCoupon(coupon_id);

        coupon_name.text = coupon.getName();
        ok_button.onClick.AddListener(() => onOkClick(coupon.getId()));
        cancel_button.onClick.AddListener(() => onCancelClick());
    }
Ejemplo n.º 11
0
 public void View()
 {
     try
     {
         string  select_query = "select * from tb_BlackListAccount";
         DataSet select_ds    = DataBaseHandler.SelectQuery(select_query, "tb_BlackListAccount");
         DGridViewBlackListUserDetails.DataSource = select_ds.Tables[0];
     }
     catch { }
 }
Ejemplo n.º 12
0
 private void DeleteBlackListUser(string ID)
 {
     try
     {
         string  delete_query = "delete from tb_BlackListAccount where ProfileID = '" + ID.ToString() + "'";
         DataSet select_ds    = DataBaseHandler.SelectQuery(delete_query, "tb_BlackListAccount");
         DGridViewBlackListUserDetails.DataSource = select_ds.Tables[0];
     }
     catch { }
 }
Ejemplo n.º 13
0
        public RedirectToRouteResult Add_Drug()
        {
            string Name     = Request.QueryString["Drug_Name"];
            string Price    = Request.QueryString["Drug_Price"];
            int    Quantity = Request.QueryString["Drug_quantity"];

            string [] data = { Name, Price, Quantity };
            DataBaseHandler.Insert("Pharmacy", data);
            return(RedirectToAction("Home", "Pharmacy"));
        }
Ejemplo n.º 14
0
 void OkClick()
 {
 #if UNITY_ANDROID && !UNITY_EDITOR
     DataBaseHandler db = new DataBaseHandler();
     db.AuthenticateCafe(current_cafe.getId(), "color", int.Parse(selected_cafe_image));
     add_cafe_diralog.SetActive(false);
 #else
     add_cafe_diralog.SetActive(false);
 #endif
 }
 private void DeleteStockButtonClick(string StockName)
 {
     DataBaseHandler.SetData("DELETE FROM Stock Where StockName = '" + StockName + "'");
     DataBaseHandler.SetData("DELETE FROM Inventories Where StockName = '" + StockName + "'");
     DataBaseHandler.SetData("DELETE FROM Trades Where StockName = '" + StockName + "'");
     DataBaseHandler.SetData("DELETE FROM WatchList Where StockName = '" + StockName + "'");
     DataBaseHandler.SetData("DELETE FROM Pool Where StockName = '" + StockName + "'");
     DataBaseHandler.SetData("DELETE FROM PricingHistory Where StockName = '" + StockName + "'");
     LoadValues();
 }
Ejemplo n.º 16
0
        public void UpdateUserMute(ulong userId, bool isMusted)
        {
            var idString = Converter.ConvertToString(userId);
            int Mute     = Converter.ConvertFromBool(isMusted);

            using (IDbConnection connection = new SQLiteConnection(DataBaseHandler.CnnVal(nameS)))
            {
                connection.Execute($"update UserAcc set IsMuted = {Converter.ConvertFromBool(isMusted)} WHERE Id = {userId};");
            }
        }
Ejemplo n.º 17
0
 public void test()
 {
     using (IDbConnection connection = new SQLiteConnection(DataBaseHandler.CnnVal(nameS)))
     {
         connection.Open();
         Console.WriteLine(connection.State);
         connection.Close();
         Console.WriteLine(connection.State);
     }
 }
Ejemplo n.º 18
0
 public void Mention_InsertIntotb_RandomiserMention(string LoginUserName, string ScreenName, string TweetUserId, string TweetUserName, string TweetMessage)
 {
     try
     {
         string strQuery = "INSERT INTO tb_RandomiserMention(LoginUserName ,ScreenName, TweetUserId , TweetUserName , TweetMessage , MentionStatus , TableStatus) VALUES ('" + LoginUserName + "' , '" + ScreenName + "' , '" + TweetUserId + "' , '" + TweetUserName + "' , '" + TweetMessage + "' , '0' , '0')";
         DataBaseHandler.InsertQuery(strQuery, "tb_RandomiserMention");
     }
     catch
     {
     }
 }
Ejemplo n.º 19
0
 public void Mention_InsertIntotb_Randomiser(string LoginUserName, string ReplyUserName, string MessageType, string Message, string DateTime, string MessageStatus, string TableStatus)
 {
     try
     {
         string strQuery = "INSERT INTO tb_Randomiser(LoginUserName ,ReplyUserName, MessageType , Message , DateTime , MessageStatus , TableStatus) VALUES ('" + LoginUserName + "' , '" + ReplyUserName + "' , '" + MessageType + "' , '" + Message + "' , '" + DateTime + "' , '" + MessageStatus + "' , '" + TableStatus + "')";
         DataBaseHandler.InsertQuery(strQuery, "tb_Randomiser");
     }
     catch
     {
     }
 }
Ejemplo n.º 20
0
 public void Updatetb_RandomiserMention(string userName, string tweetUserName)
 {
     try
     {
         string strQuery = "UPDATE tb_RandomiserMention SET MentionStatus = '1' WHERE        (LoginUserName = '******') AND (TweetUserName='******')";
         DataBaseHandler.UpdateQuery(strQuery, "tb_RandomiserMention");
     }
     catch
     {
     }
 }
Ejemplo n.º 21
0
 public void Updatetb_MentionReplyCampaign(string userName, string replyUserName)
 {
     try
     {
         string strQuery = "UPDATE tb_MentionReplyCampaign SET RandomiserMentionStatus = '1' WHERE        (UserName = '******') AND (ReplyUserName = '******' OR TweetUserName='******')";
         DataBaseHandler.UpdateQuery(strQuery, "tb_MentionReplyCampaign");
     }
     catch
     {
     }
 }
Ejemplo n.º 22
0
 public void DeleteAllfromtb_RandomiserMention()
 {
     try
     {
         string strQuery = "Delete from tb_RandomiserMention";
         DataBaseHandler.DeleteQuery(strQuery, "tb_RandomiserMention");
     }
     catch
     {
     }
 }
Ejemplo n.º 23
0
 public void Updatetb_Randomiser()
 {
     try
     {
         string strQuery = "update tb_Randomiser set TableStatus='1'";
         DataBaseHandler.UpdateQuery(strQuery, "tb_Randomiser");
     }
     catch
     {
     }
 }
Ejemplo n.º 24
0
 public void ReTweet_InserIntotb_Randomiser(string LoginUserName, string MessageType, string TweetId, string DateTime, string MessageStatus, string TableStatus)
 {
     try
     {
         string strQuery = "INSERT INTO tb_Randomiser(LoginUserName , MessageType , TweetId , DateTime , MessageStatus , TableStatus) VALUES ('" + LoginUserName + "' , '" + MessageType + "' , '" + TweetId + "' , '" + DateTime + "' , '" + MessageStatus + "' , '" + TableStatus + "')";
         DataBaseHandler.InsertQuery(strQuery, "tb_Randomiser");
     }
     catch
     {
     }
 }
 public void DeleteCompletlyFromtb_MentionReplyCampaign()
 {
     try
     {
         string query = "delete from tb_MentionReplyCampaign";
         DataBaseHandler.UpdateQuery(query, "tb_MentionReplyCampaign");
     }
     catch
     {
     }
 }
Ejemplo n.º 26
0
 private void UpdateRecord_GetNewTweet(string statusId, string UserName)
 {
     try
     {
         string query = "Update tb_ReplyCampaign set Status='0' where StatusId='" + statusId + "' and UserName='******'";
         DataBaseHandler.UpdateQuery(query, "tb_ReplyCampaign");
     }
     catch
     {
     }
 }
Ejemplo n.º 27
0
 public void Follow_InserIntotb_Randomiser(string LoginUserName, string Follow, string FollowUserName, string DateTime, string MessageStatus, string TableStatus)
 {
     try
     {
         string strQuery = "INSERT INTO tb_Randomiser(LoginUserName , Follow , FollowUserName , DateTime , MessageStatus , TableStatus) VALUES ('" + LoginUserName + "' , '" + Follow + "' , '" + FollowUserName + "' , '" + DateTime + "' , '" + MessageStatus + "' , '" + TableStatus + "')";
         DataBaseHandler.InsertQuery(strQuery, "tb_Randomiser");
     }
     catch
     {
     }
 }
Ejemplo n.º 28
0
 public void DeleteRecordsAfterReplyFromtb_ReplyCampaign(string statusId, string UserName)
 {
     try
     {
         string query = "Update tb_ReplyCampaign set Status='1' where Status='0' and StatusId='" + statusId + "' and UserName='******'";
         DataBaseHandler.UpdateQuery(query, "tb_ReplyCampaign");
     }
     catch
     {
     }
 }
Ejemplo n.º 29
0
 public void DeleteFromtb_ReplyCampaign()
 {
     try
     {
         string query = "Update tb_ReplyCampaign set Status='1' where Status='0'";
         DataBaseHandler.UpdateQuery(query, "tb_ReplyCampaign");
     }
     catch
     {
     }
 }
        protected void deactivateShip(object sender, EventArgs e)
        {
            Button b = ((Button)sender);

            string imo = ((Literal)b.Parent.FindControl("imo")).Text;

            DataBaseHandler.deactivateShip(imo);

            Console.WriteLine("deactivateShip before setdatatables");
            setDataTables();
        }
Ejemplo n.º 31
0
 public BoxHandler(DataBaseHandler dbh)
 {
     this.dbh = dbh;
 }
Ejemplo n.º 32
0
 public DataBaseHandler()
 {
     DataBase = this;
 }