Exemplo n.º 1
0
        public static MsgE GetMessage(DataSet ds)
        {
            MsgE msgID = MsgE.CreditCardValid;

            if (ds != null && ds.Tables.Count > 0)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    Kv kv = new Kv(ds.Tables[0]);
                    if (kv.Get("Message") == "0")
                    {
                        msgID = MsgE.CreditCardValid;
                    }
                    else if (kv.Get("Message") == "1")
                    {
                        msgID = MsgE.CardAlreadyCheckedout;
                    }
                    else if (kv.Get("Message") == "2")
                    {
                        msgID = MsgE.VoucherInvalid;
                    }
                }
            }
            return(msgID);
        }
Exemplo n.º 2
0
 public static DialogResult Show2(Form owner, MsgE msgId, MessageBoxButtons buttons, MessageBoxIcon icon, params object[] vals)
 {
     try
     {
         return(MessageBox.Show(owner, Msg.GetMsg(msgId, vals), Config.ProductName, buttons, icon));     // due to cross thread use try..DA
     }
     catch
     {
     }
     return(DialogResult.None);
 }
Exemplo n.º 3
0
        public static int LoginMsg(Kv kv, bool isGuest)
        {
            DataTable dt    = null;
            int       msgID = 0;

            if (isGuest)
            {
                msgID = kv.GetInt32("Msg");
            }
            else
            {
                Kv kv1 = new Kv(kv.GetDataTable("Msg"));
                dt    = kv1.DataTable;
                msgID = Convert.ToInt32(dt.Rows[0][0]);
            }

            if (msgID < 0)
            {
                msgID = msgID * -1;
                MsgE msge = (MsgE)msgID;

                switch (msge)
                {
                case MsgE.Active:
                    return((int)MsgE.Active);

                case MsgE.Disabled:
                case MsgE.Inactive:
                case MsgE.Deleted:
                case MsgE.BlockIp:
                    return((int)MsgE.BlockIp);

                case MsgE.InfoBlockMachine:
                case MsgE.WrongIdPassowrd:
                    return((int)MsgE.WrongIdPassowrd);

                case MsgE.NoRoles:
                    return((int)MsgE.NoRoles);

                case MsgE.Ban:
                    //MessageForm.Error(this, MsgE.ErrorBannedForever, Ap.CurrentUser.UserName);
                    return((int)MsgE.Ban);
                }
            }
            else if (msgID == 0)
            {
                //MessageForm.Error(this, MsgE.InfoBaned, kv.GetDateTime("BanEndDateTime"), kv.GetDateTime("BanEndDateTime1"));
                return(0);
            }
            return(msgID);
        }
Exemplo n.º 4
0
        public static string GetMsg(MsgE msgId, params object[] vals)
        {
            string text = GetMsg(msgId);

            int i = 1;

            foreach (object val in vals)
            {
                text = text.Replace("@p" + i.ToString(), val.ToString());
                i++;
            }

            return(text);
        }
