Ejemplo n.º 1
0
        private void searchClient(object sender, EventArgs e)
        {
            string text = clientSearchBox.Text;

            ClientRepositoryDB cltdb = new ClientRepositoryDB();
            List <ClientRep>   cltrp = cltdb.SearchClient(text);

            this.dataGridView1.DataSource = cltrp;
        }
Ejemplo n.º 2
0
        private void loadClick(object sender, EventArgs e)
        {
            //SalesRepositoryDB cltdb = new SalesRepositoryDB();
            // List<SalesRep> clientList = cltdb.GetAllSales();
            //this.dataGridView1.DataSource = clientList;

            ClientRepositoryDB cltdb = new ClientRepositoryDB();
            List <ClientRep>   cltrp = cltdb.GetAllClient();

            this.dataGridView1.DataSource = cltrp;
        }
Ejemplo n.º 3
0
        private void viewClient(object sender, EventArgs e)
        {
            groupBox3.Hide();

            ClientRepositoryDB cltdb = new ClientRepositoryDB();
            List <ClientRep>   cltrp = cltdb.GetAllClient();

            this.dataGridView1.DataSource = cltrp;

            viewClientPanel.Dock = DockStyle.Fill;
            viewClientPanel.Show();

            panelTrans.Hide();
            clientPanel.Hide();
            vehiclePanel.Hide();
            salesPanel.Hide();
        }
Ejemplo n.º 4
0
        private void clientInsertClick(object sender, EventArgs e)
        {
            if (nameBoxC.Text.Length != 0 && mailBoxC.Text.Contains("@") == true && contactBoxC.Text.Length != 0)
            {
                rand           = r.Next(00000, 99999);
                idBoxC.Text    = "clt" + rand;
                empIdBoxC.Text = i;
                passBoxC.Text  = (r.Next(123456, 999999)).ToString();

                ClientRep cr = new ClientRep();

                cr.Id      = this.idBoxC.Text;
                cr.Name    = this.nameBoxC.Text;
                cr.Gender  = this.sexBoxC.Text;
                cr.Address = this.addBoxC.Text;
                cr.Email   = this.mailBoxC.Text;
                cr.AddedBy = this.empIdBoxC.Text;
                //Console.WriteLine(cr.Status + " " + cr.Id);
                cr.Contacts   = this.contactBoxC.Text;
                cr.Password   = this.passBoxC.Text;
                cr.Occupation = this.occBox.Text;

                ClientRepositoryDB crdb = new ClientRepositoryDB();

                if (crdb.Insert(cr))
                {
                    MessageBox.Show("Insert Completed!", "Succeed");
                    //button32.Visible = true;
                }

                else
                {
                    MessageBox.Show("Insert Not Complete", "Error");
                }
            }

            else
            {
                MessageBox.Show("Invalid!", "Error");
            }
        }