Beispiel #1
0
        protected void rptTvSeriesList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            int id = Convert.ToInt32(e.CommandArgument);

            if (e.CommandName == "Update")
            {
                //
            }
            else
            {
                var tvModel = _tvSeriesManager.Get(id);
                tvModel.IsActive = !tvModel.IsActive;
                _tvSeriesManager.Update(tvModel);
                Response.Redirect($"~/Administrator/AdminTvSeriesPage.aspx");
            }
        }
 private void LoadTvSeries(int id)
 {
     try
     {
         var tv = _tvManager.Get(id);
         coverImage.ImageUrl  = $"../Uploads/{tv.CoverImage}";
         lblDirector.Text     = tv.Director;
         lblWriter.Text       = tv.Writer;
         lblYear.Text         = tv.Year.ToShortDateString();
         lblSummary.Text      = tv.Summary;
         lblTvSeriesName.Text = tv.Name;
         lblImdb.Text         = tv.ImdbScore.ToString();
         trailer.Src          = tv.Trailer;
     }
     catch (Exception)
     {
         Response.Redirect($"~/WebSite/SinemaDevi.Home.aspx");
     }
 }
        protected void rptTvSeries_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            WatchListTv watchListTv = new WatchListTv();
            int         id          = Convert.ToInt32(e.CommandArgument);

            if (e.CommandName == "Add")
            {
                if (Session["Id"] == null)
                {
                    return;
                }
                else
                {
                    var tvModel = _tvManager.Get(id);
                    watchListTv.TvSeriesId = tvModel.Id;
                    watchListTv.UserId     = Convert.ToInt32(Session["Id"]);
                    watchListTv.IsActive   = true;
                    _watchListTvManager.Add(watchListTv);
                }
            }
        }