Exemple #1
0
        private void cmdSearch_Click(object sender, EventArgs e)
        {
            dgvExpense.Rows.Clear();
            TravelAgencyEntities t = new TravelAgencyEntities();
            var query = from V in t.Vendors
                        where V.Name.Contains(txtName.Text) &&
                        (V.Phone == null || V.Phone.Contains(txtPhone.Text)) &&
                        (V.Email == null || V.Email.Contains(txtEmail.Text))
                        select V;

            foreach (var vendor in query)
            {
                DataGridViewRow         row = new DataGridViewRow();
                DataGridViewTextBoxCell ID  = new DataGridViewTextBoxCell();
                ID.Value = vendor.VendorID.ToString();
                row.Cells.Add(ID);
                DataGridViewTextBoxCell Name = new DataGridViewTextBoxCell();
                Name.Value = vendor.Name;
                row.Cells.Add(Name);
                DataGridViewTextBoxCell CellPhone = new DataGridViewTextBoxCell();
                CellPhone.Value = vendor.Phone;
                row.Cells.Add(CellPhone);
                DataGridViewTextBoxCell Email = new DataGridViewTextBoxCell();
                Email.Value = vendor.Email;
                row.Cells.Add(Email);
                row.Tag = vendor;
                dgvExpense.Rows.Add(row);
            }
        }
Exemple #2
0
        private void cmdSave_Click(object sender, EventArgs e)
        {
            TravelAgencyEntities t = new TravelAgencyEntities();
            //Client c = new Client();

            //  t.AddToClients(Client.CreateClient(1, "sami", "*****@*****.**", "Sami", "Ahmed"));
            //t.SaveChanges();
        }
Exemple #3
0
        public void LoadGroups()
        {
            dgvGroups.Rows.Clear();
            TravelAgencyEntities t = new TravelAgencyEntities();
            var query = from clientGrp in t.ClientGroups
                        select clientGrp;

            foreach (var clientGrp in query)
            {
                DataGridViewRow         row  = new DataGridViewRow();
                DataGridViewTextBoxCell Name = new DataGridViewTextBoxCell();
                Name.Value = clientGrp.Name;
                row.Cells.Add(Name);
                DataGridViewTextBoxCell Desc = new DataGridViewTextBoxCell();
                Desc.Value = clientGrp.Description;
                row.Cells.Add(Desc);
                row.Tag = clientGrp;
                dgvGroups.Rows.Add(row);
            }
        }
Exemple #4
0
 private void cmdSave_Click(object sender, EventArgs e)
 {
     TravelAgencyEntities t = new TravelAgencyEntities();
 }