public void GotoOtherDetailsView() { CurrentViewLbl.Text = "Other details"; var data = ControlsFactory.Resolve <OtherDetailsView>(); data.Revalidate(); OnControlChanged(data); }
public void GotoRecords() { CurrentViewLbl.Text = "Records"; var data = ControlsFactory.Resolve <RecordsView>(); data.Revalidate(); OnControlChanged(data); }
public void GotoAccounts() { CurrentViewLbl.Text = "Accounts"; var data = ControlsFactory.Resolve <AccountsView>(); data.Revalidate(); OnControlChanged(data); }
public void GotoEvents() { CurrentViewLbl.Text = "Events"; var data = ControlsFactory.Resolve <EventsFullView>(); data.Revalidate(); OnControlChanged(data); }
private async void button5_Click(object sender, EventArgs e) { ControlsFactory.ShellView.Controls.Clear(); var loginview = ControlsFactory.Resolve <LoginView>(); loginview.Dock = DockStyle.Fill; ControlsFactory.ShellView.Controls.Add(loginview); await HealthCenterService.SetLogoutTime(AccountContextService.LastLogId, DateTime.Now); }
private void toolStripButton1_Click(object sender, EventArgs e) { var pg = ControlsFactory.Resolve <ManageAccountPage>(); var data = new Account(); pg.GetModelData(data); DialogActivator.OpenDialog(pg, "New account detail", () => { HealthCenterService.CreateAccount(data); }); }
private void toolStripButton2_Click(object sender, EventArgs e) { var pg = ControlsFactory.Resolve <ManageCategoryPage>(); var data = new PersonCategory(); pg.GetModelData(data); DialogActivator.OpenDialog(pg, "New Category", () => { HealthCenterService.CreateCategory(data); }); }
public void ReValidate() { var EventsFullView = ControlsFactory.Resolve <EventsFullView>(); var RecordsView = ControlsFactory.Resolve <RecordsView>(); var AccountsView = ControlsFactory.Resolve <AccountsView>(); var OtherDetailsView = ControlsFactory.Resolve <OtherDetailsView>(); EventsFullView.Revalidate(); RecordsView.Revalidate(); AccountsView.Revalidate(); AccountsView.Revalidate(); }
private void dtgvailment_CellClick(object sender, DataGridViewCellEventArgs e) { switch (e.ColumnIndex) { case 0: var pg = ControlsFactory.Resolve <ManageAilmentPage>(); var data = (Ailments)AilmentListBinding.Current; pg.GetModelData(data); DialogActivator.OpenDialog(pg, "Modify Ailment", () => { HealthCenterService.ModifyAilment(data); }); break; } }
private async void Login() { var data = await HealthCenterService.Login(txt_UserName.Text, Txt_Password.Text); if (data != null) { if (data.AccountStatus == AccountStatus.Active) { var lastLogId = await HealthCenterService.CreateAccountLog(new AccountLogs { AccountId = data.Id }); AccountContextService.SetAccount(data, lastLogId); ControlsFactory.ShellView.Controls.Clear(); var nav = ControlsFactory.Resolve <NavigationView>(); AccessTypeHandler.SetType(data.Type); nav.ReValidate(); if (data.Type != AccountType.Administrator) { nav.button3.Visible = false; } else { nav.button3.Visible = true; nav.button3.Enabled = true; } nav.AccountType = data.Type; nav.Dock = DockStyle.Fill; ControlsFactory.ShellView.Controls.Add(nav); } else { MessageBox.Show("Account inactive.. please contact administrator", "Access denied!"); } } else { MessageBox.Show("Access denied", "Login Failed", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void dtgvAcc_CellClick(object sender, DataGridViewCellEventArgs e) { var data = (Account)AccountListBinding.Current; switch (e.ColumnIndex) { case 0: AccountLogsListBinding.DataSource = data.Logs.ToList(); dtgvlogs.DataSource = AccountLogsListBinding; break; case 1: var pg = ControlsFactory.Resolve <ManageAccountPage>(); pg.GetModelData(data); DialogActivator.OpenDialog(pg, "New account detail", () => { HealthCenterService.ModifyAccount(data); }); break; } }
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { var cf = ControlsFactory.Resolve <ForgotPassword>(); cf.ShowDialog(); }