Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            KifuID    = Int32.Parse(Request.QueryString["KifuID"]);
            Content   = KifuService.GetKifuContent(KifuID);
            IsOwnKifu = false;
            if (Session["user"] != null)
            {
                favourite = new FavouriteKifu(KifuID, Session["user"].ToString());
                IsFavour  = FavouriteKifuService.IsFavour(favourite);
                IsOwnKifu = KifuService.IsOwnKifu(Session["user"].ToString(), KifuID);
            }
            if (!IsOwnKifu)
            {
                txtGameName.ReadOnly  = true;
                txtGameEvent.ReadOnly = true;
                txtGameDate.ReadOnly  = true;
            }
            if (!IsPostBack)
            {
                Content           = KifuService.GetKifuContent(KifuID);
                txtGameDate.Text  = DateTime.Parse(CommonService.GetContentInBracket(Content, "DT")).ToString("yyyy-MM-dd");
                txtGameName.Text  = CommonService.GetContentInBracket(Content, "GN");
                txtGameEvent.Text = CommonService.GetContentInBracket(Content, "EV");
            }
            rpComment.DataSource = FavouriteKifuService.GetKifuRating(KifuID);
            rpComment.DataBind();

            lblRate.Text = FavouriteKifuService.GroupPointOfKifu(KifuID) + "/5";
            GetOpen();
        }
Пример #2
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            string     comment    = txtComment.Text;
            int        point      = Int32.Parse(drRate.SelectedValue);
            KifuRating kifuRating = new KifuRating(KifuID, Session["user"].ToString(), point, comment);

            FavouriteKifuService.RatingAndCommnent(kifuRating);
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                rptTopNews.DataSource = KifuService.GetTopNewKifu();
                rptTopNews.DataBind();

                rptTopFavour.DataSource = FavouriteKifuService.GetTopFavouriteKifu();
                rptTopFavour.DataBind();

                rptTopOpening.DataSource = OpeningService.GetPopularOpening();
                rptTopOpening.DataBind();
            }
        }
Пример #4
0
 protected void btnDisLike_Click(object sender, EventArgs e)
 {
     FavouriteKifuService.UnLikeKifu(favourite);
     IsFavour = false;
 }
Пример #5
0
 protected void btnLike_Click(object sender, EventArgs e)
 {
     FavouriteKifuService.LikeKifu(favourite);
     IsFavour = true;
 }
Пример #6
0
 protected void btnListFavorKifu_Click(object sender, EventArgs e)
 {
     rptList.DataSource = FavouriteKifuService.GetFavouriteKifu(Session["user"].ToString());
     rptList.DataBind();
 }