private void formClosing(object sender, FormClosingEventArgs e) { ProductBillDto tempProductBillDto = this.editBillDetailForm.ProductBillDto; if (this.editBillDetailForm.FlagDelete) { this.productBillDtos.Remove(tempProductBillDto); } else { this.productBillDtos[Convert.ToInt32(tempProductBillDto.Index) - 1] = tempProductBillDto; } this.reloadDataGridView(); this.editBillDetailForm = null; }
private void doubleClickRow(object sender, EventArgs e) { if (this.productBillDtos.Count <= 0) { return; } if (this.dgvListProduct.SelectedRows.Count == 0) { return; } string index = this.dgvListProduct.SelectedRows[0].Cells[0].Value.ToString(); ProductBillDto tempProductBillDto = this.productBillDtos[Convert.ToInt32(index) - 1]; this.editBillDetailForm = new EditBillDetailForm(tempProductBillDto); this.editBillDetailForm.FormClosing += new FormClosingEventHandler(formClosing); this.editBillDetailForm.Show(); }
// Cập nhật lại Form private void resetForm() { this.txtDate.Text = DateTime.UtcNow.ToString("dd/MM/yyyy"); this.txtPhoneNumber.Text = ""; this.txtCustomerName.Text = ""; this.txtProductCode.Text = ""; this.txtQuantity.Text = "1"; this.txtProductName.Text = ""; this.txtSell.Text = ""; this.txtPrice.Text = ""; this.lbTotal.Text = "0"; this.flagEnterPhoneNumberField = false; this.flagEnterProductCodeField = false; this.FlagDelay = false; this.productBillDto = null; this.customerBillDto = null; this.editBillDetailForm = null; this.delayBillForm = null; this.productBillDtos = new List <ProductBillDto>(); this.saleBillDtos = new List <SaleBillDto>(); this.setSellProgramForCombobox(); this.dgvListProduct.Rows.Clear(); try { this.txtBillCode.Text = this.xuLyHoaDonService.GenerateBillCode(); } catch { MessageBox.Show(MessageContent.SYSTEM_ERROR, MessageTitle.SYSTEM_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error); } }