Exemple #1
0
        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            try{
                dgv_ClientInfo.Update();
                int           row = 0;
                List <Client> ss  = Client.GetUsers(textBox1.Text);
                dgv_ClientInfo.RowCount = 1;
                foreach (DataGridViewRow row1 in dgv_ClientInfo.Rows)
                {
                    if (!row1.IsNewRow)
                    {
                        dgv_ClientInfo.Rows.Remove(row1);
                    }
                }

                if (textBox1.Text != "")
                {
                    foreach (Client s in ss)
                    {
                        dgv_ClientInfo.Rows.Add();
                        dgv_ClientInfo[0, row].Value    = s.COCNo;
                        dgv_ClientInfo[1, row].Value    = s.Firstname;
                        dgv_ClientInfo[2, row].Value    = s.Middlename;
                        dgv_ClientInfo[3, row].Value    = s.Lastname;
                        dgv_ClientInfo[4, row].Value    = s.BirthDate;
                        dgv_ClientInfo[5, row].Value    = s.Gender;
                        dgv_ClientInfo[6, row].Value    = s.CivilStatus;
                        dgv_ClientInfo[7, row].Value    = s.BloodType;
                        dgv_ClientInfo[8, row].Value    = s.Street;
                        dgv_ClientInfo[9, row].Value    = s.Barangay;
                        dgv_ClientInfo[10, row].Value   = s.City;
                        dgv_ClientInfo[11, row].Value   = s.Zipcode;
                        dgv_ClientInfo[12, row].Value   = s.Company;
                        dgv_ClientInfo[13, row].Value   = s.Position;
                        dgv_ClientInfo[14, row].Value   = s.Phone;
                        dgv_ClientInfo[15, row].Value   = s.Mobile;
                        dgv_ClientInfo[16, row].Value   = s.Units;
                        dgv_ClientInfo[17, row].Value   = s.Amount;
                        dgv_ClientInfo[18, row].Value   = s.Status;
                        dgv_ClientInfo[19, row].Value   = s.Group;
                        dgv_ClientInfo[20, row].Value   = s.DateReceived;
                        dgv_ClientInfo[21, row++].Value = s.Id;
                    }
                }
                else
                {
                    loadTable();
                }
            }
            catch {  }
        }
Exemple #2
0
        public void loadTable()
        {
            dgv_ClientInfo.Update();
            int           row = 0;
            List <Client> ss  = Client.GetUsers();

            dgv_ClientInfo.RowCount = 1;
            foreach (DataGridViewRow row1 in dgv_ClientInfo.Rows)
            {
                if (!row1.IsNewRow)
                {
                    dgv_ClientInfo.Rows.Remove(row1);
                }
            }

            foreach (Client s in ss)
            {
                dgv_ClientInfo.Rows.Add();
                dgv_ClientInfo[0, row].Value    = s.COCNo;
                dgv_ClientInfo[1, row].Value    = s.Firstname;
                dgv_ClientInfo[2, row].Value    = s.Middlename;
                dgv_ClientInfo[3, row].Value    = s.Lastname;
                dgv_ClientInfo[4, row].Value    = s.BirthDate;
                dgv_ClientInfo[5, row].Value    = s.Gender;
                dgv_ClientInfo[6, row].Value    = s.CivilStatus;
                dgv_ClientInfo[7, row].Value    = s.BloodType;
                dgv_ClientInfo[8, row].Value    = s.Street;
                dgv_ClientInfo[9, row].Value    = s.Barangay;
                dgv_ClientInfo[10, row].Value   = s.City;
                dgv_ClientInfo[11, row].Value   = s.Zipcode;
                dgv_ClientInfo[12, row].Value   = s.Company;
                dgv_ClientInfo[13, row].Value   = s.Position;
                dgv_ClientInfo[14, row].Value   = s.Phone;
                dgv_ClientInfo[15, row].Value   = s.Mobile;
                dgv_ClientInfo[16, row].Value   = s.Units;
                dgv_ClientInfo[17, row].Value   = s.Amount;
                dgv_ClientInfo[18, row].Value   = s.Status;
                dgv_ClientInfo[19, row].Value   = s.Group;
                dgv_ClientInfo[20, row].Value   = s.DateReceived;
                dgv_ClientInfo[21, row++].Value = s.Id;
            }
        }