Exemplo n.º 5
0
        public bool Validate(out MsgE msg)
        {
            DateTime datetime;

            if (txtTitle.Text.Trim() == string.Empty)
            {
                msg = MsgE.ErrorTournamentName;
                return(false);
            }

            if (!DateTime.TryParseExact(dtpRegStartTime.Text, "h:m tt", CultureInfo.InvariantCulture, DateTimeStyles.None, out datetime))
            {
                msg = MsgE.ErrorTournamentStartTime;
                return(false);
            }

            if (!DateTime.TryParseExact(dtpRegEndTime.Text, "h:m tt", CultureInfo.InvariantCulture, DateTimeStyles.None, out datetime))
            {
                msg = MsgE.ErrorTournamentEndTime;
                return(false);
            }

            if (!DateTime.TryParseExact(dtpTournamentStartTime.Text, "h:m tt", CultureInfo.InvariantCulture, DateTimeStyles.None, out datetime))
            {
                msg = MsgE.ErrorTournamentStartTime;
                return(false);
            }


            if (cmbType.SelectedValue.ToString() == "3" && chkAllowTieBreak.Checked) // for Knock-out tournament
            {
                GameType trGameType = GameTime.GetGameType(Convert.ToInt32(cmbMin.Text), Convert.ToInt32(cmbSec.Text));
                GameType tbGameType = GameTime.GetGameType(Convert.ToInt32(cmbTbMin.Text), Convert.ToInt32(cmbTbSec.Text));
                GameType sdGameType = GameTime.GetGameType(Convert.ToInt32(cmbWhiteMin.Text), Convert.ToInt32(cmbSdSec.Text));

                if (trGameType != tbGameType || trGameType != sdGameType)
                {
                    msg = MsgE.ErrorRestartGameTime;
                    return(false);
                }
            }

            msg = MsgE.ErrorTournamentName;
            return(true);
        }
        private void btnSubmitKey_Click(object sender, EventArgs e)
        {
            DataSet ds = SocketClient.CheckoutAccount(txtVoucherNo.Text);

            MsgE msgID = UserVoucher.GetMessage(ds);

            if (msgID != MsgE.VoucherInvalid)
            {
                lblcp.Text       = ds.Tables[0].Rows[2][1].ToString();
                lblExpDate2.Text = ds.Tables[0].Rows[3][1].ToString();
                if (msgID == MsgE.CreditCardValid)
                {
                    MessageForm.Show(this.ParentForm, msgID);
                    this.ParentForm.Close();
                }
            }
            else
            {
                MessageForm.Show(this.ParentForm, msgID);
            }
        }
Exemplo n.º 7
0
        public static string GetMsg(MsgE msgId)
        {
            switch (msgId)
            {
            case MsgE.Disabled:
                return("Account Disabled");

            case MsgE.Inactive:
                return("Account Inactive");

            case MsgE.Deleted:
                return("Account Deleted");

            case MsgE.Ban:
                return("'@p1' @p2");

            case MsgE.BlockIp:
                return("Your Ip is blocked");

            case MsgE.WrongIdPassowrd:
                return("Invalid User Name or Password");

            case MsgE.NoRoles:
                return("Can not sign in, not assigned any role.");

            case MsgE.Resign:
                return("'@p1' Resign");

            case MsgE.Abort:
                return("'@p1' Abort game");

            case MsgE.DrawAsked:
                return("Opponent Draw, Accept Offer");

            case MsgE.DrawDecline:
                return("Opponent Rejected Draw Offer");

            case MsgE.ErrorInvalidFileFormat:
                return("Invalid file format. Please provide valid database file.");

            case MsgE.InfoKickUser:
                return("'@p1' has been kicked off by Administrator");

            case MsgE.InfoSelectEngineForWhite:
                return("please select engine for White player.");

            case MsgE.InfoNotationError:
                return("Double Notation Error");

            case MsgE.InfoMated:
                TestDebugger.Instance.WriteInfo("============ MATED =====================");
                return("Mated.");

            case MsgE.InfoSelectNotation:
                return("Please select notation.");

            case MsgE.InfoEngineLoaded:
                return("Engine Loaded Successfully");

            case MsgE.InfoEngineExsist:
                return("Engine Already Exsist");

            case MsgE.InfoPlay:
                return("can't draw, please play.");

            case MsgE.ConfirmResetSetting:
                return("Reset all settings");

            case MsgE.ErrorEnterPassword:
                return("Please enter Password");

            case MsgE.ErrorPasswordLimit:
                return("Password should be atleast 5 characters");

            case MsgE.ErrorPasswordMismatch:
                return("Password Mismatch");

            case MsgE.InfoCommingShortly:
                return("Coming Shortly");

            case MsgE.ErrorEmptyOldPassword:
                return("Please enter old Password");

            case MsgE.ErrorWrongOldPassword:
                return("Old Password Incorrect");

            case MsgE.InfoUpdatePassword:
                return("Password updated successfully");

            case MsgE.ErrorUpdatePassword:
                return("Password not updated successfully");

            case MsgE.ErrorSpacing:
                return("Space not allowed");

            case MsgE.ErrorServerConnection:
                return("Unable to connect to server, please try again later");

            case MsgE.ErrorEmptyIdPassword:
                return("Please enter LoginId and Password");

            case MsgE.InfoUploadEngine:
                return("Please upload your engine");

            case MsgE.InfoCheckEmail:
                return("Please check your email address, Email has been sent on your email address.");

            case MsgE.ErrorChallangeYourself:
                return("Cannot challenge yourself");

            case MsgE.ErrorInvalidURL:
                return("Invalid URL");

            case MsgE.ErrorInvalidEmail:
                return("Invalid Email Address");

            case MsgE.InfoUserUpdate:
                return("User updated sucessfully");

            case MsgE.ErrorEnterUser:
                return("Please enter username");

            case MsgE.ErrorUciEngine:
                return("Can not create UCI engine, either engine already exists or loaded.");

            case MsgE.ErrorUserExsist:
                return("Username already exist");

            case MsgE.InfoLoginRule:
                return("Start with alphabet and only  a-z|A-Z|0-9|.|_  are allowed");

            case MsgE.ErrorImageRange:
                return("Image size not more than 200Kb");

            case MsgE.ErrorLoginIdRange:
                return("LoginId should be atleast 3 characters");

            case MsgE.InfoSelectEngineForBlack:
                return("please select engine for Black player.");

            case MsgE.ErrorEngineActive:
                return("Engine @p1 can not be inactive, it is use as default engine");

            case MsgE.ConfirmLoadDefaultPanes:
                return("Do you want to load default panes?");

            case MsgE.InfoCopyPosition:
                return("Copy : @p1");

            case MsgE.InfoPastePosition:
                return("Paste : @p1");

            case MsgE.InfoNewPosition:
                return("New positions : @p1");

            case MsgE.InfoKingStalem:
                return("Stalem.");

            case MsgE.ConfirmSaveChanges:
                return("Are you want to save the changes?");

            case MsgE.ConfirmAbortGame:
                return("Abort this game");

            case MsgE.ConfirmResignGame:
                return("Resign this game");

            case MsgE.ErrorBaned:
                return("You have been banned by the Administrator");

            case MsgE.ConfirmPlay:
                return("Do you want to play another game.");

            case MsgE.InfoNewGameOffer:
                return("Opponent Rejected New Game Offer");

            case MsgE.InfoBlockedUser:
                return("You are Blocked by administrator");

            case MsgE.ConfirmAccessMenubar:
                return("Press Ctrl + Alt + M to access menubar");

            case MsgE.ConfirmLogOff:
                return("Are you sure you want to logoff?");

            case MsgE.ConfirmStoreNormalView:
                return("To store normal view, press Ctrl + Alt + F");

            case MsgE.InfoRating:
                return("'@p1' has no Rating.");

            case MsgE.InfoBaned:
                return("You are banned from @p1 to @p2 by administrator");

            case MsgE.InfoProfile:
                return("'@p1' has no profile");

            case MsgE.ConfirmBanUser:
                return("Are you sure you want to ban '@p1'?");

            case MsgE.ErrorMessage:
                return("Error: @p1");

            case MsgE.ConfirmKickUser:
                return("Are you sure you want to kick off '@p1'?");

            case MsgE.ConfirmBlockIp:
                return("Are you sure you want to block IP of '@p1'?");

            case MsgE.ChallengePauseUser:
                return("'@p1' is paused you can not challenge");

            case MsgE.InfoKibitz:
                return("No match currently running");

            case MsgE.ErrorRoomChange:
                //return "Please close all game windows";
                return("Please close game window");

            case MsgE.ErrorViewUserPicture:
                return("Guest can not view picture");

            case MsgE.ErrorViewUserRating:
                return("Guest can not view rating");

            case MsgE.ErrorViewGuestPicture:
                return("Guest does not have a picture");

            case MsgE.ErrorViewGuestRating:
                return("Guest does not have rating");

            case MsgE.ErrorBannedForever:
                return("'@p1' banned forever");

            case MsgE.ErrorGuestAcceptChallenge:
                return("Guest can not accept rated challenge");

            case MsgE.ErrorUserNotExist:
                return("'@p1' not exist");

            case MsgE.InfoEmailSend:
                return("Email has been send successfully");

            case MsgE.ConfirmEmailDelete:
                return("Are you sure you want to delete email?");

            case MsgE.InfoAvChatRequested:
                return("Do you want to @p1 chat with '@p2'?");

            case MsgE.ErrorAvChatBusy:
                return("'@p1' is busy and already in chat with another user");

            case MsgE.ErrorAvChatDenied:
                return("'@p1' refused chat inivitation.");

            case MsgE.InfoNoAvService:
                return("Service is not available right now.");

            case MsgE.ConfirmClosedAllWindow:
                return("You are already logged in from other place, Are you sure you want to log off from there?");

            case MsgE.ErrorAvNoCamera:
                return("Camera is not present or not properly installed.");

            case MsgE.ErrorAvNoPlayer:
                return("Flash player 8 or higher is required.");

            case MsgE.ErrorUpgradeInProgress:
                return("Upgrade is already in progress.");

            case MsgE.InfoUpgradeNotRequired:
                return("Your program is up to date.");

            case MsgE.InfoUpgradeAvailable:
                return("Update is available. Are you sure you want to download?");

            case MsgE.InfoUpgradeDownloaded:
                return("Update is downloaded successfully and will be installed when you exit application.");

            case MsgE.AlreadyLogin:
                return("User '@p1' already logged in.");

            case MsgE.CardAlreadyCheckedout:
                return("Your card is already checked out.");

            case MsgE.CreditCardValid:
                return("Your card has been successfully checked in");

            case MsgE.VoucherInvalid:
                return("You voucher no. is not valid, Please try again");

            case MsgE.ErrorNoPatch:
                return("Installation package could not be found.");

            case MsgE.ConfirmBlockMachine:
                return("Are you sure you want to block machine of '@p1'?");

            case MsgE.InfoBlockMachine:
                return("Your machine is blocked.");

            case MsgE.ConfirmFlashInstall:
                return("Flash Player 8 or higher is required. Do you want to install it?");

            case MsgE.InfoFlashUrl:
                return(@"http://www.adobe.com/go/getflash");

            case MsgE.ErrorBlockMachine:
                return("Machine cannot be blocked.");

            case MsgE.ConfirmRestartSchedular:
                return("Are you sure you want to restart schedular?");

            case MsgE.ErrorBanReason:
                return("Please specify ban reason.");

            case MsgE.ErrorDatabaseLoadLastGameFailed:
                return("Load last game from database failed.");

            case MsgE.ErrorInvalidUciEngine:
                return("Engine: could not load");

            case MsgE.ConfirmTournamentWantinRequest:
                return("Your wantin request sent to admin for tournament '@p1'.");

            case MsgE.ErrorTournamentWantinRequest:
                return("You can not send wantin request. Please select team.");

            case MsgE.ConfirmTournamentSaved:
                return("'@p1' saved successfully.");

            case MsgE.ErrorTournamentInprogressUpdate:
                return("Tournament is in progress so it can not be updated.");

            case MsgE.ErrorTournamentName:
                return("Please enter tournament title.");

            case MsgE.ConfirmTournamentStarted:
                return("'@p1' started successfully.");

            case MsgE.ConfirmTournamentFinished:
                return("'@p1' finished successfully.");

            case MsgE.ConfirmTournamentMatchSaved:
                return("'@p1' created successfully");

            case MsgE.ConfirmTournamentMatchesSaved:
                return("'@p1' updated successfully");

            case MsgE.ErrorTournamentMultipleRounds:
                return("Multiple rounds can not be started simultaneously.");

            case MsgE.ErrorValidPrice:
                return("Please enter valid amount in prize '@p1'.");

            case MsgE.ErrorTournamentStartReminding:
                return("Tournament is scheduled, please start the tournament first in tournament detail form.");

            case MsgE.ErrorTournamentNextRoundStarted:
                return("Next round can not be created due to few matches result is pending");

            case MsgE.ErrorTournamentNextTournamentStarts:
                return("You can not start this tournament as another tournament '@p1' is in progress. Please contact tournament director ' @p2'");

            case MsgE.InfoSelectDatabaseFileForE2E:
                return("Please select target database file.");

            case MsgE.ErrorTournamentUserExist:
                return("Tournament '@p1' can not be started, please select at least @p2 players to start Tournament");

            case MsgE.ErrorBeforePlayFini:
                return("Rank must be Knight or greater to play for fini.");

            case MsgE.ErrorRoundStarts:
                return("Round can not be started due to inprogress matches.");

            case MsgE.ErrorMatchStarts:
                return("Matches can not be started due to pending results.");

            case MsgE.ErrorTournamentStartDate:
                return("Start date should be in 'mm/dd/yyyy' format.");

            case MsgE.ErrorTournamentStartTime:
                return("Start time should be in 'hh:mm AM/PM' format.");

            case MsgE.ErrorTournamentEndDate:
                return("End date should be in 'mm/dd/yyyy' format.");

            case MsgE.ErrorTournamentEndTime:
                return("End time should be in 'hh:mm AM/PM' format.");

            case MsgE.ConfirmFiniAccountUpdated:
                return("Your request has been submitted. An email is sent to your specified email address");

            case MsgE.InfoBanRemove:
                return("Ban removed successfully");

            case MsgE.ErrorFiniNotExist:
                return("Player '@p1' has no enough fini to play.");

            case MsgE.InfoGameNotFoundForTournamentMatch:
                return("Game information is not available for selected tournament match.");

            case MsgE.InfoUpdateTeamStatus:
                return("Team status updated successfully");

            case MsgE.ConfirmItemDelete:
                return("Are you sure, you want to delete @p1 ? ");

            case MsgE.ConfirmItemTask:
                return("Are you sure, you want to @p1 @p2 ? ");

            case MsgE.ErrorNoSelection:
                return("No @p1 is selected.");

            case MsgE.InfoNewsUpdate:
                return("News status updated successfully");

            case MsgE.ConversionCompleted:
                return("Conversion completed successfully");

            case MsgE.ConversionCancelled:
                return("Conversion cancelled on user request");

            case MsgE.ErrorWhiteAndBlackBye:
                return("Please select White and Black player");

            case MsgE.InfoUpdateRoom:
                return("Room status updated successfully");

            case MsgE.ErrorTieBreakMatchStart:
                return("Please select valid match for playing");

            case MsgE.ErrorEmptyRoomTitle:
                return("Please enter room title");

            case MsgE.ErrorEmptyTeamTitle:
                return("Please enter team title");

            case MsgE.ErrorEmptyNewsTitle:
                return("Please enter news title");

            case MsgE.InfoSaveTeam:
                return("Team saved successfully");

            case MsgE.InfoSaveRoom:
                return("Room saved successfully");

            case MsgE.InfoSaveNews:
                return("News saved successfully");

            case MsgE.ImportCancelled:
                return("Import cancelled on user request");

            case MsgE.InfoBanUser:
                return("User banned successfully");

            case MsgE.ErrorTournamentTypeChange:
                return("Tournament type can not be updated, please create new tournament.");

            case MsgE.ErrorSelectCheckBox:
                return("Please check at least one checkbox");

            case MsgE.InfoClearLogs:
                return("logs cleared successfully");

            case MsgE.SearchingCompleted:
                return("Searching completed successfully");

            case MsgE.SearchingCancelled:
                return("Searching cancelled successfully");

            case MsgE.ErrorServerMaintainceMode:
                return("Server is in maintaince mode. Please try again later after @p1 (Server Time)");

            case MsgE.ErrorTournamentUserStatus:
                return("Some Matches can not be started. Players is not available in tournament room.");

            case MsgE.InfoBestBiltzGameToKibitz:
                return("No Best Biltz game currently running");

            case MsgE.InfoUnBlockedIPs:
                return("Ips unblocked successfully");

            case MsgE.InfoRestartTournamentMatch:
                return("Match restarted by tournament director");

            case MsgE.ConfirmRestartTournamentMatch:
                return("Are you sure you want to restart match?");

            case MsgE.ErrorReplacePlayerSelection:
                return("Select only one player to replace.");

            case MsgE.ConfirmRescheduleTournament:
                return("'@p1' rescheduled successfully.");

            case MsgE.InfoSaveBlockedIP:
                return("IP blocked successfully");

            case MsgE.ErrorRescheduleTournament:
                return("Only inprogress tournament will be reschedule");

            case MsgE.InfoRescheduleTournament:
                return("Tournament rescheduled by tournament director");

            case MsgE.ResetMatchAsked:
                return("Opponent accept reset match offer");

            case MsgE.ResetMatchDecline:
                return("Opponent reject reset match offer");

            case MsgE.InfoTournamentAnnounce:
                return("Tournament '@p1' going to be scheduling, you are invited to join this tournament.");

            case MsgE.InfoAdminRevoked:
                return("Admin revoked.");

            case MsgE.InfoMakeAdmin:
                return("Admin created.");

            case MsgE.ErrorRestartGameTime:
                return("Game time can not be exceeded to tournament match time.");

            case MsgE.ErrorTournamentPlayerReplaceUser:
                return("Tournament player can not be replaced.");

            case MsgE.InfoRestartTournamentGame:
                return("Select Move to restart match.");

            case MsgE.ConfirmRestartTournamentGame:
                return("Are you agree to restart match with these moves and time. If Yes, Press 'Ok' or 'Cancel' to resume.");

            case MsgE.InfoUserLeftRoom:
                return("'@p1' has left room '@p2'");

            case MsgE.InfoUserEnteredRoom:
                return("'@p1' has entered in room '@p2'");

            case MsgE.ErrorTournamentMultipleMatchSelection:
                return("Please select one match to restart match with setup.");

            case MsgE.InfoResetTournamentGame:
                return("Tournament Match is restarted with setup");

            case MsgE.ErrorTournamentMatchNotInprogress:
                return("Tournament match is not in progress");

            case MsgE.ErrorTournamentMatchRestart:
                return("Please select tournament matches to restart.");

            case MsgE.InfoTournamentMatchStarted:
                return("Tournament match restarted.");

            case MsgE.ErrorTournamentTeamCount:
                return("The no. of Players in team are not equal.");

            case MsgE.InfoTournamentMatchRestartRequest:
                return("Restart Match Request Sent.");

            case MsgE.InfoTournamentMatchRequestDecline:
                return("Opponent has decline restart match offer");

            case MsgE.ErrorTournamentMatchStartRequest:
                return("Please select tournament matches to start.");

            case MsgE.ErrorTournamentChessTypeChange:
                return("Tournament Chess Type can not be updated.");

            case MsgE.ErrorMultipleItemsNotAllowed:
                return("This operation could only perform on single item, please select one item.");

            case MsgE.ErrorTournamentMatchNotInStatus:
                return("Tournament match is not '@p1'.");

            case MsgE.ConfirmPatchSizeDownload:
                return("Upgrade size is @p1, while new setup size is @p2. Are you sure you want to download the upgrade?");

            default:
                break;
            }
            return("");
        }
