Beispiel #1
0
 public void clerar()
 {
     old1.Clear(); old2.Clear(); old3.Clear(); old4.Clear();
     New1.Clear(); New2.Clear(); New3.Clear(); New4.Clear();
     Con1.Clear(); Con2.Clear(); Con3.Clear(); Con4.Clear();
     button3.Hide();
 }
Beispiel #2
0
 private void Con2_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Back)
     {
         Con1.Clear();
         Con1.Focus();
         // e.Handled = true;
         p = 1;
     }
 }
Beispiel #3
0
 private void textBox4_TextChanged(object sender, EventArgs e)
 {
     if (p == 0)
     {
         Con1.Focus();
         p = 0;
     }
     if (p == 1)
     {
         p = 0;
     }
 }
        private void Form1_Load(object sender, EventArgs e)
        {
            SqlCommand com1 = new SqlCommand();

            com1.CommandText = "Select * From Books";
            com1.Connection  = Con1;
            Con1.Open();

            DataSet Books = new DataSet();

            SqlDataAdapter BooksAdapt = new SqlDataAdapter(com1);

            BooksAdapt.Fill(Books, "Books");
            BookL = new List <Book>();
            BookL = Books.Tables[0].AsEnumerable().Select(
                dataRow => new Book
            {
                Id     = dataRow.Field <int>("iD"),
                Author = dataRow.Field <string>("Author"),
                Title  = dataRow.Field <string>("Title"),
                Name   = dataRow.Field <string>("Name")
            }).ToList();
            Con1.Close();

            BooksGrid.DataSource              = BookL;
            BooksGrid.Columns[0].Visible      = false;
            BooksGrid.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            BooksGrid.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            BooksGrid.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;

            int PosX1 = 0;
            int PosY1 = 500;
            int PosX2 = 0;
            int PosY2 = 550;

            char[] Charachters = new char[] { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' };
            for (int i = 0; i < Charachters.Length / 13; i++)
            {
                for (int z = 0; z < Charachters.Length / 2; z++)
                {
                    if (i == 0)
                    {
                        CreateDynamicButton(Charachters[z], PosX1 + 50, PosY1);
                        PosX1 += 100;
                    }
                    else
                    {
                        CreateDynamicButton(Charachters[z + (Charachters.Length / 2)], PosX2 + 50, PosY2);
                        PosX2 += 100;
                    }
                }
            }
        }
Beispiel #5
0
 private void New4_TextChanged(object sender, EventArgs e)
 {
     if (old1.Text == "" && old2.Text == "" & old3.Text == "" && old4.Text == "")
     {
         label16.Visible = true;
         label16.Text    = "Fill all text  !";
         New1.Clear();
         New2.Clear();
         New3.Clear();
         New4.Clear();
         New1.Focus();
     }
     else
     {
         label16.Visible = false;
         Con1.Focus();
     }
 }
        private void Get(String Charachter)
        {
            SqlCommand com1 = new SqlCommand();

            com1.CommandText = "Select * From Books Where Author Like '" + Charachter + "%'";
            com1.Connection  = Con1;
            Con1.Open();

            DataSet Books = new DataSet();

            SqlDataAdapter BooksAdapt = new SqlDataAdapter(com1);

            BooksAdapt.Fill(Books, "Books");
            BookL = new List <Book>();
            BookL = Books.Tables[0].AsEnumerable().Select(
                dataRow => new Book
            {
                Id     = dataRow.Field <int>("iD"),
                Author = dataRow.Field <string>("Author"),
                Title  = dataRow.Field <string>("Title"),
                Name   = dataRow.Field <string>("Name")
            }).ToList();
            Con1.Close();
        }