private void dgvDealerList_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex == -1 || e.ColumnIndex == -1) { return; } if (GetSelectedCellText(dgvPersonList, e) == "Details") { PersonForm dealerForm = new PersonForm(_personType, ((PersonBase)dgvPersonList.Rows[e.RowIndex].DataBoundItem).Id); ShowFormAsFixedDialog(this, dealerForm); } else if (GetSelectedCellText(dgvPersonList, e) == "Bills") { BillListForm billListForm = new BillListForm(_personType, ((PersonBase)dgvPersonList.Rows[e.RowIndex].DataBoundItem).Id); ShowFormResizableAsDialog(this, billListForm); } else if (GetSelectedCellText(dgvPersonList, e) == "Select") { if (CallerForm != null && CallerForm.Name != null && CallerForm.Name == "CustomerCartDetailForm") { CustomerCartDetailForm customerBillBreakListForm = (CustomerCartDetailForm)CallerForm; PersonBase person = (PersonBase)dgvPersonList.Rows[e.RowIndex].DataBoundItem; customerBillBreakListForm.OnCustomerNameSelected(person.Id, person.Name); Close(); } } }
private void btnAddDealer_Click(object sender, EventArgs e) { PersonForm dealerForm = new PersonForm(); dealerForm.PERSON_ID = 0; dealerForm.PERSON_TYPE = PERSON_TYPE; ShowFormAsFixedDialog(this, dealerForm); }
private void dgvDealerList_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex == -1 || e.ColumnIndex == -1) { return; } selectedePerson = ((Person)dgvDealerList.Rows[e.RowIndex].DataBoundItem); PersonForm dealerForm = new PersonForm(); dealerForm.PERSON_TYPE = PERSON_TYPE; dealerForm.PERSON_ID = selectedePerson.Id; if (GetSelectedCellText(dgvDealerList, e) == "Details") { ShowFormAsFixedDialog(this, dealerForm); } else { LoadBillList(); } EnableAddBillButton(); }
private void btnAddPerson_Click(object sender, EventArgs e) { PersonForm personForm = new PersonForm(_personType, 0); ShowFormAsFixedDialog(this, personForm); }