Exemplo n.º 8
0
 public static DialogResult Error(Form owner, MsgE msgId, params object[] vals)
 {
     return(Show2(owner, msgId, MessageBoxButtons.OK, MessageBoxIcon.Error, vals));
 }
Exemplo n.º 9
0
 public static DialogResult Show(Form owner, MsgE msgId)
 {
     return(Show(owner, msgId, MessageBoxButtons.OK, MessageBoxIcon.Information));
 }
Exemplo n.º 10
0
 public static DialogResult Show(Form owner, MsgE msgId, MessageBoxButtons buttons, MessageBoxIcon icon)
 {
     return(Show2(owner, msgId, buttons, icon));
 }
Exemplo n.º 11
0
 public static DialogResult Confirm(Form owner, MsgE msgId, params object[] vals)
 {
     return(Confirm(owner, Msg.GetMsg(msgId, vals)));
 }
Exemplo n.º 12
0
 public static void Write(ChatTypeE receiverType, ChatMessageTypeE type, ChatTypeE chatType, MsgE message, int gameId)
 {
     ChatClient.Instance.WriteLine(receiverType, type, chatType, message, gameId);
 }
Exemplo n.º 13
0
 // write on your chat window
 private void WriteLine(ChatTypeE receiverType, ChatMessageTypeE type, ChatTypeE chatType, MsgE message, int gameId)
 {
     Write(receiverType, type, chatType, Msg.GetMsg(message), gameId);
 }