private async Task <bool> LoadMyConsultant()
        {
            // get client session need ung username
            ClientSession cliSession = SessionFactory.ReadSession <ClientSession>(SessionKeys.LoggedClient);

            //TODO CUSTOM SESSION EXCEPTION
            // Dapat kasi point na to, naload na ung sesion. pag di pa, baka may connection issue na, so relogin
            if (cliSession == null || !cliSession.IsSet)
            {
                throw new Exception("Session has been lost. Please sign in again to continue...");
            }

            MyConsultant = await conService.GetConsultantByClientId(cliSession.ClientId);

            // if there is a consultant, true
            return(MyConsultant != null);
        }
Ejemplo n.º 2
0
        public async Task LoadHeadInfo()
        {
            // get client session need ung username
            ClientSession cliSession = SessionFactory.ReadSession <ClientSession>(SessionKeys.LoggedClient);

            //TODO CUSTOM SESSION EXCEPTION
            // Dapat kasi point na to, naload na ung sesion. pag di pa, baka may connection issue na, so relogin
            if (cliSession == null || !cliSession.IsSet)
            {
                throw new Exception("Session has been lost. Please sign in again to continue...");
            }

            Consultant consultant = await conService.GetConsultantByClientId(cliSession.ClientId);

            string name = $"{consultant?.FirstName} {consultant?.LastName}";

            view.DisplayHeadInfo(name, consultant?.Username);
        }