Beispiel #1
0
        private void LoadNetWeight()
        {
            if (this.CommodityGradeID == Guid.Empty)
            {
                this.lblmsg.Text = "Invalid Commodity Grade";
                return;
            }
            float grossweight;

            try
            {
                grossweight = float.Parse(this.lblGrossWeight.Text);
            }
            catch
            {
                this.lblmsg.Text = "Gross weight in not availble please check and try again.";
                return;
            }

            Nullable <Guid> BagId = null;

            if (DataValidationBLL.isGUID(this.hfBagTypeId.Value.ToString(), out BagId) != true)
            {
                this.lblmsg.Text = "Bag type in not availble please check and try again.";
                return;
            }
            Nullable <int> NoBags = null;

            if (DataValidationBLL.isInteger(this.lblBags.Text, out NoBags) != true)
            {
                this.lblmsg.Text = "Number of bags in not availble please check and try again.";
                return;
            }

            float  netWeight;
            GRNBLL objNetWeight = new GRNBLL();

            try
            {
                netWeight = (float)objNetWeight.CalculateNetWeight((float)grossweight, (Guid)BagId, (int)NoBags, this.CommodityGradeID);
                this.lblNetWeight.Text = netWeight.ToString();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }