Пример #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            FormHome.valform = 0;
            fcatclient       = new ClientsCatalogue();
            fcatclient.ShowDialog();

            idcl = ClientsCatalogue.idclient;
            if (idcl != 0)
            {
                mycon.Open();
                OleDbCommand cmd = new OleDbCommand();
                cmd.CommandType = CommandType.Text;
                cmd.CommandText = @"SELECT * FROM Clienti WHERE (id = " + idcl + ")";
                cmd.Connection  = mycon;
                OleDbDataReader rd = cmd.ExecuteReader();
                rd.Read();
                label11.Text = Convert.ToString(rd[2]);
                label12.Text = Convert.ToString(rd[3]);
                //Grupul
                OleDbCommand cmdgr = new OleDbCommand();
                cmdgr.CommandType = CommandType.Text;
                cmdgr.CommandText = @"SELECT * FROM GrupuriClienti WHERE (id = " + Convert.ToInt32(rd[13]) + ")";
                cmdgr.Connection  = mycon;
                OleDbDataReader rdgr = cmdgr.ExecuteReader();
                rdgr.Read();
                string gr = Convert.ToString(rdgr[1]);
                label13.Text = gr;
                rdgr.Close();
                rd.Close();
                mycon.Close();
            }
        }
Пример #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            FormHome.valform = 0;
            fcatclient       = new ClientsCatalogue();
            fcatclient.ShowDialog();
            if (ClientsCatalogue.idclient != 0)
            {
                mycon.Open();
                dataGridView1.Rows.Clear();
                OleDbCommand cmdidcl    = new OleDbCommand();
                OleDbCommand cmdidcarte = new OleDbCommand();
                cmdidcl.CommandType    = CommandType.Text;
                cmdidcarte.CommandType = CommandType.Text;
                cmdidcl.CommandText    = @"SELECT COUNT(*) FROM Imprumuturi WHERE (idClienti = " + ClientsCatalogue.idclient + ")";
                cmdidcl.Connection     = mycon;
                cmdidcarte.Connection  = mycon;
                int imprumut = Convert.ToInt32(cmdidcl.ExecuteScalar());
                if (imprumut != 0)
                {
                    dataGridView1.Rows.Clear();
                    int idcarte;
                    cmdidcl.CommandText = @"SELECT * FROM Imprumuturi WHERE (idClienti = " + ClientsCatalogue.idclient + ")";
                    OleDbDataReader rdcl = cmdidcl.ExecuteReader();
                    while (rdcl.Read())
                    {
                        idcarte = Convert.ToInt32(Convert.ToString(rdcl[1]));
                        cmdidcarte.CommandText = @"SELECT * FROM Carti WHERE (id = " + idcarte + ")";
                        OleDbDataReader rdcarte = cmdidcarte.ExecuteReader();
                        rdcarte.Read();
                        DataGridViewRow dgvr = new DataGridViewRow();
                        dgvr.CreateCells(dataGridView1);
                        dgvr.Cells[0].Value = Convert.ToString(rdcarte[1]);
                        dgvr.Cells[1].Value = Convert.ToString(rdcarte[3]);
                        dgvr.Cells[2].Value = Convert.ToString(rdcarte[4]);
                        rdcarte.Close();
                        dataGridView1.Rows.Add(dgvr);
                    }

                    rdcl.Close();
                }
                cmdidcl.CommandText = @"SELECT * FROM Clienti WHERE (id = " + ClientsCatalogue.idclient + ")";
                OleDbDataReader rdidcl = cmdidcl.ExecuteReader();
                rdidcl.Read();
                label5.Text = Convert.ToString(rdidcl[2]);
                label6.Text = Convert.ToString(rdidcl[3]);
                rdidcl.Close();
                mycon.Close();
            }
            else
            {
                label5.Text = "";
                label6.Text = "";
            }
        }
Пример #3
0
 private void catalogCliențiToolStripMenuItem_Click(object sender, EventArgs e)
 {
     valform    = 1;
     fclcatalog = new ClientsCatalogue();
     fclcatalog.Show();
 }
Пример #4
0
 private void toolStripButton4_Click(object sender, EventArgs e)
 {
     valform    = 1;
     fclcatalog = new ClientsCatalogue();
     fclcatalog.Show();
 }
Пример #5
0
 private void button3_Click(object sender, EventArgs e)
 {
     fcatclient = new ClientsCatalogue();
     fcatclient.Show();
 }