// Providers Login Btn public void CustomizeProvidersLoginBtnRectTransform <T>(T value, CustomizerDelegate <RectTransform, T> customizerDelegate) { SignInPanel signinPanel = m_MainController.GetComponentInChildren <SignInPanel>(); AccountPanel accountPanel = m_MainController.GetComponentInChildren <AccountPanel>(); // buttons in signin panel (email and anonymous sign in) foreach (GameObject obj in signinPanel.genericProviderButtonsList) { CustomizeComponent(obj.GetComponent <RectTransform>(), value, customizerDelegate); } // providers button foreach (var provider in PlayerIdentityManager.Current.loginProviders) { CustomizeComponent(provider.GetButton().GetComponent <RectTransform>(), value, customizerDelegate); } // we only customize all the prefabs and not the instantiated providers button // we dont need this call only on playmode since the providers button are only instantiated during runtime if (EditorApplication.isPlaying) { signinPanel.ReBuildProvidersList(); accountPanel.UpdatePanel(); } }
public void SwitchEditorPanels() { SalesView.Visible = ManagerList.Visible = SalesPanel.VisibleDock(!EditorMode.Value, ToolsPanel); AccountsView.Visible = AccountPanel.VisibleDock(EditorMode.Value, ToolsPanel); AccountPanel.AnimationTime = SalesPanel.AnimationTime = 0; AccountPanel.Expanded = SalesPanel.Expanded = false; AccountPanel.AnimationTime = SalesPanel.AnimationTime = 250; AccountPanel.Expanded = SalesPanel.Expanded = true; }
private void MainForm_Load(object sender, EventArgs e) { avtButton.BackgroundImageLayout = ImageLayout.Stretch; //guna2CircleButton1.BackgroundImageLayout = ImageLayout.Stretch; AccountPanel.Height = 0; AccountPanel.BringToFront(); timer2.Start(); label1.Font = new Font("Kids", 14, FontStyle.Bold); }
public void AnimateContentPanelWidth(double oldWidth, double newWidth) { DoubleAnimation da = new DoubleAnimation(oldWidth, newWidth, TimeSpan.FromSeconds(0.2)) { AccelerationRatio = 0, DecelerationRatio = 1, }; AccountPanel.BeginAnimation(WidthProperty, da); }
public bool CheckAllFields() { foreach (Control ctrl in AccountPanel.GetAllControls()) { if (ctrl is TextBoxX && (ctrl.Text == "" || ctrl.Text == ctrl.Name)) { return(false); } } return(true); }
public void InitializeMainFormEvents() { this.FormClosing += (_, e) => { LogOut(); SplashScreen.Instance.Close(); }; MainSlidePanel.IsOpen = false; EditorMode.Visible = false; ManagerList.Visible = false; AccountsView.Visible = false; LoginRegisterSlider.Visible = false; LoginRegisterSlider.IsOpen = false; MainSlidePanel.Visible = false; LoginSplitter.ExpandedChanged += (_, e) => { AccountStatus.Visible = AccountStatusLabel.Visible = !LoginSplitter.Expanded; if (LoginSplitter.Expanded) { AccountPanel.VisibleDock(true, RegisterPanel); RegisterButton.Text = "Register"; } }; EditorMode.ValueChanging += (_, e) => { ManagerList.Text = ""; ManagerList.Items.Clear(); foreach (var account in AccountsList.Keys) { if (!IsAdmin(account)) { ManagerList.Items.Add(account); } } MainStatusPanel.Visible = !EditorMode.Value; SwitchEditorPanels(); if (AccountsView.Visible) { ResetSalesData(); ShowAccounts(); } }; RenameProduct.Click += (_, e) => { ButtonCodesReturn(RenameProduct.Text); }; DeleteProduct.Click += (_, e) => { ButtonCodesReturn(DeleteProduct.Text); }; }
private void OpenChildForm(Form childForm, object btnSender) { if (activeForm != null) { activeForm.Close(); } ActivateButton(btnSender); activeForm = childForm; childForm.TopLevel = false; childForm.FormBorderStyle = FormBorderStyle.None; childForm.Dock = DockStyle.Fill; this.panelDesktopPane.Controls.Add(childForm); this.panelDesktopPane.Tag = childForm; childForm.BringToFront(); childForm.Show(); labelTitle.Text = childForm.Text; AccountPanel.BringToFront(); }
public void VerifyMailSentCorrectly(Mail mail) { AccountPanel accountPanel = new AccountPanel(driver); new MainPage(driver).Login(email, password); accountPanel.VerifyLogin(); accountPanel .NavigateMailPage() .CreateNewMail(mail) .CloseMailDialog() .VerifyMailPresentInDraftFolder(mail) .VerifyMailContentInDraftFolder(mail) .SendMail() .VerifyMailPresentInDraftFolder(mail) .VerifyMailPresentInSentFolder(mail); accountPanel.Logoff(); }
public void LogOut() { if (!IsAdmin(CurrentUser)) { SetUserStatus(CurrentUser, "Offline"); } if (NotSaved) { if (MessageBoxEx.Show("Save your work or not?", "Save", MessageBoxButtons.YesNo) == DialogResult.Yes) { DatabaseSave(); } } AccountsView.ResetDataGridView(); SalesView.ResetDataGridView(); ManagerNameLabel.Text = "JJETSystems"; StatusLabel.Text = DateTime.Now.ToLongDateString(); AccountPanel.VisibleDock(true, RegisterPanel); RegisterButton.Text = "Register"; }
public void ShowAccountPanel(AccountPanel type) { HideAllAccountPanel(); switch (type) { case AccountPanel.LoginOrRegister: LoginOrRegisterPanel.SetActive(true); break; case AccountPanel.Login: LoginPanel.SetActive(true); break; case AccountPanel.Register: RegisterPanel.SetActive(true); break; case AccountPanel.Disabled: EnternPanel.SetActive(true); break; } }
private void AccountButton_Click(object sender, EventArgs e) { sidepanel_movement(AccountButton); AccountPanel.BringToFront(); }
public void ButtonCodesReturn(string buttonCode) { switch (buttonCode) { case "Enter Here": LoginRegisterSlider.Visible = true; EnterHere.Visible = false; LoginRegisterSlider.OpenBounds = new Rectangle(this.Width - (LoginRegisterSlider.Width + 15), 3, LoginRegisterSlider.Width, this.DisplayRectangle.Height - StatusPanel.Height); LoginRegisterSlider.IsOpen = true; break; case "Exit Login": LoginRegisterSlider.IsOpen = false; EnterHere.Visible = true; break; case "Log Out": LogOut(); ButtonCodesReturn("Exit Login"); MainSlidePanel.IsOpen = MainStatusPanel.Visible = false; StatusPanel.Parent = this; DateTimeLabel.Visible = true; break; case "Login": if (Username.Text != "" && Password.Text != "") { var user = Username.Text; var pass = Password.Text; GetAllAccounts(); if (IsAccountExist(user)) { if (RetryCount > 0 && RefreshRetryTimer() <= 0) { if (AccountsList[user.ToLower()] == pass) { if (CheckUserStatus(user) || CheckUserStatus(user, "admin")) { ShowManagersSales.Visible = DateTimeLabel.Visible = LoginRegisterSlider.IsOpen = ManagerList.Visible = AccountsView.Visible = EditorMode.VisibleDock(false, ToolsPanel); MainStatusPanel.Visible = true; CurrentAdmin = ""; AccountPanel.VisibleDock(false, ToolsPanel); if (IsAdmin(user)) { CurrentAdmin = user; EditorMode.VisibleDock(true, ToolsPanel, DockStyle.Top); EditorMode.SetValueAndAnimate(true, eEventSource.Code); } else { SalesView.Visible = SalesPanel.VisibleDock(true, ToolsPanel); EditorMode.VisibleDock(false, ToolsPanel); SetUserStatus(user, "Online"); SetSalesDataSet(user, this); } MainSlidePanel.OpenBounds = new Rectangle(0, 0, this.DisplayRectangle.Width, this.DisplayRectangle.Height); MainSlidePanel.IsOpen = true; StatusPanel.Parent = MainSlidePanel; ManagerNameLabel.Text = $"{user} | {AccountTable.Rows.Find(user)["ManagerName"].ToString()}"; foreach (Control c in this.GetAllControls()) { if (c is TextBoxX) { c.Text = ""; } } } else { ToastNotification.Show(LoginPanel, $"{user} has already logged in"); } } else { ToastNotification.Show(LoginPanel, $"Invalid Password: Retries Left {RetryCount--}"); } } else { if (!RetryTimer.Enabled) { File.WriteAllText("Penalty.txt", DateTime.Now.AddMinutes(RetryTimes++).ToString()); RefreshRetryTimer(); } } } else { ToastNotification.Show(LoginPanel, $"{user} not registered"); } } else { ToastNotification.Show(LoginPanel, "Input all fields"); } break; case "Register": GetAllAccounts(); if (!IsAccountExist(AccountUsername.Text)) { if (CheckAllFields()) { ToastNotification.Show(this, $"Registered: {AccountUsername.Text}"); AccountTable.Rows.Add(AccountUsername.Text, AccountPassword.Text, AccountManagerName.Text, AccountSecretQuestion.Text, AccountSecretAnswer.Text, "Offline"); GetAllAccounts(); foreach (Control c in this.GetAllControls()) { if (c is TextBoxX) { c.Text = ""; } } if (AccountStatus.Visible) { ShowAccounts(); ToastNotification.Show(this, "Reverting back to edit mode"); } } else { ToastNotification.Show(this, "Input all Fields"); } } else { ToastNotification.Show(this, $"Account Already Registered: {AccountUsername.Text}"); } break; case "Create Account Mode": AccountControls.ClearBindings(); AccountUsername.Enabled = AccountStatus.Enabled = true; foreach (Control c in AccountPanel.GetAllControls()) { if (c is TextBoxX) { c.Text = ""; } } RegisterButton.Text = "Register"; ToastNotification.Show(this, "Create Account Mode activated please enter credentials on the blank fields then press register"); break; case "Forgot Password": if (Username.Text == "") { ToastNotification.Show(LoginPanel, "Enter a registered account then click this again"); return; } var rows = AccountTable.Select($"Username='******'"); if (rows.Length != 0) { var row = rows[0]; var renameVal = ""; var RenameInputBox = new MetroForm(); RenameInputBox.Height = 150; RenameInputBox.Width = 250; RenameInputBox.StartPosition = FormStartPosition.CenterScreen; RenameInputBox.FormBorderStyle = FormBorderStyle.FixedToolWindow; RenameInputBox.MaximizeBox = false; RenameInputBox.Controls.Add(new LabelX { AutoSize = true, Name = "ForgotPass", Text = row["SecretQuestion"].ToString(), Location = new Point(10, 10) }); RenameInputBox.Controls.Add(new TextBoxX { Size = new Size(200, 100), PasswordChar = '*', AutoSize = true, Name = "InputField", Location = new Point(10, 30) }); RenameInputBox.Controls.Add(new ButtonX { AutoSize = true, Name = "Submit", Text = "Submit", Location = new Point(10, 60) }); RenameInputBox.Text = "Forgot Password"; RenameInputBox.GetControl <ButtonX>("Submit").Click += (_, ee) => { renameVal = RenameInputBox.GetControl <TextBoxX>("InputField").Text; RenameInputBox.Close(); }; RenameInputBox.ShowDialog(); var answerCheck = renameVal == row["SecretAnswer"].ToString(); ToastNotification.Show(LoginPanel, answerCheck ? $"Your password is: {row["Password"].ToString()}" : RetryCount > 0 ? $"Invalid Secret Answer: Retries Left {RetryCount--}" : "Invalid Secret Answer: PENALTY!"); if (RetryCount <= 0 && !answerCheck && !RetryTimer.Enabled) { File.WriteAllText("Penalty.txt", DateTime.Now.AddMinutes(RetryTimes++).ToString()); RefreshRetryTimer(); } if (answerCheck) { Password.Text = row["Password"].ToString(); } } else { ToastNotification.Show(LoginPanel, $"{Username.Text} doesn't exist"); } break; case "Save Changes": if (SalesView.Visible) { DatabaseSave(); } if (AccountsView.Visible) { GetAllAccounts(); ToastNotification.Show(AccountsView, "Saved changes to accounts"); } break; case "Rename Product": if (SalesView.ReadOnly) { ToastNotification.Show(this, ($"Can't rename the product because you are on viewing mode only")); return; } DataColumn col = CurrentTable.Columns[SelectedProduct.Text]; if (col == null) { ToastNotification.Show(this, "No selected product"); return; } if (SelectedProduct.Text == "Rename Agent") { ToastNotification.Show(this, ($"Can't rename the agent fields: {SelectedProduct.Text}")); return; } var newName = ""; var InputBox = new MetroForm(); InputBox.Height = 150; InputBox.Width = 250; InputBox.StartPosition = FormStartPosition.CenterScreen; InputBox.FormBorderStyle = FormBorderStyle.FixedToolWindow; InputBox.MaximizeBox = false; InputBox.Controls.Add(new LabelX { AutoSize = true, Name = "ForgotPass", Text = $"Enter New Name for {SelectedProduct.Text}", Location = new Point(10, 10) }); InputBox.Controls.Add(new TextBoxX { Size = new Size(200, 100), AutoSize = true, Name = "InputField", Location = new Point(10, 30) }); InputBox.Controls.Add(new ButtonX { AutoSize = true, Name = "Submit", Text = "Submit", Location = new Point(10, 60) }); InputBox.Text = "Rename Product"; InputBox.GetControl <ButtonX>("Submit").Click += (_, ee) => { newName = InputBox.GetControl <TextBoxX>("InputField").Text; InputBox.Close(); }; InputBox.ShowDialog(); if (CurrentTable.Columns.Contains(newName)) { ToastNotification.Show(this, $"{newName} already exist in the sales"); return; } if (newName == "") { ToastNotification.Show(this, "No value has been set"); return; } col.ColumnName = newName; SetSalesView(); NotSaved = true; break; case "Delete Product": if (SalesView.ReadOnly) { ToastNotification.Show(this, ($"Can't delete the product because you are on viewing mode only")); return; } if (SelectedProduct.Text == "Rename Agent") { ToastNotification.Show(this, ($"Can't delete the agent field: {SelectedProduct.Text}")); return; } if (!CurrentTable.Columns.Contains(SelectedProduct.Text)) { ToastNotification.Show(this, ($"Sales doesn't contain this product: {SelectedProduct.Text}")); return; } if (MessageBoxEx.Show($"Are you sure you want to delete: {SelectedProduct.Text} ?", "Delete Column", MessageBoxButtons.YesNo) == DialogResult.Yes) { CurrentTable?.DeleteColumns(SelectedProduct.Text); SetSalesView(); NotSaved = true; } break; case "Show Sales Range": if (CurrentTable == null) { ToastNotification.Show(this, "You have not selected a manager"); return; } StatusLabel.Text = $"{GetSalesDateRange()}"; break; case "Rename Agent": if (SalesView.CurrentCell == null) { return; } var selectedAgent = SalesView.CurrentCell.Value.ToString(); if (selectedAgent == "Total Sales") { return; } if (MessageBoxEx.Show($"Do you want to rename the selected agent : {selectedAgent}", "Rename Agent", MessageBoxButtons.YesNo) == DialogResult.Yes) { var newAgentName = ""; var AgentBox = new MetroForm(); AgentBox.Height = 150; AgentBox.Width = 250; AgentBox.StartPosition = FormStartPosition.CenterScreen; AgentBox.FormBorderStyle = FormBorderStyle.FixedToolWindow; AgentBox.MaximizeBox = false; AgentBox.Controls.Add(new LabelX { AutoSize = true, Name = "ForgotPass", Text = $"Enter New Name for {SelectedProduct.Text} : {selectedAgent}", Location = new Point(10, 10) }); AgentBox.Controls.Add(new TextBoxX { Size = new Size(200, 100), AutoSize = true, Name = "InputField", Location = new Point(10, 30) }); AgentBox.Controls.Add(new ButtonX { AutoSize = true, Name = "Submit", Text = "Submit", Location = new Point(10, 60) }); AgentBox.Text = "Rename Agent"; AgentBox.GetControl <ButtonX>("Submit").Click += (_, ee) => { newAgentName = AgentBox.GetControl <TextBoxX>("InputField").Text; AgentBox.Close(); }; AgentBox.ShowDialog(); if (CurrentTable.Rows.Contains(newAgentName)) { ToastNotification.Show(this, $"{newAgentName} already exist in the sales agent list"); return; } if (newAgentName == "") { ToastNotification.Show(this, "No value has been set"); return; } SalesView.CurrentCell.Value = newAgentName; ToastNotification.Show(this, $"Renamed {selectedAgent} to {newAgentName}"); SetSalesView(); NotSaved = true; } break; case "Show Managers Sales": if (CurrentAdmin == "") { return; } SetSalesDataSet(CurrentAdmin, this); MainStatusPanel.Visible = false; break; /* case "Print": * var salesReport = new CrystalSalesReport(); * var salesReportViewer = new CrystalReportViewer(); * salesReport.Database.Tables[0].SetDataSource(); * salesReport.Refresh(); * salesReportViewer.Parent = this; * salesReportViewer.Dock = DockStyle.Fill; * salesReportViewer.ReportSource = salesReport; * salesReportViewer.Refresh(); * salesReportViewer.RefreshReport(); * salesReportViewer.Show(); * break; */ } }
void Awake() { AudioListener.volume = 0.0f; //DontDestroyOnLoad(this.gameObject); GameObject UIRoot = GameObject.Find("UI Root"); AccountPanel = NGUITools.AddChild(UIRoot, Resources.Load("Prefabs/UI/AccountPanel") as GameObject); GameReadyPanel = NGUITools.AddChild(UIRoot, Resources.Load("Prefabs/UI/GameReadyPanel") as GameObject); GameEndPanel = NGUITools.AddChild(UIRoot, Resources.Load("Prefabs/UI/GameEndPanel") as GameObject); GuildManagementPanel = NGUITools.AddChild(UIRoot, Resources.Load("Prefabs/UI/GuildManagementPanel") as GameObject); HeadHunterCenterPanel = NGUITools.AddChild(UIRoot, Resources.Load("Prefabs/UI/HeadHunterCenterPanel") as GameObject); LobbyPanel = NGUITools.AddChild(UIRoot, Resources.Load("Prefabs/UI/LobbyPanel") as GameObject); StageListPanel = NGUITools.AddChild(UIRoot, Resources.Load("Prefabs/UI/StageListPanel") as GameObject); ShopPanel = NGUITools.AddChild(UIRoot, Resources.Load("Prefabs/UI/ShopPanel") as GameObject); MuhanPanel = NGUITools.AddChild(UIRoot, Resources.Load("Prefabs/UI/MuhanPanel") as GameObject); SettingPanel = NGUITools.AddChild(UIRoot, Resources.Load("Prefabs/UI/SettingPanel") as GameObject); Account = AccountPanel.GetComponent<AccountPanel>(); GameReady = GameReadyPanel.GetComponent<GameReadyPanel>(); GameEnd = GameEndPanel.GetComponent<GameEndPanel>(); GuildManagement = GuildManagementPanel.GetComponent<GuildManagementPanel>(); HeadHunterCenter = HeadHunterCenterPanel.GetComponent<HeadHunterCenterPanel>(); Lobby = LobbyPanel.GetComponent<LobbyPanel>(); StageList = StageListPanel.GetComponent<StageListPanel>(); Shop = ShopPanel.GetComponent<ShopPanel>(); Muhan = MuhanPanel.GetComponent<MuhanPanel>(); Setting = SettingPanel.GetComponent<SettingPanel>(); //savedAccountData = new ClientSaveData(); //savedAccountData.Save(); if (!windows.ContainsKey(ID.ACCOUNT_INFO)) { windows.Add(ID.ACCOUNT_INFO, Account); windows.Add(ID.GAME_READY, GameReady); windows.Add(ID.GAME_END, GameEnd); windows.Add(ID.GUILD_MANAGEMENT, GuildManagement); windows.Add(ID.HEADHUNTER_CENTER, HeadHunterCenter); windows.Add(ID.LOBBY, Lobby); windows.Add(ID.STAGE_LIST, StageList); windows.Add(ID.STORE, Shop); windows.Add(ID.MUHAN, Muhan); windows.Add(ID.CONFIG, Setting); } //Initialize temp;; if (!GameManager.firstInit) { GameObject.Find("GameManager").GetComponent<GameManager>().InitParty(); GameManager.firstInit = true; } GuildManagement.Init(); GameReady.Hide(); GameEnd.Hide(); GuildManagement.Hide(); HeadHunterCenter.Hide(); Lobby.Hide(); StageList.Hide(); Shop.Hide(); Muhan.Hide(); Setting.Hide(); if(GameManager.lobbyin) { if (GameManager.quest_num == 1000) { gotoMuhan(); GameManager.lobbyin = false; } else { gotoStagelist(); GameManager.lobbyin = false; } } else { //ChangeScene(ID.LOBBY); gotoLobby(); } AndroidAdmob.Get().Init(); }
void Start() { DontDestroyOnLoad(gameObject); myAccount = GetComponent <AccountPanel>(); }