/// <summary> /// Function for call from productRegister /// </summary> public void CallFromProductRegister(decimal decId, frmProductRegister frmProRegister) { try { base.Show(); this.frmProductRegisterObj = frmProRegister; frmProductRegisterObj.Enabled = false; ProductSP spProduct = new ProductSP(); ProductInfo infoProduct = new ProductInfo(); StockPostingInfo infoStockPosting = new StockPostingInfo(); BatchInfo infoBatch = new BatchInfo(); StockPostingSP spStockposting = new StockPostingSP(); BatchSP spBatch = new BatchSP(); DataTable dtbl = new DataTable(); UnitSP spUnit = new UnitSP(); decProductIdForEdit = decId; infoProduct = spProduct.ProductView(decId); strUnitNameForGrid = spUnit.UnitName(infoProduct.UnitId); btnSave.Text = "Update"; btnDelete.Enabled = true; //cmbUnit.Enabled = false; txtName.Text = infoProduct.ProductName; txtProductCode.Text = infoProduct.ProductCode; cmbGroup.SelectedValue = infoProduct.GroupId; cmbBrand.SelectedValue = infoProduct.BrandId; cmbUnit.SelectedValue = infoProduct.UnitId; if (spProduct.ProductReferenceCheck(decId)) { cmbUnit.Enabled = false; } decUnitIdForUpdate = infoProduct.UnitId; cmbSize.SelectedValue = infoProduct.SizeId; cmbModalNo.SelectedValue = infoProduct.ModelNoId; cmbTax.SelectedValue = infoProduct.TaxId; cmbTaxApplicableOn.SelectedItem = infoProduct.TaxapplicableOn; txtPurchaseRate.Text = infoProduct.PurchaseRate.ToString(); txtSalesRate.Text = infoProduct.SalesRate.ToString(); txtMrp.Text = infoProduct.Mrp.ToString(); txtMinimumStock.Text = infoProduct.MinimumStock.ToString(); txtMaximumStock.Text = infoProduct.MaximumStock.ToString(); txtReorderLevel.Text = infoProduct.ReorderLevel.ToString(); txtPartNo.Text = infoProduct.PartNo; cmbDefaultGodown.SelectedValue = infoProduct.GodownId; cmbDefaultRack.SelectedValue = infoProduct.RackId; if (infoProduct.IsBom) { cmbBom.SelectedIndex = 1; isBomFromRegister = true; } if (infoProduct.Ismultipleunit) { cmbMultipleUnit.SelectedIndex = 1; isMulUnitFromRgister = true; } if (infoProduct.Isopeningstock) { isOpeningStockForUpdate = true; OpeningStockGridFill(); } if (infoProduct.IsallowBatch) { OpeningStockGridWithBathFill(); } else { cmbAllowBatch.SelectedIndex = 0; txtPartNo.Text = spBatch.PartNoReturn(decProductIdForEdit); } if (infoProduct.Ismultipleunit) { cmbMultipleUnit.SelectedIndex = 1; } else { cmbMultipleUnit.SelectedIndex = 0; } if (infoProduct.IsBom) { cmbBom.SelectedIndex = 1; } else { cmbBom.SelectedIndex = 0; } if (infoProduct.Isopeningstock) { cmbOpeningStock.SelectedIndex = 1; } else { cmbOpeningStock.SelectedIndex = 0; } if (infoProduct.IsActive) { cbxActive.Checked = true; } else { cbxActive.Checked = false; } if (infoProduct.IsshowRemember) { cbxReminder.Checked = true; } else { cbxReminder.Checked = false; } txtNarration.Text = infoProduct.Narration; } catch (Exception ex) { MessageBox.Show("PC:63" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }