Ejemplo n.º 1
0
        public void GotoOtherDetailsView()
        {
            CurrentViewLbl.Text = "Other details";
            var data = ControlsFactory.Resolve <OtherDetailsView>();

            data.Revalidate();
            OnControlChanged(data);
        }
Ejemplo n.º 2
0
        public void GotoRecords()
        {
            CurrentViewLbl.Text = "Records";
            var data = ControlsFactory.Resolve <RecordsView>();

            data.Revalidate();
            OnControlChanged(data);
        }
Ejemplo n.º 3
0
        public void GotoAccounts()
        {
            CurrentViewLbl.Text = "Accounts";
            var data = ControlsFactory.Resolve <AccountsView>();

            data.Revalidate();

            OnControlChanged(data);
        }
Ejemplo n.º 4
0
        public void GotoEvents()
        {
            CurrentViewLbl.Text = "Events";
            var data = ControlsFactory.Resolve <EventsFullView>();

            data.Revalidate();

            OnControlChanged(data);
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
        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);
            });
        }
Ejemplo n.º 7
0
        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);
            });
        }
Ejemplo n.º 8
0
        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();
        }
Ejemplo n.º 9
0
 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;
     }
 }
Ejemplo n.º 10
0
        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);
            }
        }
Ejemplo n.º 11
0
        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;
            }
        }
Ejemplo n.º 12
0
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            var cf = ControlsFactory.Resolve <ForgotPassword>();

            cf.ShowDialog();
        }