Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //searech button event catch
            ((Button)Master.FindControl("Button1")).Click            += new EventHandler(this.searchBtn_Click);
            ((LinkButton)Master.FindControl("AdvancedSearch")).Click += new EventHandler(this.searchBtn_Click);
            (Master.FindControl("navigation_bar")).Visible            = false;

            Logic lg = new Logic();

            trns = lg.getTransactionById(Session["bid_id"].ToString());
            lg.markBidAsRead(Session["bid_id"].ToString());

            //////////////////////regarding the item
            item_pic.ImageUrl = lg.setImagePath(trns.Item_id);
            Item item = lg.getItemById(trns.Item_id);

            itemName.Text        = item.Name;
            itemDescription.Text = item.Description;
            itemBarCode.Text     = item.Id;
            itemOwner.Text       = item.Usr;
            /////////////////////////////////


            User usr;

            //////////////////////regarding the bid or offer
            if (Session["transaction_type"].ToString() == "bid")
            {
                usr = lg.getUserInformation(trns.Owner);
                BidOrOfferHeader.Text  = "Bid Information";
                OfferdItemsHeader.Text = "The Items That You Offered To The Owner:";
                OwnerOrBidderInformationHeader.Text = "Owner Information";
                Confirm_cmd.Visible   = false;
                confirm_label.Visible = false;
                Lbl1.Text             = "Withdraw bid";
            }
            else
            {
                usr = lg.getUserInformation(trns.Bidder);
                BidOrOfferHeader.Text  = "Offer Information";
                OfferdItemsHeader.Text = "The Items That The Bidder Offered To You:";
                OwnerOrBidderInformationHeader.Text = "Bidder Information";
                Confirm_cmd.Visible   = true;
                confirm_label.Visible = true;
                Lbl1.Text             = "Decline offer";
            }


            //////////////////////



            ///////////////////////////////regarding the contact information
            contact_usr.Text      = usr.Usr;
            contact_fullName.Text = usr.FullName;
            contact_email.Text    = usr.Email;
            ////////////////////////////////


            if (!IsPostBack)
            {
                bind();
            }
        }