예제 #1
0
    protected void SaveBooks()
    {
        if (!txtBooks.Text.Equals(""))
        {
            EntertainmentBO objEntertainment = new EntertainmentBO();

            objEntertainment.Name   = txtBooks.Text;
            objEntertainment.UserId = Userid;
            if (System.IO.File.Exists(Server.MapPath("../../Resources/images/ProfileIcons/" + txtBooks.Text + Global.PICTURE_EXTENSION_JPG)))
            {
                objEntertainment.Image = txtBooks.Text + ".jpg";
            }
            else if (System.IO.File.Exists(Server.MapPath("../../Resources/images/ProfileIcons/" + txtBooks.Text + ".png")))
            {
                objEntertainment.Image = txtBooks.Text + ".png";
            }
            else
            {
                objEntertainment.Image = "DefaultBooks.png";
            }
            objEntertainment.Type = Global.BOOKS;
            EntertainmentBLL.insertEntertainment(objEntertainment);
            txtBooks.Text = "";
            LoadDataListBooks();
        }
    }
예제 #2
0
    protected void SaveGame()
    {
        if (!txtGame.Text.Equals(""))
        {
            EntertainmentBO objEntertainment = new EntertainmentBO();

            objEntertainment.Name   = txtGame.Text;
            objEntertainment.UserId = Userid;
            if (System.IO.File.Exists(Server.MapPath("../../Resources/images/ProfileIcons/" + txtGame.Text + ".jpg")))
            {
                objEntertainment.Image = txtGame.Text + ".jpg";
            }
            else if (System.IO.File.Exists(Server.MapPath("../../Resources/images/ProfileIcons/" + txtGame.Text + ".png")))
            {
                objEntertainment.Image = txtGame.Text + ".png";
            }
            else
            {
                objEntertainment.Image = "DefaultGame.png";
            }
            objEntertainment.Type = Global.GAME;
            EntertainmentBLL.insertEntertainment(objEntertainment);
            txtGame.Text = "";
            LoadDataListGame();
        }
    }