public Task <bool> NavigateAsync(string key, IDictionary <string, string> parameters = null)
        {
            switch (key)
            {
            case "default":
            {
                var page = new EmbeddingPage
                {
                    BindingContext = new EmbeddingPageViewModel(this)
                };
                var fragment = page.CreateSupportFragment(this);

                var tx = SupportFragmentManager.BeginTransaction();
                tx.Replace(Resource.Id.pageContainer, fragment);
                tx.Commit();
            }
                return(Task.FromResult(true));

            case "end_of_walkthrough":
            {
                var fragment = new SessionsFragment();
                var tx       = SupportFragmentManager.BeginTransaction();
                tx.Replace(Resource.Id.pageContainer, fragment);
                tx.CommitNow();

                toolbar.Visibility = Android.Views.ViewStates.Visible;
                UpdatePageTitle();
            }
                return(Task.FromResult(true));

            case "view_session_details":
            {
                var item = new SessionDetailModel
                {
                    Title       = parameters[nameof(SessionDetailModel.Title)],
                    Description = parameters[nameof(SessionDetailModel.Description)],
                    ImageUrl    = parameters[nameof(SessionDetailModel.ImageUrl)]
                };
                var detailPage = new SessionsDetailsPage
                {
                    BindingContext = new SessionDetailsViewModel(item)
                };
                var detailFragment = detailPage.CreateSupportFragment(this);

                var tx = SupportFragmentManager.BeginTransaction();
                tx.Add(Resource.Id.pageContainer, detailFragment, key);
                tx.CommitNow();

                SupportActionBar.SetDisplayHomeAsUpEnabled(true);
                UpdatePageTitle();
            }

                return(Task.FromResult(true));
            }

            return(Task.FromResult(false));
        }
Пример #2
0
        public IActionResult Detail(int id)
        {
            var session = _sessionService.GetById(id);

            var model = new SessionDetailModel
            {
                Id                 = id,
                Name               = session.SessionName,
                SessionImageUrl    = session.SessionImageUrl,
                Description        = session.SessionDescription,
                ClassPriceNoMember = session.ClassPriceNoMember,
                ClassPriceMember   = session.ClassPriceMember,
            };

            return(View(model));
        }
Пример #3
0
        public async Task UpdateSessionAsync(SessionDetailModel Session, List <SpeakerHasSessionModel> Speakers)
        {
            var entity = await DbContext.Session.FirstOrDefaultAsync(s => s.IdSession == Session.IdSession);

            entity.Name           = Session.Name;
            entity.StartDate      = Session.StartDate;
            entity.EndDate        = Session.EndDate;
            entity.Description    = Session.Description;
            entity.IconLink       = Session.IconLink;
            entity.IdSessionLevel = Session.IdSessionLevel;
            entity.IdSessionType  = Session.IdSessionType;

            await DbContext.SaveChangesAsync();

            var entitySpeakerHasSession = new SpeakerHasSession()
            {
                IdSession = Session.IdSession
            };
        }
Пример #4
0
        public async Task InsertSessionAsync(SessionDetailModel Session, List <SpeakerListModel> Speakers)
        {
            var entity = new Session()
            {
                Name           = Session.Name,
                StartDate      = Session.StartDate,
                EndDate        = Session.EndDate,
                Description    = Session.Description,
                IconLink       = Session.IconLink,
                IdSessionLevel = Session.IdSessionLevel,
                IdSessionType  = Session.IdSessionType
            };

            DbContext.Session.Add(entity);
            await DbContext.SaveChangesAsync();

            await DbContext.Entry(entity).GetDatabaseValuesAsync();

            int IdS = entity.IdSession;

            Console.WriteLine("-------------------------");
            Console.WriteLine(IdS);

            foreach (var s in Speakers)
            {
                var speakatsession = new SpeakerHasSession()
                {
                    IdSpeaker = s.IdSpeaker,
                    IdSession = IdS
                };

                Console.WriteLine(speakatsession.IdSession + " - " + speakatsession.IdSpeaker);

                await DbContext.SpeakerHasSession.AddAsync(speakatsession);

                await DbContext.SaveChangesAsync();
            }
        }
Пример #5
0
        public async Task <SessionDetailModel> GetSessionByIdAsync(int IdSession)
        {
            SessionDetailModel session = await DbContext.Session.Select(
                s => new SessionDetailModel
            {
                IdSession        = s.IdSession,
                Name             = s.Name,
                StartDate        = s.StartDate,
                EndDate          = s.EndDate,
                Description      = s.Description,
                IconLink         = s.IconLink,
                IdSessionLevel   = s.IdSessionLevelNavigation.IdSessionLevel,
                NameSessionLevel = s.IdSessionLevelNavigation.Name,
                IdSessionType    = s.IdSessionTypeNavigation.IdSessionType,
                NameSessionType  = s.IdSessionTypeNavigation.Name
            })
                                         .FirstOrDefaultAsync(s => s.IdSession == IdSession);

            session.SpeakersSessions = await DbContext.SpeakerHasSession.Select(
                s => new SpeakerHasSessionModel
            {
                IdSpeaker      = s.IdSpeaker,
                FirstName      = s.IdSpeakerNavigation.FirstName,
                SecondName     = s.IdSpeakerNavigation.SecondName,
                FirstLastName  = s.IdSpeakerNavigation.FirstLastName,
                SecondLastName = s.IdSpeakerNavigation.SecondLastName,

                IdSession        = s.IdSession,
                Name             = s.IdSessionNavigation.Name,
                StartDate        = s.IdSessionNavigation.StartDate,
                NameSessionLevel = s.IdSessionNavigation.IdSessionLevelNavigation.Name,
                NameSessionType  = s.IdSessionNavigation.IdSessionTypeNavigation.Name
            }
                ).Where(s => s.IdSession == IdSession).ToListAsync();

            return(session);
        }
Пример #6
0
 public ActionResult sessiondetail(string id)
 {
     if (id != null)
     {
         UnitOfWork         uow            = new UnitOfWork();
         SessionDetailModel model          = new SessionDetailModel();
         string             userId         = Session["UserId"].ToString();
         QuestionModel      questionDetail = uow.UserRepository.GetQuestionDetailById(id);
         if (questionDetail != null)
         {
             model.ProblemDetails = questionDetail;
             model.Messages       = uow.UserRepository.GetMessagesByBidId(id);
         }
         else
         {
             ViewBag.Msg = "No Data Is Available";
         }
         return(View(model));
     }
     else
     {
         return(RedirectToAction("Index", "Home"));
     }
 }
 public SessionDetailsViewModel(SessionDetailModel details)
 {
     Details = details;
 }