private void LoadQuantity() { float netWeight; int NoBags; float qty; try { netWeight = float.Parse(this.lblNetWeight.Text); } catch { this.lblmsg.Text = "Net Weight is Invalid."; return; } Nullable <Guid> commodityGrade = null; if (DataValidationBLL.isGUID(this.hfCommodityGradeId.Value.ToString(), out commodityGrade) != true) { this.lblmsg.Text = "Commodity Grade in not availble please check and try again."; return; } if (int.TryParse(lblBags.Text, out NoBags) == false) { this.lblmsg.Text = "Invalid No Bags"; return; } GRNBLL objQty = new GRNBLL(); qty = GRNBLL.CalculateGRNQuantity(netWeight, NoBags, (Guid)commodityGrade); this.lblCurrentQuantity.Text = qty.ToString(); this.lblOriginalQuantity.Text = qty.ToString(); }
private void LoadQuantity() { this.CommodityGradeID = new Guid(this.hfCommodityGradeId.Value.ToString()); float netWeight; int NoBags = -1; float qty; try { netWeight = float.Parse(this.lblNetWeight.Text); } catch { this.lblmsg.Text = "Net Weight is Invalid."; return; } if (int.TryParse(lblBags.Text, out NoBags) == false) { this.lblmsg.Text = "Number of Bags is Invalid."; return; } Guid commodityGrade = Guid.Empty; commodityGrade = new Guid(this.hfCommodityGradeId.Value.ToString()); GRNBLL objQty = new GRNBLL(); qty = GRNBLL.CalculateGRNQuantity(netWeight, NoBags, (Guid)commodityGrade); this.lblCurrentQuantity.Text = qty.ToString(); this.lblOriginalQuantity.Text = qty.ToString(); }