Beispiel #1
0
        /// <summary>
        /// validations
        /// </summary>
        /// <returns></returns>
        private bool DoValidations()
        {
            if (txtConsignerID.Text == "")
            {
                return false;
            }

            if (txtConsignerID.Text != "")
            {
                try
                {
                    int itest = int.Parse(txtConsignerID.Text.ToString());
                }
                catch
                {
                    return false;
                }
            }

            // valid consignor?
            ConsignorClasses.ConsignorUtilities cu = new ConsignorClasses.ConsignorUtilities();
            if (!cu.ValidConsignor(txtConsignerID.Text))
            {
                return false;
            }

            // NOW test the data grid
            if (dgInventory.Rows.Count == 1)
            {
                return false;
            }

            for (int iRow = 0; iRow < dgInventory.Rows.Count -1; iRow++)
            {
                if (dgInventory[0, iRow].Value == null)
                {
                    return false;
                }
                try
                {
                    decimal dTest = decimal.Parse(dgInventory[1, iRow].Value.ToString());
                }
                catch
                {
                    return false;
                }
            }
            return true;
        }