Пример #1
0
        private void BtnDel_Click(object sender, EventArgs e)
        {
            if (lbList.SelectedItem != null)
            {
                string selectedItemLB = lbList.SelectedItem.ToString();

                string id = UseDB.SelectDBLike("ProfRab", "id", "btn_title", selectedItemLB);

                string tmp = UseDB.SelectDBLike("ProfRab", "btn_name", "btn_title", selectedItemLB);
                tmp = tmp.Replace("btnPR", "");

                UseDB.UpdateDB("ProfRab", "btn_title", "id", "Проф " + tmp, id);
                UseDB.UpdateDB("ProfRab", "btn_value", "id", "\\_(ツ)_/ -ать", id);

                RefreshLBList();
                lbList.SelectedItem = "Проф " + id;

                tmrComm3333.Enabled = false;
                tmrComm3333.Enabled = true;
                lblSave.Visible     = true;
            }
            else
            {
                MessageBox.Show("Очисти сначала свою голову, а потом попробуй снова...", "Ну и дурак...", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Пример #2
0
        public void LoadListNameAndListTitle()
        {
            foreach (var item in UseDB.SelectDB("PingList", "Title"))
            {
                listTitle.Add(item);
            }

            foreach (var item in listTitle)
            {
                listName.Add(UseDB.SelectDBLike("PingList", "Name", "Title", item));
            }
        }
Пример #3
0
        private void LbList_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (lbList.SelectedIndex >= 0)
            {
                tbName.Enabled  = true;
                tbValue.Enabled = true;

                string selectedItemLB = lbList.SelectedItem.ToString();

                tbName.Text = UseDB.SelectDBLike("ProfRab", "btn_title", "btn_title", selectedItemLB);

                tbValue.Text = UseDB.SelectDBLike("ProfRab", "btn_value", "btn_title", selectedItemLB);
            }
        }