Exemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        FormsAuthenticationHelper.AuthenticateUserWithReturnUrl();
        connstring = Client.ConnectionString(HttpContext.Current.Session["clientid"].ToString());

        #region Check if online auction ref no is specified, if not, redirect back to finishedauctionevents.aspx
        if (Session[Constant.SESSION_AUCTIONREFNO] == null)
        {
            Response.Redirect("finishedauctionevents.aspx");
        }
        #endregion

        PageTitle.InnerText = String.Format(Constant.TITLEFORMAT, "Auction Awards");
        trHistory.Visible   = !String.IsNullOrEmpty(Request.QueryString["a"]);
        web_usercontrol_commentlist_auction commentlist = (web_usercontrol_commentlist_auction)FindControl("Commentlist_auction1");

        try
        {
            if (!String.IsNullOrEmpty(Request.QueryString["b"]))
            {
                lblHistory.Text = "Bid History : " + EncryptionHelper.Decrypt(Request.QueryString["b"]);
            }
        }
        catch
        {
            Response.Redirect("auctionawards.aspx");
        }

        //if (Session[Constant.SESSION_USERTYPE].Equals("2"))
        //{
        //    commentlist.Visible = false;
        //}

        if (Page.IsPostBack)
        {
            gvAuctionLastBids.DataBind();
        }

        if (Session[Constant.SESSION_AUCTIONREFNO] != null)
        {
            if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) == (int)Constant.USERTYPE.BUYER)
            {
                //if ((GetAuctionItemForConversion(Session[Constant.SESSION_AUCTIONREFNO].ToString()).Length > 0) && (GridView1.Rows.Count == 0))
                //{
                //    lnkEndorse.Visible = true;
                //}
                if ((GetAuctionStatus(Session[Constant.SESSION_AUCTIONREFNO].ToString().Trim()) == Constant.AUCTION_STATUS_CANCELLED.ToString()) && (GridView1.Rows.Count == 0))
                {
                    lnkEndorse.Visible = true;
                }
            }
        }
    }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        connstring = Client.ConnectionString(HttpContext.Current.Session["clientid"].ToString());
        web_usercontrol_commentlist         commentslist_bid     = (web_usercontrol_commentlist)FindControl("Commentlist_bid");
        web_usercontrol_commentlist_auction commentslist_auction = (web_usercontrol_commentlist_auction)FindControl("Commentlist_auction1");

        if (Session[Constant.SESSION_BIDREFNO] != null)
        {
            commentslist_bid.Visible     = true;
            commentslist_auction.Visible = false;
        }

        if (Session[Constant.SESSION_AUCTIONREFNO] != null)
        {
            commentslist_bid.Visible     = false;
            commentslist_auction.Visible = true;
        }

        if (!(Page.IsPostBack))
        {
            DataTable dtComments = null;
            DataView  dvComments = null;

            if (Session[Constant.SESSION_USERID] != null)
            {
                ViewState[Constant.SESSION_USERID]   = Session[Constant.SESSION_USERID].ToString();
                ViewState[Constant.SESSION_USERTYPE] = Session[Constant.SESSION_USERTYPE].ToString().Trim();
            }

            if (Session[Constant.SESSION_COMMENT_TYPE] != null)
            {
                ViewState[Constant.SESSION_COMMENT_TYPE] = Session[Constant.SESSION_COMMENT_TYPE].ToString().Trim();

                if (Int32.Parse(ViewState[Constant.SESSION_COMMENT_TYPE].ToString().Trim()) == 0)
                {
                    if (Session[Constant.SESSION_BIDREFNO] != null)
                    {
                        ViewState[Constant.SESSION_BIDREFNO] = Session[Constant.SESSION_BIDREFNO].ToString().Trim();
                        if (ViewState[Constant.SESSION_BIDREFNO] != null)
                        {
                            if (ViewState[Constant.SESSION_BIDREFNO].ToString().Trim() != "")
                            {
                                dtComments = UserTransaction.QueryItemCommentsbyRefNo(connstring, ViewState[Constant.SESSION_BIDREFNO].ToString().Trim(), false);
                                dvComments = new DataView(dtComments);
                            }
                        }
                    }
                }
                else
                {
                    if (Session[Constant.SESSION_AUCTIONREFNO] != null)
                    {
                        ViewState[Constant.SESSION_AUCTIONREFNO] = Session[Constant.SESSION_AUCTIONREFNO].ToString().Trim();
                        if (ViewState[Constant.SESSION_AUCTIONREFNO] != null)
                        {
                            if (ViewState[Constant.SESSION_AUCTIONREFNO].ToString().Trim() != "")
                            {
                                dtComments = UserTransaction.QueryItemCommentsbyRefNo(connstring, ViewState[Constant.SESSION_AUCTIONREFNO].ToString().Trim(), true);
                                dvComments = new DataView(dtComments);
                            }
                        }
                    }
                }
            }


            if (Session[Constant.SESSION_USERTYPE].Equals("1"))
            {
                chkAlowVendorView.Visible = true;
            }
            else
            {
                chkAlowVendorView.Visible = false;
            }

            CommentBox.Attributes.Add("maxLength", "50");
            hdnIsPosted.Value = "0";
        }
    }