private void grid_DoubleClick(object sender, EventArgs e) { try { DataGridView datagrid = this.dataGridView1; Int64 index; if (datagrid.RowCount > 0) { Club = new BIZ.Club(); index = datagrid.CurrentRow.Index; ClubID = Convert.ToInt64(datagrid.Rows[Convert.ToInt32(index)].Cells[0].Value); if (ClubID >= 0) { DataTable dtresult = new DataTable(); PopulateBussinessLayer(); dtresult = Club.ClubSearchByKey(); if (dtresult.Rows.Count > 0) { RecordSearched = dtresult; PopulateControl(); } else { MessageBox.Show("No record is found", "Search"); } } } } catch (Exception ex) { MessageBox.Show(Common.Common.CustomError(ex.Message), "Error"); } }
private void PopulateComboBox() { try { //TransactionType cmbTransactionType.Items.Add("Billing"); cmbTransactionType.Items.Add("Payment"); //Order Status cmbOrderStatus.Items.Add("Pending"); cmbOrderStatus.Items.Add("Delivered"); //Get Club List BIZ.Club club = new BIZ.Club(); DataTable dtResult = new DataTable(); dtResult = club.ClubSelectAll(); foreach (DataRow dr in dtResult.Rows) { cmbClub.Items.Add(dr["Club Name"].ToString()); } } catch (Exception ex) { throw ex; } }
private void ClubSelectAll() { try { Club = new BIZ.Club(); PopulateBussinessLayer(); Club.ClubSelectAll(this.dataGridView1); } catch (Exception ex) { throw ex; } }
private void PopulateCombobox() { try { DataTable dtResult; club = new BIZ.Club(); dtResult = club.ClubSelectAll(); foreach (DataRow dr in dtResult.Rows) { cmbClub.Items.Add(dr["Club Name"].ToString()); } } catch (Exception ex) { MessageBox.Show(Common.Common.CustomError(ex.Message), "Error"); } }
private void Save() { try { Club = new BIZ.Club(); GetControlValue(); PopulateBussinessLayer(); if (Club.Save()) { ClearControl(); this.txtClubName.Focus(); ClubSelectAll(); } } catch (Exception ex) { MessageBox.Show(Common.Common.CustomError(ex.Message), "Error"); } }
private void ClubDelete() { try { Club = new BIZ.Club(); GetControlValue(); if (ClubID > 0) { if ((MessageBox.Show("Are you sure! You would like to delete this record?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)) { PopulateBussinessLayer(); Club.ClubDelete(); ClearControl(); ClubSelectAll(); } } } catch (Exception ex) { MessageBox.Show(Common.Common.CustomError(ex.Message), "Error"); } }