示例#1
0
        private bool CheckLogon()
        {
            if (trys++ > 2)
            {
                trys = 0;
                return(false);
            }
            Employee employee = new Employee();

            employee.Organization_no = PosSettings.Default.Organization;
            employee.Logon_no        = userno.ToString();
            employee.LoadByLogon();
            //if( employee.Logon_pass.Length == 0 )
            //{
            //	errorCode = PosErrorCode.BAD_USER;
            //	return false;
            //}

            if (MD5HashHelper.verifyMd5Hash(passno.ToString(), employee.Logon_pass))
            {
                employee.Relations();
                PosContext.Instance.Employee = employee;
                return(true);
            }
            else
            {
                errorCode = PosErrorCode.BAD_PASSWORD;
                return(false);
            }
        }
示例#2
0
        public PosError(PosErrorCode code)
        {
            errorCode  = code;
            PromptText = "";

            switch (code)
            {
            case PosErrorCode.INVALID_INPUT:
                PromptText = PosContext.Instance.Parameters.getParam("InvalidInput");
                break;

            case PosErrorCode.INSUFFICIENT_FUNDS:
                PromptText = PosContext.Instance.Parameters.getParam("InsufficientFunds");
                break;

            case PosErrorCode.MGR_REQUIRED:
                PromptText = PosContext.Instance.Parameters.getParam("MgrIntervention");
                break;

            case PosErrorCode.LOGON_FAILED:
                PromptText = PosContext.Instance.Parameters.getParam("");
                break;

            case PosErrorCode.BAD_USER:
                PromptText = PosContext.Instance.Parameters.getParam("BadName");
                break;

            case PosErrorCode.BAD_PASSWORD:
                PromptText = PosContext.Instance.Parameters.getParam("BadPass");
                break;

            case PosErrorCode.FLOPPY_ERROR:
                PromptText = PosContext.Instance.Parameters.getParam("InsertFloppy");
                break;

            case PosErrorCode.INVALID_CUSTOMER_NO:
                PromptText = PosContext.Instance.Parameters.getParam("InvalidCustomer");
                break;

            case PosErrorCode.INSUFFICIENT_TENDER_AMOUNT:
                PromptText = PosContext.Instance.Parameters.getParam("InsufficientTenderAmount");
                break;

            case PosErrorCode.INVALID_DRAWER_NO:
            case PosErrorCode.INVALID_CHECK_NO:
            case PosErrorCode.RECALL_FAILLED:
                PromptText = PosContext.Instance.Parameters.getParam("");
                break;

            case PosErrorCode.CASH_EXCEEDED:
                PromptText = PosContext.Instance.Parameters.getParam("CashLimitExceeded");
                break;

            case PosErrorCode.INVALID_CC:
                PromptText = PosContext.Instance.Parameters.getParam("BadCCNo");
                break;

            case PosErrorCode.INVALID_EXPR:
                PromptText = PosContext.Instance.Parameters.getParam("BadCCNo");
                break;

            case PosErrorCode.HARDWARE_PROBLEM:
                PromptText = PosContext.Instance.Parameters.getParam(PosHardware.Instance.ErrorText);
                break;

            case PosErrorCode.ITEM_DISCOUNT_NOT_APPLICABLE:
                PromptText = PosContext.Instance.Parameters.getParam("ItemDiscountNotApplicable");
                break;

            case PosErrorCode.PROMOTION_NOT_APPLICABLE:
                PromptText = PosContext.Instance.Parameters.getParam("SelectPromotionBeforeItemEntry");
                break;

            case PosErrorCode.SHUTDOWN_NOT_ALLOWED:
                PromptText = PosContext.Instance.Parameters.getParam("ShutdownKeyNotAllowed");
                break;

            case PosErrorCode.INSUFFICIENT_USER_AUTHORITY:
                PromptText = PosContext.Instance.Parameters.getParam("InsufficientUserAuthority");
                break;

            case PosErrorCode.PRICE_CHANGE_NOT_ALLOWED:
                PromptText = PosContext.Instance.Parameters.getParam("PriceChangeNotAllowed");
                break;

            case PosErrorCode.INVALID_FUNCTION_KEY:
                PromptText = PosContext.Instance.Parameters.getParam("InvalidFunction");
                break;

            case PosErrorCode.INVALID_EMPLOYEE_NO:
                PromptText = PosContext.Instance.Parameters.getParam("InvalidEmployeeNumber");
                break;

            case PosErrorCode.OVER_MEDIA_LIMIT:
            case PosErrorCode.UNDER_MEDIA_LIMIT:
            case PosErrorCode.LOCKED:
            default:
                PromptText = " -- unknown error --";
                break;
            }
        }