/// <summary>
 /// Function for call from productRegister
 /// </summary>
 public void CallFromProductRegister(decimal decId, frmProductRegister frmProRegister)
 {
     try
     {
         base.Show();
         this.frmProductRegisterObj = frmProRegister;
         frmProductRegisterObj.Enabled = false;
         ProductCreationBll BllProductCreation = new ProductCreationBll();
         ProductInfo infoProduct = new ProductInfo();
         StockPostingInfo infoStockPosting = new StockPostingInfo();
         BatchInfo infoBatch = new BatchInfo();
         StockPostingBll BllStockPosting = new StockPostingBll();
         BatchBll BllBatch = new BatchBll();
         UnitBll bllUnit = new UnitBll();
         List<DataTable> ListObj = new List<DataTable>();
         decProductIdForEdit = decId;
         infoProduct = BllProductCreation.ProductView(decId);
         strUnitNameForGrid = bllUnit.UnitName(infoProduct.UnitId);
         btnSave.Text = "Update";
         btnDelete.Enabled = true;
         txtName.Text = infoProduct.ProductName;
         txtProductCode.Text = infoProduct.ProductCode;
         cmbGroup.SelectedValue = infoProduct.GroupId;
         cmbBrand.SelectedValue = infoProduct.BrandId;
         cmbUnit.SelectedValue = infoProduct.UnitId;
         if (BllProductCreation.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 = BllBatch.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);
     }
 }