Ejemplo n.º 1
0
        //checks for a valid quantity
        private int CheckForValidQuantity()
        {
            int result = 1;

            //foreach (DataGridItem dItem in grdItems.Items)
            foreach (GridViewRow dItem in grdViewItems.Rows)
            {
                TextBox     txtQty             = (TextBox)dItem.FindControl("txtQty");
                Label       lblLimit           = (Label)dItem.FindControl("lblQty");
                PlaceHolder MessagePlaceHolder = (PlaceHolder)dItem.FindControl("MessagePlaceHolder");

                GlobalUtils.Utils UtilityMethods = new GlobalUtils.Utils();
                bool returnvalue = UtilityMethods.IsQtyValueValid(txtQty.Text, lblLimit.Text);
                if (returnvalue == false)
                {
                    GlobalUtils.Utils.DisplayMessage(ref MessagePlaceHolder, 2);
                    result = -1;
                    break;
                }
                else
                {
                    GlobalUtils.Utils.DisplayMessage(ref MessagePlaceHolder, 99);
                }
            }
            return(result);
        }