コード例 #1
0
 public DesisionTreeMainWindow()
 {
     InitializeComponent();
     dbHandler    = new DataBaseHandler();
     desTreeInfo  = new DataContainer <List <string[]> >();
     learningInfo = new DataContainer <DataContainer <List <string> > >();
     LoadInformationForUsingDesTrees();
 }
コード例 #2
0
 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 { }
 }
コード例 #3
0
        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);
        }
コード例 #4
0
ファイル: DataGenerator.cs プロジェクト: gmruben/CTBGProject
    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;
                }
            }
        }
    }
コード例 #5
0
ファイル: frmAccounts.cs プロジェクト: ondrocks/inboard
        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
            {
            }
        }
コード例 #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();
        }
コード例 #7
0
        protected async void Page_Load(Object sender, EventArgs e)
        {
            if (!(this.IsPostBack))
            {
                await DataBaseHandler.getAllShips();

                Console.WriteLine("page_load");
                setDataTables();
            }
        }
コード例 #8
0
        public AlgoTraderCreatorPage()
        {
            this.InitializeComponent();
            MySqlDataReader reader = DataBaseHandler.GetData("SELECT FullName FROM Stock");

            while (reader.Read())
            {
                StockNameBox.Items.Add((string)reader["FullName"]);
            }
        }
コード例 #9
0
ファイル: MainController.cs プロジェクト: GeekGirls/Cafeniwa
 // 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);
 }
コード例 #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());
    }
コード例 #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 { }
 }
コード例 #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 { }
 }
コード例 #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"));
        }
コード例 #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
 }
コード例 #15
0
 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();
 }
コード例 #16
0
ファイル: DataAccess.cs プロジェクト: gijojocoding/PhoenixBot
        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};");
            }
        }
コード例 #17
0
ファイル: DataAccess.cs プロジェクト: gijojocoding/PhoenixBot
 public void test()
 {
     using (IDbConnection connection = new SQLiteConnection(DataBaseHandler.CnnVal(nameS)))
     {
         connection.Open();
         Console.WriteLine(connection.State);
         connection.Close();
         Console.WriteLine(connection.State);
     }
 }
コード例 #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
     {
     }
 }
コード例 #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
     {
     }
 }
コード例 #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
     {
     }
 }
コード例 #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
     {
     }
 }
コード例 #22
0
 public void DeleteAllfromtb_RandomiserMention()
 {
     try
     {
         string strQuery = "Delete from tb_RandomiserMention";
         DataBaseHandler.DeleteQuery(strQuery, "tb_RandomiserMention");
     }
     catch
     {
     }
 }
コード例 #23
0
 public void Updatetb_Randomiser()
 {
     try
     {
         string strQuery = "update tb_Randomiser set TableStatus='1'";
         DataBaseHandler.UpdateQuery(strQuery, "tb_Randomiser");
     }
     catch
     {
     }
 }
コード例 #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
     {
     }
 }
コード例 #25
0
 public void DeleteCompletlyFromtb_MentionReplyCampaign()
 {
     try
     {
         string query = "delete from tb_MentionReplyCampaign";
         DataBaseHandler.UpdateQuery(query, "tb_MentionReplyCampaign");
     }
     catch
     {
     }
 }
コード例 #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
     {
     }
 }
コード例 #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
     {
     }
 }
コード例 #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
     {
     }
 }
コード例 #29
0
 public void DeleteFromtb_ReplyCampaign()
 {
     try
     {
         string query = "Update tb_ReplyCampaign set Status='1' where Status='0'";
         DataBaseHandler.UpdateQuery(query, "tb_ReplyCampaign");
     }
     catch
     {
     }
 }
コード例 #30
0
        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();
        }
コード例 #31
0
ファイル: Box.cs プロジェクト: EpicZerg/BreadBox
 public BoxHandler(DataBaseHandler dbh)
 {
     this.dbh = dbh;
 }
コード例 #32
0
 public DataBaseHandler()
 {
     DataBase = this;
 }