Beispiel #1
0
 private void btnAddProg_Click(object sender, EventArgs e)
 {
     if (tbAddProg.Text == "")
     {
         MessageBox.Show("Такого ПО не существует!", "Вбей ПО'шечку", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         UseDB.InsertDB("ProgList", "Name", tbAddProg.Text);
         lbProgList.Items.Add(tbAddProg.Text);
         tbAddProg.Text = null;
     }
 }
Beispiel #2
0
 private void btnPrintAdd_Click(object sender, EventArgs e)
 {
     if (tbPrintName.Text == "")
     {
         MessageBox.Show("Что забыл?", "Атата...", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         UseDB.InsertDB("Printers", "Name", "NetName", "Location", "InvNumber", tbPrintName.Text, tbPrintNetName.Text, tbPrintLocation.Text, tbPrintInvNumber.Text);
         MethodsPrinters mp = new MethodsPrinters();
         mp.RefreshPrinters(dgvPrinters);
         mp.ClearPrintTB(tbPrintName, tbPrintNetName, tbPrintLocation, tbPrintInvNumber);
     }
 }
Beispiel #3
0
        private void btnAddRequest_Click(object sender, EventArgs e)
        {
            if (tbAddRequest.Text == "")
            {
                MessageBox.Show("Что будем добавлять?", "Не заполнил!", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                UseDB.InsertDB("RequestList", "Prefix", "Value", "User", "DateCreate", tbPrefixRequest.Text, tbAddRequest.Text, Environment.UserName, DateTime.Now.ToString());

                MethodsRequests mr = new MethodsRequests();
                mr.RefreshRequestsList(dgvRequest, lblQuantity, chkbPrefixShow);
                tbAddRequest.Clear();
            }
        }
Beispiel #4
0
        private async void btnAddRequestDB_Click(object sender, EventArgs e)
        {
            if (lbProgList.SelectedItem != null && tbAddFIORequest.Text != "")
            {
                string str = null;

                if (rdbtnAddRequest1.Checked)
                {
                    str = "Установить ";
                }
                if (rdbtnAddRequest2.Checked)
                {
                    str = "Переустановить ";
                }
                if (rdbtnAddRequest3.Checked)
                {
                    str = "Обновить ";
                }
                if (rdbtnAddRequest4.Checked)
                {
                    str = "Настроить ";
                }
                if (rdbtnAddRequest5.Checked)
                {
                    str = "Удалить ";
                }

                str += lbProgList.SelectedItem + ". " + tbAddFIORequest.Text;

                UseDB.InsertDB("RequestList", "Prefix", "Value", "User", "DateCreate", Properties.Settings.Default.prefixRequest, str, Environment.UserName, DateTime.Now.ToString());

                lblAddRequestDB.Text = "Улетело в БД:\n" + str;

                await Task.Delay(Properties.Settings.Default.timeClean);

                lblAddRequestDB.Text = string.Empty;
            }
            else
            {
                MessageBox.Show("Что ты упустил?", "IQ тест", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }