/// <summary> /// Function to add new standard rate for the purticular product /// </summary> /// <param name="decProductId"></param> /// <param name="frmStandardRate"></param> public void CallFromStandardRate(decimal decProductId, frmStandardRate frmStandardRate) { try { base.Show(); StandardrateObj = frmStandardRate; StandardrateObj.Enabled = false; ProductInfo infoProduct = new ProductInfo(); ProductCreationBll BllProductCreation = new ProductCreationBll(); UnitBll bllUnit = new UnitBll(); UnitInfo infoUnit = new UnitInfo(); infoProduct = BllProductCreation.ProductViewForStandardRate(decProductId); txtProductCode.Text = infoProduct.ProductCode; txtProductName.Text = infoProduct.ProductName; decProduct = infoProduct.ProductId; infoUnit = bllUnit.unitVieWForStandardRate(decProductId); decUnitId = infoUnit.UnitId; txtUnitName.Text = infoUnit.UnitName; txtProductName.ReadOnly = true; txtProductCode.ReadOnly = true; txtUnitName.ReadOnly = true; BatchUnderProductComboFill(decProductId); GridFill(decProductId); } catch (Exception ex) { MessageBox.Show("SRP2:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// fill Items into the purticular controls for Update or delete /// </summary> public void FillControls() { try { StandardRateInfo infoStandardRate = new StandardRateInfo(); standardRateBll BllStandaredRate = new standardRateBll(); infoStandardRate = BllStandaredRate.StandardRateView(decStandardRate); dtpFromDate.Value = Convert.ToDateTime(infoStandardRate.ApplicableFrom.ToString()); dtpToDate.Value = Convert.ToDateTime(infoStandardRate.ApplicableTo.ToString()); dtpFromDate.Text = infoStandardRate.ApplicableFrom.ToString(); dtpToDate.Text = infoStandardRate.ApplicableTo.ToString(); txtRate.Text = infoStandardRate.Rate.ToString(); decProduct = infoStandardRate.ProductId; decUnitId = infoStandardRate.UnitId; ProductCreationBll BllProductCreation = new ProductCreationBll(); ProductInfo infoProduct = new ProductInfo(); infoProduct = BllProductCreation.ProductViewForStandardRate(decProductId); txtProductCode.Text = infoProduct.ProductCode; txtProductName.Text = infoProduct.ProductName; decStandardRateId = infoStandardRate.StandardRateId; UnitInfo infoUnit = new UnitInfo(); UnitBll bllUnit = new UnitBll(); infoUnit = bllUnit.UnitView(decUnit); txtUnitName.Text = infoUnit.UnitName; txtProductName.ReadOnly = true; txtProductCode.ReadOnly = true; txtUnitName.ReadOnly = true; BatchInfo infoBatch = new BatchInfo(); BatchBll BllBatch = new BatchBll(); decBatchId = infoStandardRate.BatchId; infoBatch = BllBatch.BatchView(decBatchId); cmbBatch.SelectedValue = infoBatch.BatchId; } catch (Exception ex) { MessageBox.Show("SRP5:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }