public void getProductRate(int index, decimal decProductId, decimal decBatchId) { ProductCreationBll BllProductCreation = new ProductCreationBll(); decimal decPricingLevelId = 0; try { DateTime dtcurrentDate = PublicVariables._dtCurrentDate; decimal decNodecplaces = PublicVariables._inNoOfDecimalPlaces; decPricingLevelId = Convert.ToDecimal(cmbPricingLevel.SelectedValue.ToString()); decimal decRate = BllProductCreation.SalesInvoiceProductRateForSales(decProductId, dtcurrentDate, decBatchId, decPricingLevelId, decNodecplaces); dgvProduct.Rows[index].Cells["dgvtxtRate"].Value = decRate; } catch (Exception ex) { MessageBox.Show("DN48: " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void dgvProduct_CellLeave(object sender, DataGridViewCellEventArgs e) { try { if (dgvProduct.Columns[e.ColumnIndex].Name == "dgvtxtQty") { if (dgvProduct.Rows[e.RowIndex].Cells["dgvtxtQuotationDetailsId"].Value != null && dgvProduct.Rows[e.RowIndex].Cells["dgvtxtQuotationDetailsId"].Value.ToString() != string.Empty && Convert.ToDecimal(dgvProduct.Rows[e.RowIndex].Cells["dgvtxtQuotationDetailsId"].Value.ToString()) != 0) { if (dgvProduct.Rows[e.RowIndex].Cells["dgvtxtQty"].Value != null && dgvProduct.Rows[e.RowIndex].Cells["dgvtxtQty"].Value.ToString() != string.Empty) { SalesQuotationBll spSalesQuation = new SalesQuotationBll(); decimal decReferencedQty = Math.Round(spSalesQuation.SalesQuatationReferenceCheck(Convert.ToDecimal(dgvProduct.Rows[e.RowIndex].Cells["dgvtxtQuotationDetailsId"].Value.ToString())), PublicVariables._inNoOfDecimalPlaces); decimal decQty = Convert.ToDecimal(dgvProduct.Rows[e.RowIndex].Cells["dgvtxtQty"].Value.ToString()); if (decQty < decReferencedQty) { Messages.InformationMessage("Quantity in row " + (e.RowIndex + 1) + " should be greater than " + decReferencedQty); IsCellValue = false; dgvProduct.Rows[e.RowIndex].Cells["dgvtxtQty"].Value = Math.Round(decReferencedQty,PublicVariables._inNoOfDecimalPlaces); IsCellValue = true; } } } AmountCalculation("dgvtxtQty", e.RowIndex); TotalAmountCalculation(); } else if (dgvProduct.Columns[e.ColumnIndex].Name == "dgvcmbUnit") { if (dgvProduct.Rows[e.RowIndex].Cells["dgvcmbUnit"].Value != null && dgvProduct.Rows[e.RowIndex].Cells["dgvcmbUnit"].Value.ToString() != string.Empty) { UnitConvertionBll bllUnitConvertion = new UnitConvertionBll(); List< DataTable >listUnitByProduct = bllUnitConvertion.UnitConversionIdAndConRateViewallByProductId(dgvProduct.Rows[e.RowIndex].Cells["ProductId"].Value.ToString()); if (listUnitByProduct[0].Rows.Count > 0) { foreach (DataRow drUnitByProduct in listUnitByProduct[0].Rows) { if (dgvProduct.Rows[e.RowIndex].Cells["dgvcmbUnit"].Value.ToString() == drUnitByProduct.ItemArray[0].ToString()) { dgvProduct.Rows[e.RowIndex].Cells["dgvtxtUnitConversionId"].Value = Convert.ToDecimal(drUnitByProduct.ItemArray[2].ToString()); dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value = Convert.ToDecimal(drUnitByProduct.ItemArray[3].ToString()); if (IsDoAfterFill) { decimal decNewConversionRate = Convert.ToDecimal(dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value.ToString()); decimal decNewRate = (decCurrentRate * decCurrentConversionRate) / decNewConversionRate; dgvProduct.Rows[e.RowIndex].Cells["dgvtxtRate"].Value = Math.Round(decNewRate, Convert.ToInt32(PublicVariables._inNoOfDecimalPlaces)); } } } AmountCalculation("dgvtxtQty", e.RowIndex); TotalAmountCalculation(); } } } else if (dgvProduct.Columns[e.ColumnIndex].Name == "dgvcmbBatch") { if (dgvProduct.Rows[e.RowIndex].Cells["dgvcmbBatch"].Value != null && dgvProduct.Rows[e.RowIndex].Cells["dgvcmbBatch"].Value.ToString() != string.Empty) { string strProductCode = string.Empty; ProductInfo infoproduct = new ProductInfo(); ProductCreationBll BllProductCreation = new ProductCreationBll(); decimal decBatchId = Convert.ToDecimal(dgvProduct.Rows[e.RowIndex].Cells["dgvcmbBatch"].Value); dgvProduct.Rows[e.RowIndex].Cells["dgvtxtBarcode"].Value = BllProductCreation.BarcodeViewByBatchId(decBatchId); strProductCode = dgvProduct.Rows[e.RowIndex].Cells["dgvtxtProductCode"].Value.ToString(); infoproduct = BllProductCreation.ProductViewByCode(strProductCode); DateTime dtcurrentDate = PublicVariables._dtCurrentDate; decimal decNodecplaces = PublicVariables._inNoOfDecimalPlaces; decimal decStandardRate = BllProductCreation.SalesInvoiceProductRateForSales(infoproduct.ProductId, dtcurrentDate, decBatchId, Convert.ToDecimal(cmbPricinglevel.SelectedValue), decNodecplaces); if (dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value != null && dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value.ToString() != string.Empty) { if (decStandardRate != 0 && Convert.ToDecimal(dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value) != 0) { dgvProduct.Rows[e.RowIndex].Cells["dgvtxtRate"].Value = Math.Round(decStandardRate / Convert.ToDecimal(dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value), PublicVariables._inNoOfDecimalPlaces); } AmountCalculation("dgvtxtQty", e.RowIndex); TotalAmountCalculation(); } } } else if (dgvProduct.Columns[e.ColumnIndex].Name == "dgvtxtExchangeRate" && isAmountcalc) { AmountCalculation("dgvtxtExchangeRate", e.RowIndex); TotalAmountCalculation(); } //---------------while changing Rate,corresponding change in amount---- else if (dgvProduct.Columns[e.ColumnIndex].Name == "dgvtxtRate" && isAmountcalc) { AmountCalculation("dgvtxtRate", e.RowIndex); TotalAmountCalculation(); } //----while changing amount ,corresponding chnage in total amount------- CheckInvalidEntriesInDataGridProduct(e); } catch (Exception ex) { MessageBox.Show("SQ:76" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to fill the details for edit or delete /// </summary> public void FillRegisterOrReport() { SalesQuotationBll bllSalesQuotation = new SalesQuotationBll(); TransactionsGeneralFillBll transactionGeneralFillObj = new TransactionsGeneralFillBll(); SalesQuotationMasterInfo infoSalesQuotationMaster = new SalesQuotationMasterInfo(); ProductCreationBll BllProductCreation = new ProductCreationBll(); try { VoucherTypeBll BllVoucherType = new VoucherTypeBll(); IsDoAfterFill = false; IsCellValue = false; btnSave.Text = "Update"; btnDelete.Enabled = true; infoSalesQuotationMaster =bllSalesQuotation.SalesQuotationMasterView(decSalesquotationMasterId); txtQuotationNo.Text = infoSalesQuotationMaster.InvoiceNo; strVoucherNo = infoSalesQuotationMaster.VoucherNo.ToString(); decSalesQuotationPreffixSuffixId = Convert.ToDecimal(infoSalesQuotationMaster.SuffixPrefixId); decSalesQuotationVoucherId = Convert.ToDecimal(infoSalesQuotationMaster.VoucherTypeId); isAutomatic = BllVoucherType.CheckMethodOfVoucherNumbering(decSalesQuotationVoucherId); decsalesQuotationTypeId = decSalesQuotationVoucherId; txtSalesQuotationDate.Text = infoSalesQuotationMaster.Date.ToString("dd-MMM-yyyy"); cmbCashOrParty.SelectedValue = infoSalesQuotationMaster.LedgerId; ComboSalesManFill(); cmbSalesman.SelectedValue = infoSalesQuotationMaster.EmployeeId; txtNarration.Text = infoSalesQuotationMaster.Narration; cmbCurrency.SelectedValue = infoSalesQuotationMaster.ExchangeRateId; decimal decsalesregisterTotal = Convert.ToDecimal(infoSalesQuotationMaster.TotalAmount.ToString()); decsalesregisterTotal = Math.Round(decsalesregisterTotal, PublicVariables._inNoOfDecimalPlaces); txtTotal.Text = Convert.ToString(decsalesregisterTotal); cmbPricinglevel.SelectedValue = infoSalesQuotationMaster.PricinglevelId; List<DataTable> ListObj = new List<DataTable>(); ListObj = bllSalesQuotation.SalesQuotationDetailsViewByMasterId(decSalesquotationMasterId); if (isAutomatic) { txtQuotationNo.ReadOnly = true; txtSalesQuotationDate.Focus(); } else { txtQuotationNo.ReadOnly = false; txtQuotationNo.Focus(); } string strApproved = Convert.ToString(infoSalesQuotationMaster.Approved); if (strApproved == "False") { cbxApproved.Checked = false; } else { cbxApproved.Checked = true; } decimal decCount = bllSalesQuotation.CheckingStastusForSalesQuotation(decSalesquotationMasterId); if (decCount > 0) { cbxApproved.Enabled = false; } else { cbxApproved.Enabled = true; } for (int i = 0; i < ListObj[0].Rows.Count; i++) { isAmountcalc = false; dgvProduct.Rows.Add(); dgvProduct.Rows[i].HeaderCell.Value = string.Empty; dgvProduct.Rows[i].Cells["dgvtxtQuotationDetailsId"].Value = Convert.ToDecimal(ListObj[0].Rows[i]["quotationDetailsId"].ToString()); dgvProduct.Rows[i].Cells["ProductId"].Value = ListObj[0].Rows[i]["productId"].ToString(); dgvProduct.Rows[i].Cells["dgvtxtBarcode"].Value = ListObj[0].Rows[i]["Barcode"].ToString(); dgvProduct.Rows[i].Cells["dgvtxtProductCode"].Value = ListObj[0].Rows[i]["productCode"].ToString(); transactionGeneralFillObj.UnitViewAllByProductId(dgvProduct, ListObj[0].Rows[i]["productId"].ToString(), i); bllSalesQuotation.SalesQuotationMasterBatchFill(dgvProduct, Convert.ToDecimal(ListObj[0].Rows[i]["productId"].ToString()), i); dgvProduct.Rows[i].Cells["dgvtxtProductName"].Value = ListObj[0].Rows[i]["productName"].ToString(); dgvProduct.Rows[i].Cells["dgvtxtQty"].Value = ListObj[0].Rows[i]["qty"].ToString(); IsCellValue = true; dgvProduct.Rows[i].Cells["dgvcmbUnit"].Value = Convert.ToDecimal(ListObj[0].Rows[i]["unitId"].ToString()); IsCellValue = false; dgvProduct.Rows[i].Cells["dgvtxtRate"].Value = ListObj[0].Rows[i]["rate"].ToString(); IsCellValue = true; dgvProduct.Rows[i].Cells["dgvtxtAmount"].Value = ListObj[0].Rows[i]["amount"].ToString(); IsCellValue = false; dgvProduct.Rows[i].Cells["dgvcmbbatch"].Value = Convert.ToDecimal(ListObj[0].Rows[i]["batchId"].ToString()); UnitConvertionBll bllUnitConvertion = new UnitConvertionBll(); List<DataTable> listUnitByProduct = bllUnitConvertion.UnitConversionIdAndConRateViewallByProductId(dgvProduct.Rows[i].Cells["ProductId"].Value.ToString()); if (listUnitByProduct[0].Rows.Count > 0) { foreach (DataRow drUnitByProduct in listUnitByProduct[0].Rows) { if (dgvProduct.Rows[i].Cells["dgvcmbUnit"].Value.ToString() == drUnitByProduct.ItemArray[0].ToString()) { dgvProduct.Rows[i].Cells["dgvtxtUnitConversionId"].Value = Convert.ToDecimal(drUnitByProduct.ItemArray[2].ToString()); dgvProduct.Rows[i].Cells["dgvtxtConversionRate"].Value = Convert.ToDecimal(drUnitByProduct.ItemArray[3].ToString()); } } } decimal decStandardRate = BllProductCreation.SalesInvoiceProductRateForSales(Convert.ToDecimal(ListObj[0].Rows[i]["productId"].ToString()), PublicVariables._dtCurrentDate, Convert.ToDecimal(ListObj[0].Rows[i]["batchId"].ToString()), Convert.ToDecimal(cmbPricinglevel.SelectedValue), PublicVariables._inNoOfDecimalPlaces); if (dgvProduct.Rows[i].Cells["dgvtxtConversionRate"].Value != null && dgvProduct.Rows[i].Cells["dgvtxtConversionRate"].Value.ToString() != string.Empty) { if (decStandardRate != 0 && Convert.ToDecimal(dgvProduct.Rows[i].Cells["dgvtxtConversionRate"].Value) != 0) { dgvProduct.Rows[i].Cells["dgvtxtRate"].Value = Math.Round(decStandardRate / Convert.ToDecimal(dgvProduct.Rows[i].Cells["dgvtxtConversionRate"].Value), PublicVariables._inNoOfDecimalPlaces); } } } isAmountcalc = true; IsCellValue = true; IsDoAfterFill = true; } catch (Exception ex) { MessageBox.Show("SQ:39" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// On cellendedit of dgvProduct /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvProduct_CellEndEdit(object sender, DataGridViewCellEventArgs e) { ProductCreationBll BllProductCreation = new ProductCreationBll(); try { if (dgvProduct.Columns[e.ColumnIndex].Name == "dgvtxtProductName") { if (dgvProduct.Rows[e.RowIndex].Cells["dgvtxtProductName"].Value != null && dgvProduct.Rows[e.RowIndex].Cells["dgvtxtProductName"].Value.ToString().Trim() != string.Empty) { string strProductName = Convert.ToString(dgvProduct.Rows[e.RowIndex].Cells["dgvtxtProductName"].Value); ProductInfo infoProduct = BllProductCreation.ProductViewByName(strProductName); if (infoProduct.ProductCode != null && infoProduct.ProductCode != string.Empty) { TransactionsGeneralFillBll transactionGeneralFillObj = new TransactionsGeneralFillBll(); SalesQuotationBll bllSalesQuotation = new SalesQuotationBll(); dgvProduct.Rows[e.RowIndex].Cells["dgvtxtProductCode"].Value = infoProduct.ProductCode; dgvProduct.Rows[e.RowIndex].Cells["ProductId"].Value = infoProduct.ProductId; List<DataTable> ListObj = new List<DataTable>(); dgvProduct.Rows[e.RowIndex].Cells["dgvtxtRate"].Value = Math.Round(infoProduct.SalesRate); DefaultRate = Math.Round(infoProduct.PurchaseRate, PublicVariables._inNoOfDecimalPlaces); ListObjUnitViewAll = transactionGeneralFillObj.UnitViewAllByProductId(dgvProduct, infoProduct.ProductId.ToString(), e.RowIndex); ListObj = bllSalesQuotation.SalesQuotationMasterBatchFill(dgvProduct, infoProduct.ProductId, e.RowIndex); BatchBll BllBatch = new BatchBll(); decimal decBatchId = BllBatch.BatchIdViewByProductId(infoProduct.ProductId); dgvProduct.Rows[e.RowIndex].Cells["dgvcmbBatch"].Value = decBatchId; dgvProduct.Rows[e.RowIndex].Cells["dgvcmbUnit"].Value = infoProduct.UnitId; if (infoProduct.PartNo != string.Empty) { dgvProduct.Rows[e.RowIndex].Cells["dgvtxtBarcode"].Value = infoProduct.PartNo; } else { if (dgvProduct.Rows[e.RowIndex].Cells["dgvcmbBatch"].Value != null && dgvProduct.Rows[e.RowIndex].Cells["dgvcmbBatch"].Value.ToString() != string.Empty) { decBatchId = Convert.ToDecimal(dgvProduct.Rows[e.RowIndex].Cells["dgvcmbBatch"].Value); dgvProduct.Rows[e.RowIndex].Cells["dgvtxtBarcode"].Value = BllProductCreation.BarcodeViewByBatchId(decBatchId); } } IsDoAfterFill = true; UnitConvertionBll bllUnitConvertion = new UnitConvertionBll(); List<DataTable> listUnitByProduct = bllUnitConvertion.UnitConversionIdAndConRateViewallByProductId(dgvProduct.Rows[e.RowIndex].Cells["ProductId"].Value.ToString()); if (listUnitByProduct[0].Rows.Count > 0) { foreach (DataRow drUnitByProduct in listUnitByProduct[0].Rows) { if (dgvProduct.Rows[e.RowIndex].Cells["dgvcmbUnit"].Value.ToString() == drUnitByProduct.ItemArray[0].ToString()) { dgvProduct.Rows[e.RowIndex].Cells["dgvtxtUnitConversionId"].Value = Convert.ToDecimal(drUnitByProduct.ItemArray[2].ToString()); dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value = Convert.ToDecimal(drUnitByProduct.ItemArray[3].ToString()); if (IsDoAfterFill) { decimal decNewConversionRate = Convert.ToDecimal(dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value.ToString()); decimal decNewRate = (decCurrentRate * decCurrentConversionRate) / decNewConversionRate; dgvProduct.Rows[e.RowIndex].Cells["dgvtxtRate"].Value = Math.Round(decNewRate,PublicVariables._inNoOfDecimalPlaces); } } } } decimal decStandardRate = BllProductCreation.SalesInvoiceProductRateForSales(infoProduct.ProductId, PublicVariables._dtCurrentDate, decBatchId, Convert.ToDecimal(cmbPricinglevel.SelectedValue), PublicVariables._inNoOfDecimalPlaces); if (dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value != null && dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value.ToString() != string.Empty) { if (decStandardRate != 0 && Convert.ToDecimal(dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value) != 0) { dgvProduct.Rows[e.RowIndex].Cells["dgvtxtRate"].Value = Math.Round(decStandardRate / Convert.ToDecimal(dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value), PublicVariables._inNoOfDecimalPlaces); } } } else { dgvProduct.Rows[e.RowIndex].Cells["dgvtxtProductName"].Value = string.Empty; dgvProduct.Rows[e.RowIndex].Cells["dgvtxtRate"].Value = string.Empty; dgvProduct.Rows[e.RowIndex].Cells["dgvtxtProductCode"].Value = string.Empty; dgvProduct.Rows[e.RowIndex].Cells["dgvtxtBarcode"].Value = string.Empty; dgvProduct.Rows[e.RowIndex].Cells["dgvcmbUnit"].Value = string.Empty; dgvProduct.Rows[e.RowIndex].Cells["dgvtxtQty"].Value = string.Empty; dgvProduct.Rows[e.RowIndex].Cells["dgvcmbBatch"].Value = string.Empty; dgvProduct.Rows[e.RowIndex].Cells["dgvtxtAmount"].Value = string.Empty; dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value = string.Empty; dgvProduct.Rows[e.RowIndex].Cells["ProductId"].Value = string.Empty; } AmountCalculation("dgvtxtQty", e.RowIndex); TotalAmountCalculation(); } else { dgvProduct.Rows[e.RowIndex].Cells["dgvtxtProductCode"].Value = string.Empty; } } if (dgvProduct.Columns[e.ColumnIndex].Name == "dgvtxtBarcode") { if (dgvProduct.Rows[e.RowIndex].Cells["dgvtxtBarcode"].Value != null && dgvProduct.Rows[e.RowIndex].Cells["dgvtxtBarcode"].Value.ToString().Trim() != string.Empty) { List<DataTable> listObjProductdDetails = new List<DataTable>(); string strBarcode = (dgvProduct.Rows[e.RowIndex].Cells["dgvtxtBarcode"].Value.ToString()); listObjProductdDetails = BllProductCreation.ProductDetailsCoreespondingToBarcode(strBarcode); if (listObjProductdDetails[0].Rows.Count > 0) { TransactionsGeneralFillBll transactionGeneralFillObj = new TransactionsGeneralFillBll(); SalesQuotationBll bllSalesQuotation = new SalesQuotationBll(); List<DataTable> ListObj = new List<DataTable>(); dgvProduct.Rows[e.RowIndex].Cells["dgvtxtProductCode"].Value = listObjProductdDetails[0].Rows[0]["productCode"].ToString(); dgvProduct.Rows[e.RowIndex].Cells["ProductId"].Value = listObjProductdDetails[0].Rows[0]["productId"].ToString(); dgvProduct.Rows[e.RowIndex].Cells["dgvtxtProductName"].Value = listObjProductdDetails[0].Rows[0]["productName"].ToString(); dgvProduct.Rows[e.RowIndex].Cells["dgvtxtRate"].Value = Math.Round(Convert.ToDecimal(listObjProductdDetails[0].Rows[0]["SalesRate"].ToString())); DefaultRate = Math.Round(Convert.ToDecimal(listObjProductdDetails[0].Rows[0]["purchaseRate"].ToString()), PublicVariables._inNoOfDecimalPlaces); ListObjUnitViewAll = transactionGeneralFillObj.UnitViewAllByProductId(dgvProduct, listObjProductdDetails[0].Rows[0]["productId"].ToString(), e.RowIndex); ListObj = bllSalesQuotation.SalesQuotationMasterBatchFill(dgvProduct, Convert.ToDecimal(listObjProductdDetails[0].Rows[0]["productId"].ToString()), e.RowIndex); dgvProduct.Rows[e.RowIndex].Cells["dgvcmbBatch"].Value = Convert.ToDecimal(listObjProductdDetails[0].Rows[0]["batchId"].ToString()); dgvProduct.Rows[e.RowIndex].Cells["dgvcmbUnit"].Value = Convert.ToDecimal(listObjProductdDetails[0].Rows[0]["unitId"].ToString()); IsDoAfterFill = true; UnitConvertionBll bllUnitConvertion = new UnitConvertionBll(); List<DataTable> listUnitByProduct = bllUnitConvertion.UnitConversionIdAndConRateViewallByProductId(dgvProduct.Rows[e.RowIndex].Cells["ProductId"].Value.ToString()); if (listUnitByProduct[0].Rows.Count > 0) { foreach (DataRow drUnitByProduct in listUnitByProduct[0].Rows) { if (dgvProduct.Rows[e.RowIndex].Cells["dgvcmbUnit"].Value.ToString() == drUnitByProduct.ItemArray[0].ToString()) { dgvProduct.Rows[e.RowIndex].Cells["dgvtxtUnitConversionId"].Value = Convert.ToDecimal(drUnitByProduct.ItemArray[2].ToString()); dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value = Convert.ToDecimal(drUnitByProduct.ItemArray[3].ToString()); if (IsDoAfterFill) { decimal decNewConversionRate = Convert.ToDecimal(dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value.ToString()); decimal decNewRate = (decCurrentRate * decCurrentConversionRate) / decNewConversionRate; dgvProduct.Rows[e.RowIndex].Cells["dgvtxtRate"].Value = Math.Round(decNewRate, PublicVariables._inNoOfDecimalPlaces); } } } } decimal decStandardRate = BllProductCreation.SalesInvoiceProductRateForSales(Convert.ToDecimal(listObjProductdDetails[0].Rows[0]["productId"].ToString()), PublicVariables._dtCurrentDate, decBatchId, Convert.ToDecimal(cmbPricinglevel.SelectedValue), PublicVariables._inNoOfDecimalPlaces); if (dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value != null && dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value.ToString() != string.Empty) { if (decStandardRate != 0 && Convert.ToDecimal(dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value) != 0) { dgvProduct.Rows[e.RowIndex].Cells["dgvtxtRate"].Value = Math.Round(decStandardRate / Convert.ToDecimal(dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value), PublicVariables._inNoOfDecimalPlaces); } } } else { dgvProduct.Rows[e.RowIndex].Cells["dgvtxtProductName"].Value = string.Empty; dgvProduct.Rows[e.RowIndex].Cells["dgvtxtRate"].Value = string.Empty; dgvProduct.Rows[e.RowIndex].Cells["dgvtxtProductCode"].Value = string.Empty; dgvProduct.Rows[e.RowIndex].Cells["dgvtxtBarcode"].Value = string.Empty; dgvProduct.Rows[e.RowIndex].Cells["dgvcmbUnit"].Value = string.Empty; dgvProduct.Rows[e.RowIndex].Cells["dgvtxtQty"].Value = string.Empty; dgvProduct.Rows[e.RowIndex].Cells["dgvcmbBatch"].Value = string.Empty; dgvProduct.Rows[e.RowIndex].Cells["dgvtxtAmount"].Value = string.Empty; dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value = string.Empty; dgvProduct.Rows[e.RowIndex].Cells["ProductId"].Value = string.Empty; } AmountCalculation("dgvtxtQty", e.RowIndex); TotalAmountCalculation(); } else { dgvProduct.Rows[e.RowIndex].Cells["dgvtxtProductCode"].Value = string.Empty; } } else if (dgvProduct.Columns[e.ColumnIndex].Name == "dgvtxtProductCode") { if (dgvProduct.Rows[e.RowIndex].Cells["dgvtxtProductCode"].Value != null && dgvProduct.Rows[e.RowIndex].Cells["dgvtxtProductCode"].Value.ToString().Trim() != string.Empty) { ProductInfo infoProduct = new ProductInfo(); string strProductCode = dgvProduct.Rows[e.RowIndex].Cells["dgvtxtProductCode"].Value.ToString(); infoProduct = BllProductCreation.ProductViewByCode(strProductCode); if (infoProduct.ProductId != 0) { TransactionsGeneralFillBll transactionGeneralFillObj = new TransactionsGeneralFillBll(); SalesQuotationBll bllSalesQuotation = new SalesQuotationBll(); dgvProduct.Rows[e.RowIndex].Cells["dgvtxtProductName"].Value = infoProduct.ProductName; dgvProduct.Rows[e.RowIndex].Cells["ProductId"].Value = infoProduct.ProductId; dgvProduct.Rows[e.RowIndex].Cells["dgvtxtRate"].Value = Math.Round(infoProduct.SalesRate, PublicVariables._inNoOfDecimalPlaces); DefaultRate = Math.Round(infoProduct.PurchaseRate, PublicVariables._inNoOfDecimalPlaces); List<DataTable> LiostObj = new List<DataTable>(); ListObjUnitViewAll = transactionGeneralFillObj.UnitViewAllByProductId(dgvProduct, infoProduct.ProductId.ToString(), e.RowIndex); LiostObj = bllSalesQuotation.SalesQuotationMasterBatchFill(dgvProduct, infoProduct.ProductId, e.RowIndex); BatchBll BllBatch = new BatchBll(); decimal decBatchId = BllBatch.BatchIdViewByProductId(infoProduct.ProductId); dgvProduct.Rows[e.RowIndex].Cells["dgvcmbBatch"].Value = decBatchId; dgvProduct.Rows[e.RowIndex].Cells["dgvcmbUnit"].Value = infoProduct.UnitId; if (infoProduct.PartNo != string.Empty) { dgvProduct.Rows[e.RowIndex].Cells["dgvtxtBarcode"].Value = infoProduct.PartNo; } else { if (dgvProduct.Rows[e.RowIndex].Cells["dgvcmbBatch"].Value != null && dgvProduct.Rows[e.RowIndex].Cells["dgvcmbBatch"].Value.ToString() != string.Empty) { decBatchId = Convert.ToDecimal(dgvProduct.Rows[e.RowIndex].Cells["dgvcmbBatch"].Value); dgvProduct.Rows[e.RowIndex].Cells["dgvtxtBarcode"].Value = BllProductCreation.BarcodeViewByBatchId(decBatchId); } } IsDoAfterFill = true; UnitConvertionBll bllUnitByProduct = new UnitConvertionBll(); List<DataTable> listUnitByProduct = bllUnitByProduct.UnitConversionIdAndConRateViewallByProductId(dgvProduct.Rows[e.RowIndex].Cells["ProductId"].Value.ToString()); if (listUnitByProduct[0].Rows.Count > 0) { foreach (DataRow drUnitByProduct in listUnitByProduct[0].Rows) { if (dgvProduct.Rows[e.RowIndex].Cells["dgvcmbUnit"].Value.ToString() == drUnitByProduct.ItemArray[0].ToString()) { dgvProduct.Rows[e.RowIndex].Cells["dgvtxtUnitConversionId"].Value = Convert.ToDecimal(drUnitByProduct.ItemArray[2].ToString()); dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value = Convert.ToDecimal(drUnitByProduct.ItemArray[3].ToString()); if (IsDoAfterFill) { decimal decNewConversionRate = Convert.ToDecimal(dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value.ToString()); decimal decNewRate = (decCurrentRate * decCurrentConversionRate) / decNewConversionRate; dgvProduct.Rows[e.RowIndex].Cells["dgvtxtRate"].Value = Math.Round(decNewRate, PublicVariables._inNoOfDecimalPlaces); } } } } decimal decStandardRate = BllProductCreation.SalesInvoiceProductRateForSales(infoProduct.ProductId, PublicVariables._dtCurrentDate, decBatchId, Convert.ToDecimal(cmbPricinglevel.SelectedValue), PublicVariables._inNoOfDecimalPlaces); if (dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value != null && dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value.ToString() != string.Empty) { if (decStandardRate != 0 && Convert.ToDecimal(dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value) != 0) { dgvProduct.Rows[e.RowIndex].Cells["dgvtxtRate"].Value = Math.Round(decStandardRate / Convert.ToDecimal(dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value), PublicVariables._inNoOfDecimalPlaces); } } } else { dgvProduct.Rows[e.RowIndex].Cells["dgvtxtProductName"].Value = string.Empty; dgvProduct.Rows[e.RowIndex].Cells["dgvtxtRate"].Value = string.Empty; dgvProduct.Rows[e.RowIndex].Cells["dgvtxtProductCode"].Value = string.Empty; dgvProduct.Rows[e.RowIndex].Cells["dgvtxtBarcode"].Value = string.Empty; dgvProduct.Rows[e.RowIndex].Cells["dgvcmbUnit"].Value = string.Empty; dgvProduct.Rows[e.RowIndex].Cells["dgvtxtQty"].Value = string.Empty; dgvProduct.Rows[e.RowIndex].Cells["dgvcmbBatch"].Value = string.Empty; dgvProduct.Rows[e.RowIndex].Cells["dgvtxtAmount"].Value = string.Empty; dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value = string.Empty; dgvProduct.Rows[e.RowIndex].Cells["ProductId"].Value = string.Empty; } AmountCalculation("dgvtxtQty", e.RowIndex); TotalAmountCalculation(); } } else if (dgvProduct.Columns[e.ColumnIndex].Name == "dgvtxtRate") { if (dgvProduct.Rows[e.RowIndex].Cells["dgvtxtRate"].Value != null && dgvProduct.Rows[e.RowIndex].Cells["dgvtxtRate"].Value.ToString() != string.Empty) { DefaultRate = Convert.ToDecimal(dgvProduct.Rows[e.RowIndex].Cells["dgvtxtRate"].Value); } } CheckInvalidEntriesInDataGridProduct(e); } catch (Exception ex) { MessageBox.Show("SQ:56" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// On selectedindexchange of cmbPricingLevel /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbPricinglevel_SelectedIndexChanged(object sender, EventArgs e) { try { ProductCreationBll BllProductCreation = new ProductCreationBll(); foreach (DataGridViewRow dgvrw in dgvProduct.Rows) { if (dgvrw.Cells["ProductId"].Value != null) { DateTime dtcurrentDate = PublicVariables._dtCurrentDate; decimal decNodecplaces = PublicVariables._inNoOfDecimalPlaces; decimal decProductId1 = Convert.ToDecimal(dgvrw.Cells["ProductId"].Value.ToString()); if (dgvrw.Cells["dgvcmbBatch"].Value != null) { decimal decStandardRate = BllProductCreation.SalesInvoiceProductRateForSales(decProductId1, dtcurrentDate, Convert.ToDecimal(dgvrw.Cells["dgvcmbBatch"].Value), Convert.ToDecimal(cmbPricinglevel.SelectedValue), decNodecplaces); dgvrw.Cells["dgvtxtRate"].Value = Math.Round(decStandardRate / Convert.ToDecimal(dgvrw.Cells["dgvtxtConversionRate"].Value), PublicVariables._inNoOfDecimalPlaces); } } } } catch (Exception ex) { MessageBox.Show("SQ:64" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to call frmProductSearchPopup form to select and view product /// </summary> /// <param name="frmProductSearchPopup"></param> /// <param name="decproductId"></param> /// <param name="decCurrentRowIndex"></param> public void CallFromProductSearchPopup(frmProductSearchPopup frmProductSearchPopup, decimal decproductId, decimal decCurrentRowIndex) { ProductCreationBll BllProductCreation = new ProductCreationBll(); ProductInfo infoProduct = new ProductInfo(); try { this.Enabled = true; this.BringToFront(); this.frmProductSearchPopupObj = frmProductSearchPopup; int inCurrentRowIndex = dgvProduct.CurrentRow.Index; dgvProduct.Rows.Add(); if (decproductId != 0) { List<DataTable> ListObj = new List<DataTable>(); List<DataTable> ListObjUnitViewAll = new List<DataTable>(); infoProduct = BllProductCreation.ProductView(decproductId); TransactionsGeneralFillBll transactionGeneralFillObj = new TransactionsGeneralFillBll(); SalesQuotationBll bllSalesQuotation = new SalesQuotationBll(); dgvProduct.Rows[inCurrentRowIndex].Cells["dgvtxtProductName"].Value = infoProduct.ProductName; dgvProduct.Rows[inCurrentRowIndex].Cells["ProductId"].Value = infoProduct.ProductId; dgvProduct.Rows[inCurrentRowIndex].Cells["dgvtxtProductCode"].Value = infoProduct.ProductCode; dgvProduct.Rows[inCurrentRowIndex].Cells["dgvtxtRate"].Value = Math.Round(infoProduct.SalesRate, PublicVariables._inNoOfDecimalPlaces); DefaultRate = Math.Round(infoProduct.PurchaseRate, PublicVariables._inNoOfDecimalPlaces); ListObjUnitViewAll = transactionGeneralFillObj.UnitViewAllByProductId(dgvProduct, infoProduct.ProductId.ToString(), inCurrentRowIndex); ListObj= bllSalesQuotation.SalesQuotationMasterBatchFill(dgvProduct, infoProduct.ProductId, inCurrentRowIndex); BatchBll BllBatch = new BatchBll(); decimal decBatchId = BllBatch.BatchIdViewByProductId(infoProduct.ProductId); dgvProduct.Rows[inCurrentRowIndex].Cells["dgvcmbBatch"].Value = decBatchId; dgvProduct.Rows[inCurrentRowIndex].Cells["dgvcmbUnit"].Value = infoProduct.UnitId; if (infoProduct.PartNo != string.Empty) { dgvProduct.Rows[inCurrentRowIndex].Cells["dgvtxtBarcode"].Value = infoProduct.PartNo; } else { if (dgvProduct.Rows[inCurrentRowIndex].Cells["dgvcmbBatch"].Value != null && dgvProduct.Rows[inCurrentRowIndex].Cells["dgvcmbBatch"].Value.ToString() != string.Empty) { decBatchId = Convert.ToDecimal(dgvProduct.Rows[inCurrentRowIndex].Cells["dgvcmbBatch"].Value); dgvProduct.Rows[inCurrentRowIndex].Cells["dgvtxtBarcode"].Value = BllProductCreation.BarcodeViewByBatchId(decBatchId); } } IsDoAfterFill = true; UnitConvertionBll bllUnitConvertion = new UnitConvertionBll(); List<DataTable> listUnitByProduct = bllUnitConvertion.UnitConversionIdAndConRateViewallByProductId(dgvProduct.Rows[inCurrentRowIndex].Cells["ProductId"].Value.ToString()); if (listUnitByProduct[0].Rows.Count > 0) { foreach (DataRow drUnitByProduct in listUnitByProduct[0].Rows) { if (dgvProduct.Rows[inCurrentRowIndex].Cells["dgvcmbUnit"].Value.ToString() == drUnitByProduct.ItemArray[0].ToString()) { dgvProduct.Rows[inCurrentRowIndex].Cells["dgvtxtUnitConversionId"].Value = Convert.ToDecimal(drUnitByProduct.ItemArray[2].ToString()); dgvProduct.Rows[inCurrentRowIndex].Cells["dgvtxtConversionRate"].Value = Convert.ToDecimal(drUnitByProduct.ItemArray[3].ToString()); if (IsDoAfterFill) { decimal decNewConversionRate = Convert.ToDecimal(dgvProduct.Rows[inCurrentRowIndex].Cells["dgvtxtConversionRate"].Value.ToString()); decimal decNewRate = (decCurrentRate * decCurrentConversionRate) / decNewConversionRate; dgvProduct.Rows[inCurrentRowIndex].Cells["dgvtxtRate"].Value = Math.Round(decNewRate, PublicVariables._inNoOfDecimalPlaces); } } } } decimal decStandardRate = BllProductCreation.SalesInvoiceProductRateForSales(infoProduct.ProductId, PublicVariables._dtCurrentDate, decBatchId, Convert.ToDecimal(cmbPricinglevel.SelectedValue), PublicVariables._inNoOfDecimalPlaces); if (dgvProduct.Rows[inCurrentRowIndex].Cells["dgvtxtConversionRate"].Value != null && dgvProduct.Rows[inCurrentRowIndex].Cells["dgvtxtConversionRate"].Value.ToString() != string.Empty) { if (decStandardRate != 0 && Convert.ToDecimal(dgvProduct.Rows[inCurrentRowIndex].Cells["dgvtxtConversionRate"].Value) != 0) { dgvProduct.Rows[inCurrentRowIndex].Cells["dgvtxtRate"].Value = Math.Round(decStandardRate / Convert.ToDecimal(dgvProduct.Rows[inCurrentRowIndex].Cells["dgvtxtConversionRate"].Value), PublicVariables._inNoOfDecimalPlaces); } } dgvProduct.Rows[inCurrentRowIndex].HeaderCell.Value = "X"; dgvProduct.Rows[inCurrentRowIndex].HeaderCell.Style.ForeColor = Color.Red; } frmProductSearchPopupObj.Close(); frmProductSearchPopupObj = null; } catch (Exception ex) { MessageBox.Show("SQ:42" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Doing the basic calculations in grid cell value change /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvProduct_CellValueChanged(object sender, DataGridViewCellEventArgs e) { try { if (isDoCellValueChange) { decimal decOldQty = 0; decimal decCurQty = 0; decimal decNewAmount = 0; if (e.RowIndex != -1 && e.ColumnIndex != -1) { if (dgvProduct.Columns[e.ColumnIndex].Name == "dgvcmbGodown") { if (dgvProduct.Rows[e.RowIndex].Cells["dgvcmbGodown"].Value != null) { DGVRackComboFill(Convert.ToDecimal(dgvProduct.Rows[e.RowIndex].Cells["dgvcmbGodown"].Value.ToString()), dgvProduct, e.RowIndex); } } if (dgvProduct.Columns[e.ColumnIndex].Name == "dgvcmbBatch") { if (dgvProduct.Rows[e.RowIndex].Cells["dgvcmbBatch"].Value != null) { ProductCreationBll BllProductCreation = new ProductCreationBll(); decimal decRate = BllProductCreation.SalesInvoiceProductRateForSales(Convert.ToDecimal(dgvProduct.Rows[e.RowIndex].Cells["dgvtxtProductId"].Value), dtpDate.Value, Convert.ToDecimal(dgvProduct.Rows[e.RowIndex].Cells["dgvcmbBatch"].Value), Convert.ToDecimal(cmbPricingLevel.SelectedValue), PublicVariables._inNoOfDecimalPlaces); dgvProduct.Rows[e.RowIndex].Cells["dgvtxtRate"].Value = Math.Round(decRate / Convert.ToDecimal(dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value), PublicVariables._inNoOfDecimalPlaces); BatchBll BllBatch = new BatchBll(); dgvProduct.Rows[e.RowIndex].Cells["dgvtxtBarcode"].Value = BllBatch.ProductBatchBarcodeViewByBatchId(Convert.ToDecimal(dgvProduct.Rows[e.RowIndex].Cells["dgvcmbBatch"].Value)); } } //------------Hided when asked Rejection In not to need unit conversion process ------------------- //if (dgvProduct.Columns[e.ColumnIndex].Name == "dgvcmbUnit") //{ // if (dgvProduct.Rows[e.RowIndex].Cells["dgvtxtproductId"].Value != null && dgvProduct.Rows[e.RowIndex].Cells["dgvtxtproductId"].Value.ToString() != string.Empty) // { // if (dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value != null && dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value.ToString() != string.Empty) // { // if (dgvProduct.Rows[e.RowIndex].Cells["dgvtxtRate"].Value != null && dgvProduct.Rows[e.RowIndex].Cells["dgvtxtRate"].Value.ToString() != string.Empty) // { // decCurrentConversionRate = Convert.ToDecimal(dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value.ToString()); // decCurrentRate = Convert.ToDecimal(dgvProduct.Rows[e.RowIndex].Cells["dgvtxtRate"].Value.ToString()); // } // } // } //} if (dgvProduct.Columns[e.ColumnIndex].Name == "dgvtxtQuantity") { DeliveryNoteDetailsInfo infodeliverynotedetails = new DeliveryNoteDetailsInfo(); //DeliveryNoteDetailsSP spdeliverynotedetails = new DeliveryNoteDetailsSP(); DeliveryNoteBll bllDeliveryNote = new DeliveryNoteBll(); List<DataTable> listObj = bllDeliveryNote.DeliveryNoteDetailsViewByDeliveryNoteMasterIdWithPending(Convert.ToDecimal(cmbDeliveryNoteNo.SelectedValue.ToString()), decRejectionInIdToEdit); if (dgvProduct.Rows[e.RowIndex].Cells["dgvtxtQuantity"].Value != null) { List<DataTable> listUnitByProduct = new List<DataTable>(); UnitConvertionBll bllUnitConvertion = new UnitConvertionBll(); listUnitByProduct = bllUnitConvertion.UnitConversionIdAndConRateViewallByProductId(dgvProduct.Rows[e.RowIndex].Cells["dgvtxtProductId"].Value.ToString()); foreach (DataRow drdtbl in listObj[0].Rows) { foreach (DataRow drUnitviewall in listUnitByProduct[0].Rows) { if (drdtbl["unitConversionId"].ToString() == drUnitviewall["unitConversionId"].ToString()) { decimal decCurrentQty = Convert.ToDecimal(drdtbl.ItemArray[3].ToString()); decimal decConRateToDlryNteDtls = Convert.ToDecimal(drUnitviewall.ItemArray[3].ToString()); decimal decCurConRateInGrid = Convert.ToDecimal(dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value.ToString()); decOldQty = (decCurrentQty / decConRateToDlryNteDtls) * decCurConRateInGrid; decOldQty = Math.Round(decOldQty, PublicVariables._inNoOfDecimalPlaces); decCurQty = Convert.ToDecimal(dgvProduct.Rows[e.RowIndex].Cells["dgvtxtQuantity"].Value.ToString()); } } } if (decCurQty > decOldQty) { dgvProduct.Rows[e.RowIndex].Cells["dgvtxtQuantity"].Value = decOldQty; } else if (decCurQty <= decOldQty) { decimal decrate = Convert.ToDecimal(dgvProduct.Rows[e.RowIndex].Cells["dgvtxtRate"].Value.ToString()); dgvProduct.Rows[e.RowIndex].Cells["dgvtxtAmount"].Value = Math.Round(decrate * decCurQty, PublicVariables._inNoOfDecimalPlaces); CalcTotalAmt(); } } } if (dgvProduct.Columns[e.ColumnIndex].Name == "dgvcmbUnit") { if (dgvProduct.Rows[e.RowIndex].Cells["dgvcmbUnit"].Value != null) { List<DataTable> listUnitByProduct = new List<DataTable>(); UnitConvertionBll bllUnitConvertion = new UnitConvertionBll(); listUnitByProduct = bllUnitConvertion.UnitConversionIdAndConRateViewallByProductId(dgvProduct.Rows[e.RowIndex].Cells["dgvtxtProductId"].Value.ToString()); foreach (DataRow drUnitByProduct in listUnitByProduct[0].Rows) { if (dgvProduct.Rows[e.RowIndex].Cells["dgvcmbUnit"].Value.ToString() == drUnitByProduct.ItemArray[0].ToString()) { dgvProduct.Rows[e.RowIndex].Cells["dgvtxtUnitConversionId"].Value = Convert.ToDecimal(drUnitByProduct[2].ToString()); dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value = Convert.ToDecimal(drUnitByProduct.ItemArray[3].ToString()); if (isDoAfterGridFill) { decimal decNewConversionRate = Convert.ToDecimal(dgvProduct.Rows[e.RowIndex].Cells["dgvtxtConversionRate"].Value.ToString()); decCurQty = Convert.ToDecimal(dgvProduct.Rows[e.RowIndex].Cells["dgvtxtQuantity"].Value.ToString()); decimal decNewRate = (decCurrentRate * decCurrentConversionRate) / decNewConversionRate; dgvProduct.Rows[e.RowIndex].Cells["dgvtxtRate"].Value = Math.Round(decNewRate); decNewAmount = (decCurrentRate * decCurQty * decCurrentConversionRate) / decNewConversionRate; dgvProduct.Rows[e.RowIndex].Cells["dgvtxtAmount"].Value = Math.Round(decNewAmount); txtTotalAmount.Text = Math.Round(decNewRate, 2).ToString(); CalcTotalAmt(); } } } } } } } } catch (Exception ex) { MessageBox.Show("RI:41 " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public void getProductRate(int index, decimal decProductId, decimal decBatchId) { ProductCreationBll BllProductCreation = new ProductCreationBll(); decimal decPricingLevelId = 0; DateTime dtcurrentDate = PublicVariables._dtCurrentDate; decimal decNodecplaces = PublicVariables._inNoOfDecimalPlaces; decPricingLevelId = Convert.ToDecimal(cmbPricingLevel.SelectedValue.ToString()); decimal decRate = BllProductCreation.SalesInvoiceProductRateForSales(decProductId, dtcurrentDate, decBatchId, decPricingLevelId, decNodecplaces); dgvSalesOrder.Rows[index].Cells["dgvtxtRate"].Value = decRate; }