Esempio n. 1
0
        //Method that removes movie from favorites
        private void RemoveMovieFromFavorites(GridUpdateArgs gua)
        {
            string selectedMovieTitle = gua.ID;
            string userName           = gua.UserName;
            IUser  UserServices       = new UserServices();
            Guid   UserID             = UserServices.GetUserID(userName);
            bool   check = UserServices.RemoveMovieFromFavoriteList(UserID, selectedMovieTitle);

            if (check)
            {
                Myview.Model.IsValidTransastion = true;
            }
            else
            {
                Myview.Model.IsValidTransastion = false;
            }
        }
Esempio n. 2
0
        protected void GridViewFavorite_SelectedIndexChanged(object sender, EventArgs e)
        {
            GridViewRow    row = GridViewFavorite.SelectedRow;
            string         selectedMovieTitle = row.Cells[0].Text;
            GridUpdateArgs gua = new GridUpdateArgs();

            gua.ID       = selectedMovieTitle;
            gua.UserName = System.Web.HttpContext.Current.User.Identity.Name;
            if (RemoveMovie != null)
            {
                RemoveMovie(gua);
                if (Model.IsValidTransastion == true)
                {
                    var ex = new LoadDataArgs();
                    ex.UserName = System.Web.HttpContext.Current.User.Identity.Name;
                    LoadData(ex);
                    GridViewFavorite.DataSource = Model.ListOfFavorites;
                    GridViewFavorite.DataBind();
                }
            }
        }
 protected void GridViewFavorite_SelectedIndexChanged(object sender, EventArgs e)
 {
     GridViewRow row = GridViewFavorite.SelectedRow;
     string selectedMovieTitle = row.Cells[0].Text;
     GridUpdateArgs gua = new GridUpdateArgs();
     gua.ID = selectedMovieTitle;
     gua.UserName = System.Web.HttpContext.Current.User.Identity.Name;
     if (RemoveMovie != null)
     {
         RemoveMovie(gua);
         if (Model.IsValidTransastion == true)
         {
             var ex = new LoadDataArgs();
             ex.UserName = System.Web.HttpContext.Current.User.Identity.Name;
             LoadData(ex);
             GridViewFavorite.DataSource = Model.ListOfFavorites;
             GridViewFavorite.DataBind();
         }
     }
 }
        //Method that removes movie from favorites
        private void RemoveMovieFromFavorites(GridUpdateArgs gua)
        {
            string selectedMovieTitle = gua.ID;
            string userName = gua.UserName;
            IUser UserServices = new UserServices();
            Guid UserID = UserServices.GetUserID(userName);
            bool check = UserServices.RemoveMovieFromFavoriteList(UserID, selectedMovieTitle);

            if (check)
            {
                Myview.Model.IsValidTransastion = true;
            }
            else
            {
                Myview.Model.IsValidTransastion = false;
            }
        }