Exemple #1
0
 private void txtFilter_TextChanged(object sender, EventArgs e)
 {
     using (Business.Customers customers = new Business.Customers())
     {
         dgvcustomers.DataSource = customers.Get(w => w.FullName.Contains(txtFilter.Text.Trim()) || w.Address.Contains(txtFilter.Text.Trim()) || w.Email.Contains(txtFilter.Text.Trim()));
     }
 }
Exemple #2
0
 private void DataBinding()
 {
     using (Business.Customers customers = new  Business.Customers())
     {
         dgvcustomers.DataSource = customers.Get();// customers.Get();
     }
 }
 private void frm_AddCustomer_Load(object sender, EventArgs e)
 {
     if (this.CustomerID != 0)
     {
         this.Text          = "ویرایش";
         btninsertdata.Text = "ویرایش";
         using (Business.Customers UOW = new  Business.Customers())
         {
             var sel = UOW.Get(w => w.ID == CustomerID).FirstOrDefault();
             txtAddress.Text  = sel.Address;
             txtEmail.Text    = sel.Email;
             txtMobile.Text   = sel.Mobile;
             txtName.Text     = sel.FullName;
             pc.ImageLocation = Application.StartupPath + "/Image/" + sel.Image;
         }
     }
 }