Esempio n. 1
0
        private void TargetListView_ItemMouseClick(object sender, Telerik.WinControls.UI.ListViewItemEventArgs e)
        {
            ListViewDataItem item = TargetListView.SelectedItem;
            //將資料拉出來到ui上
            // === 對 Access 資料庫下SQL語法 ===
            //// Transact-SQL 陳述式
            String strSQL = "SELECT id,TargetName,TargetIP,TargetAlert,TargetRes,TargetSpaceLog,TargetWarning FROM [LinuxTarget] WHERE id =" + int.Parse(item[0].ToString());

            System.Data.OleDb.OleDbConnection oleConn =
                new System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data Source=FreeSpaceEyesDB.mdb");
            //// 開啟資料庫連接。
            oleConn.Open();
            //// OleDbCommand (String, OleDbConnection) : 使用查詢的文字和 OleDbConnection,初始化 OleDbCommand 類別的新執行個體。
            System.Data.OleDb.OleDbCommand oleCmd =
                new System.Data.OleDb.OleDbCommand(strSQL, oleConn);
            OleDbDataReader thisReader = oleCmd.ExecuteReader();//建立OleDbDataReader用來存放從Access裡面讀取出來的

            //拉到ui
            while (thisReader.Read())
            {
                ShowTargetID.Text      = thisReader["id"].ToString();
                ShowTargetName.Text    = thisReader["TargetName"].ToString();
                ShowTargetIP.Text      = thisReader["TargetIP"].ToString();
                ShowTargetAlert.Text   = thisReader["TargetAlert"].ToString();
                ShowTargetRes.Text     = thisReader["TargetRes"].ToString();
                ShowTargetWarning.Text = thisReader["TargetWarning"].ToString();
            }
            //// 關閉資料庫連接。
            thisReader.Close();
            oleConn.Close();
            //啟動更新即刪除
            updata_btn.Enabled  = true;
            deldata_btn.Enabled = true;
        }
 private void radListViewClientList_ItemMouseClick(object sender, Telerik.WinControls.UI.ListViewItemEventArgs e)
 {
     if (radListViewClientList.CurrentItem.CheckState == Telerik.WinControls.Enumerations.ToggleState.On)
     {
         radListViewClientList.CurrentItem.CheckState = Telerik.WinControls.Enumerations.ToggleState.Off;
     }
     else
     {
         radListViewClientList.CurrentItem.CheckState = Telerik.WinControls.Enumerations.ToggleState.On;
     }
 }
Esempio n. 3
0
 private void radListView1_ItemMouseDoubleClick(object sender, Telerik.WinControls.UI.ListViewItemEventArgs e)
 {
     SelectSubSchemeType();
 }
Esempio n. 4
0
 void radListView1_ItemDataBound(object sender, Telerik.WinControls.UI.ListViewItemEventArgs e)
 {
     e.Item.Image = Image.FromFile(Application.StartupPath + @"\Resources\CarRentalImages\" + e.Item["ImageFileName"]);
 }