Beispiel #1
0
 private bool CheckDataBase()
 {
     if (!ChefmateUtility.TestConnection(CurrentSettings.DbIpAddress, CurrentSettings.DbPath))
     {
         return(false);
     }
     return(true);
 }
Beispiel #2
0
 private bool CheckDataBase()
 {
     if (!ChefmateUtility.TestConnection(_dbIpAddress, _dbPath))
     {
         ValidationError = "Couldn't connect to Database.";
         return(false);
     }
     return(true);
 }
Beispiel #3
0
        private bool DoValidations()
        {
            ValidationError = "";
            if (string.IsNullOrWhiteSpace(CurrentSettings.DisplayName))
            {
                ValidationError = "Please Enter a display name for terminal.";
                return(false);
            }

            if (string.IsNullOrWhiteSpace(CurrentSettings.TerminalIpAddress) || !ChefmateUtility.IsValidIpAddress(CurrentSettings.TerminalIpAddress))
            {
                ValidationError = "Please Enter a valid ip address for terminal.";
                return(false);
            }
            if (string.IsNullOrWhiteSpace(CurrentSettings.DbPath))
            {
                ValidationError = "Please Enter a path for database.";
                return(false);
            }

            if (string.IsNullOrWhiteSpace(CurrentSettings.TerminalIpAddress) || !ChefmateUtility.IsValidIpAddress(CurrentSettings.DbIpAddress))
            {
                ValidationError = "Please Enter a valid ip address for databse.";
                return(false);
            }
            if (CurrentSettings.SecondWarningTime == 0)
            {
                ValidationError = "Second warning time should be greater than 0.";
                return(false);
            }
            if (CurrentSettings.FirstWarningTime == 0)
            {
                ValidationError = "First warning time should be greater than 0.";
                return(false);
            }
            if (CurrentSettings.FirstWarningTime >= CurrentSettings.SecondWarningTime)
            {
                ValidationError = "First warning time can't be greater than or equal to second warning time.";
                return(false);
            }
            try
            {
                if (!CheckDataBase())
                {
                    ValidationError = "Database connection failed. Please enter valid ipaddress and path for database.";
                    return(false);
                }
            }
            catch (Exception)
            {
                ValidationError = "Database connection failed. Please enter valid ipaddress and path for database.";
                return(false);
            }

            return(true);
        }
Beispiel #4
0
 private void CheckIpAddress(string ipAddress, string prop)
 {
     if (string.IsNullOrWhiteSpace(ipAddress) || !ChefmateUtility.IsValidIpAddress(ipAddress))
     {
         ValidationError = "Invalid " + prop;
     }
     else
     {
         ValidationError = String.Empty;
     }
 }
Beispiel #5
0
        public bool BuildOrder(string inXmluri)
        {
            var posOrder      = ChefmateUtility.DeSerializeFromFilePath <PosOrder>(inXmluri);
            var chefmateOrder = ConvertToChefmateOrder(posOrder);

            if (chefmateOrder != null)
            {
                ChefmateController.Instance.OrderArrived(chefmateOrder);
                // play sound when an order comes from POS to chefmate.
                PlaySoundByOrderState(chefmateOrder.OrderState);
                return(true);
            }
            return(false);
        }
Beispiel #6
0
        private bool DoValidations()
        {
            ValidationError = "";
            if (string.IsNullOrWhiteSpace(DisplayName))
            {
                ValidationError = "Please Enter a display name for terminal.";
                return(false);
            }

            if (string.IsNullOrWhiteSpace(TerminalIpAddress) || !ChefmateUtility.IsValidIpAddress(TerminalIpAddress))
            {
                ValidationError = "Please Enter a valid ip address for terminal.";
                return(false);
            }
            if (string.IsNullOrWhiteSpace(DbPath))
            {
                ValidationError = "Please Enter a path for database.";
                return(false);
            }

            if (string.IsNullOrWhiteSpace(DbIpAddress) || !ChefmateUtility.IsValidIpAddress(DbIpAddress))
            {
                ValidationError = "Please Enter a valid ip address for databse.";
                return(false);
            }
            try
            {
                if (!CheckDataBase())
                {
                    ValidationError = "Database connection failed. Please enter valid ipaddress and path for database.";
                    return(false);
                }
            }
            catch (Exception)
            {
                ValidationError = "Database connection failed. Please enter valid ipaddress and path for database.";
                return(false);
            }

            return(true);
        }