/// <summary> /// Function to fill the grid to edit the details /// </summary> public void SalesQuotationDetailsEditFill() { SalesQuotationBll bllSalesQuotation = new SalesQuotationBll(); SalesQuotationDetailsInfo infoSalesQuotationDetails = new SalesQuotationDetailsInfo(); ProductCreationBll BllProductCreation = new ProductCreationBll(); ProductInfo infoproduct = new ProductInfo(); try { for (int inI = 0; inI < dgvProduct.Rows.Count - 1; inI++) { infoSalesQuotationDetails.QuotationMasterId = decSalesquotationMasterId; infoSalesQuotationDetails.QuotationDetailsId = Convert.ToDecimal(dgvProduct.Rows[inI].Cells["dgvtxtQuotationDetailsId"].Value); infoproduct = BllProductCreation.ProductViewByCode(dgvProduct.Rows[inI].Cells["dgvtxtProductCode"].Value.ToString()); infoSalesQuotationDetails.ProductId = infoproduct.ProductId; infoSalesQuotationDetails.Qty = Convert.ToDecimal(dgvProduct.Rows[inI].Cells["dgvtxtQty"].Value.ToString()); if (Convert.ToDecimal(dgvProduct.Rows[inI].Cells["dgvtxtQuotationDetailsId"].Value) == 0) { infoSalesQuotationDetails.UnitId = Convert.ToDecimal(dgvProduct.Rows[inI].Cells["dgvcmbUnit"].Value.ToString()); } else { DGVUnitComboFill(); infoSalesQuotationDetails.UnitId = Convert.ToDecimal((dgvProduct.Rows[inI].Cells["dgvcmbUnit"].Value.ToString())); } decimal unitConversion = bllSalesQuotation.UnitconversionIdViewByUnitIdAndProductId(infoSalesQuotationDetails.UnitId, infoSalesQuotationDetails.ProductId); infoSalesQuotationDetails.UnitConversionId = unitConversion; infoSalesQuotationDetails.BatchId = Convert.ToDecimal(dgvProduct.Rows[inI].Cells["dgvcmbBatch"].Value); infoSalesQuotationDetails.Rate = Convert.ToDecimal(dgvProduct.Rows[inI].Cells["dgvtxtRate"].Value); infoSalesQuotationDetails.Amount = Convert.ToDecimal(dgvProduct.Rows[inI].Cells["dgvtxtAmount"].Value); infoSalesQuotationDetails.Slno = Convert.ToInt32(dgvProduct.Rows[inI].Cells["dgvtxtSlNo"].Value); infoSalesQuotationDetails.Extra1 = string.Empty; infoSalesQuotationDetails.Extra2 = string.Empty; bllSalesQuotation.SalesQuotationDetailsEdit(infoSalesQuotationDetails); } } catch (Exception ex) { MessageBox.Show("SQ:20" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }