private void dgModify_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { if (callingStatus == 1) { SaleBillInfo saleBillInfo = getSalesBillDetail(e.RowIndex); callingForm.loadSalesDataToModify(saleBillInfo); } else { //callingForm.loadDataToModifyC(dgModify.Rows[e.RowIndex].Cells[7].Value.ToString()); } dbUtils.disConnect(); Close(); }
private SaleBillInfo getSalesBillDetail(int rowIndex) { SaleBillInfo saleBillInfo = new SaleBillInfo(); saleBillInfo.Id = int.Parse(dgModify.Rows[rowIndex].Cells[0].Value.ToString()); saleBillInfo.VDate = DateTime.Parse(dgModify.Rows[rowIndex].Cells[1].Value.ToString()); saleBillInfo.Vno = int.Parse(dgModify.Rows[rowIndex].Cells[2].Value.ToString()); saleBillInfo.Cid = int.Parse(dgModify.Rows[rowIndex].Cells[10].Value.ToString()); saleBillInfo.GrossAmt = double.Parse(dgModify.Rows[rowIndex].Cells[4].Value.ToString()); saleBillInfo.VatRate = double.Parse(dgModify.Rows[rowIndex].Cells[5].Value.ToString()); saleBillInfo.VatAmt = double.Parse(dgModify.Rows[rowIndex].Cells[6].Value.ToString()); saleBillInfo.RoundOff = double.Parse(dgModify.Rows[rowIndex].Cells[7].Value.ToString()); saleBillInfo.TotalAmt = double.Parse(dgModify.Rows[rowIndex].Cells[8].Value.ToString()); saleBillInfo.Pancard = dgModify.Rows[rowIndex].Cells[9].Value.ToString(); return(saleBillInfo); }
public void loadSalesDataToModify(SaleBillInfo saleBillInfo) { saleGridLineItem.Clear(); dgStockOut.Rows.Clear(); dtDate.Value = saleBillInfo.VDate; txtBillNo.Text = saleBillInfo.Vno.ToString(); cmbCustomer.SelectedValue = saleBillInfo.Cid; setCustomerAddress(cmbCustomer.SelectedValue.ToString()); lblVatRate.Text = saleBillInfo.VatRate.ToString(); if (saleBillInfo.Pancard.Length == 10) { txtPancard.Text = saleBillInfo.Pancard; } loadExistingSaleBillLineItem(saleBillInfo.Vno); txtSubTotal.Text = dbUtils.Decimal2digit(saleBillInfo.GrossAmt.ToString()); txtVatAmt.Text = dbUtils.Decimal2digit(saleBillInfo.VatAmt.ToString()); txtRoundOff.Text = dbUtils.Decimal2digit(saleBillInfo.RoundOff.ToString()); txtGrandTotal.Text = dbUtils.Decimal2digit(saleBillInfo.TotalAmt.ToString()); changeButtonName(btnSave, "&Update"); changeButtonName(btnModify, "&Cancel"); btnDelete.Visible = true; }