private void BindingData(Models.RQ_Customer _rqObj) { try { DAL_Customers _objDAL = new DAL_Customers(); var lstData = _objDAL.GetCustomers(_rqObj); DataGridViewButtonColumn bcol = new DataGridViewButtonColumn(); bcol.HeaderText = " "; bcol.Text = "Edit"; bcol.Name = "btnClickMe"; bcol.UseColumnTextForButtonValue = true; gdvwCustomers.Columns.Add(bcol); DataGridViewButtonColumn dcol = new DataGridViewButtonColumn(); dcol.HeaderText = " "; dcol.Text = "Delete"; dcol.Name = "btnClickMe"; dcol.UseColumnTextForButtonValue = true; gdvwCustomers.Columns.Add(dcol); rSCustomersBindingSource.DataSource = lstData; //gdvwCustomers.DataSource = lstData; //gdvwCustomers.DataBindings(); } catch (Exception ex) { throw ex; } }
private void BindCustomerData() { try { dAL_Customers = new DAL_Customers(); dgvwCustomers.DataSource = dAL_Customers.GetCustomers(new Models.M_Customers_RQ() { }); } catch (Exception) { throw; } }
private void SetCustmerDetails(int custID) { var result = _dalCustomers.GetCustomers(new Models.M_Customers_RQ() { CustID = custID }).FirstOrDefault(); if (result != null) //&& !string.IsNullOrWhiteSpace(result.CustID) { txtCustomerName.Text = result.CustName; txtAddress.Text = result.CustAddress; txtMobileNo.Text = result.CustMobile; txtEmailID.Text = result.EmailID; } }
private void dgvwCustomers_SelectionChanged(object sender, EventArgs e) { if (dgvwCustomers.Focused) { DataGridViewRow dr = dgvwCustomers.CurrentRow; if (dr != null && dr.Index != -1) { dAL_Customers = new DAL_Customers(); Int32 intCust = Convert.ToInt32(dr.Cells[0].Value); var lstcustomers = dAL_Customers.GetCustomers(new M_Customers_RQ() { CustID = intCust }); if (lstcustomers.Count > 0) { FillFormForEdit(lstcustomers[0]); } } } }