public frm_BillDetail(BillManagementDto dto) { InitializeComponent(); this.BillManagementDto = dto; this.bus = new BillDetailBus(); this.billDetailDtos = new List <BillDetailDto>(); this.initForm(); }
private void dgvListBills_DoubleClick(object sender, EventArgs e) { if (this.billManagementDtos.Count <= 0) { return; } if (this.dgvListBills.SelectedRows.Count == 0) { return; } string index = this.dgvListBills.SelectedRows[0].Cells[0].Value.ToString(); this.BillManagementDto = this.billManagementDtos[Convert.ToInt32(index) - 1]; this.Close(); }
private void dgvListBills_DoubleClick(object sender, EventArgs e) { if (this.billManagementDtos.Count <= 0) { return; } if (this.dgvListBills.SelectedRows.Count == 0) { return; } string index = this.dgvListBills.SelectedRows[0].Cells[0].Value.ToString(); BillManagementDto billDto = this.billManagementDtos[Convert.ToInt32(index) - 1]; frm_BillDetail form = new frm_BillDetail(billDto); form.Show(); }
public List <BillManagementDto> GetAllDelayBill() { List <BillManagementDto> dtos = new List <BillManagementDto>(); try { List <Bill> bills = this.billRepository.GetAll().ToList(); foreach (Bill b in bills) { if (!b.Status) { BillManagementDto dto = new BillManagementDto(); dto.Id = b.BillId.ToString(); dto.CreateDate = b.CreateDate.ToString("dd/MM/yyyy"); dto.Total = b.Total.ToString("#,#", CultureInfo.InvariantCulture); int customerId = b.CustomerId; if (customerId == 5) { dto.CustomerName = ""; } else { Customer customer = this.customerRepository.GetById(customerId); dto.CustomerName = customer.FirstName + " " + customer.LastName; dto.PhoneNumber = customer.PhoneNumber; } dtos.Add(dto); } } } catch { return(dtos); } return(dtos); }
private void delayBillFormClosing(object sender, FormClosingEventArgs e) { BillManagementDto dto = this.delayBillForm.BillManagementDto; if (dto == null) { return; } this.txtBillCode.Text = dto.Code(); this.txtProductCode.Text = ""; this.txtProductName.Text = ""; this.txtPrice.Text = ""; this.txtQuantity.Text = "1"; this.txtPhoneNumber.Text = dto.PhoneNumber; this.setCustomerInfo(); this.FlagDelay = true; this.productBillDtos = this.xuLyHoaDonService.GetAllBillDetailByBill(Convert.ToInt32(dto.Id)); this.reloadDataGridView(); }
private void btnCancel_Click(object sender, EventArgs e) { this.BillManagementDto = null; this.Close(); }