예제 #1
0
        private void GetReviewbyBook()
        {
            _ib._Flag     = "C";
            _ib._Top      = 1;
            _ib._PageSize = 1000;
            _ib._BookId   = bookId;

            _ib.Execute("SelectCustomerReviewByBookIdCapability");
            if (_ib.Success != null)
            {
                DataTable reviewbook = (DataTable)_ib.Success;
                CommentGV.DataSource = reviewbook;
                CommentGV.DataBind();
            }
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!Page.IsPostBack)
                {
                    if (Session["PurchaseBroker"] != null)
                    {
                        _pb = (CustomerAgent)Session["PurchaseBroker"];
                    }
                    else
                    {
                        _pb = new CustomerAgent();
                        Session["PurchaseBroker"] = _pb;
                    }

                    if (Session["InteractionBroker"] != null)
                    {
                        _ib = (CustomerAgent)Session["InteractionBroker"];
                    }
                    else
                    {
                        _ib = new CustomerAgent();
                        Session["InteractionBroker"] = _ib;
                    }

                    if (Session["CatalogueBroker"] != null)
                    {
                        _cb = (CustomerAgent)Session["CatalogueBroker"];
                    }
                    else
                    {
                        _cb = new CustomerAgent();
                        Session["CatalogueBroker"] = _cb;
                    }

                    if (Session["ShoppingCartBook"] != null)
                    {
                        shoppingCartbookDT = (DataTable)Session["ShoppingCartBook"];
                    }

                    if (Session["ShoppingCart"] != null)
                    {
                        shoppingCartDT = (DataTable)Session["ShoppingCart"];
                    }

                    idtxt.Text            = _cb._Id.ToString();
                    ISBNtxt.Text          = _cb._ISBN;
                    titletxt.Text         = _cb._Title;
                    editionNumbertxt.Text = _cb._EditionNumber.ToString();
                    copyRighttxt.Text     = _cb._CopyRight.ToString();
                    Amounttxt.Text        = _cb._Amount.ToString();
                    pricetxt.Text         = _cb._Price.ToString();
                    categorylbl.Text      = _cb._Name;

                    _cb._NumOfVisits++;
                    _cb.Execute("UpdateBookCapability");
                    if (_cb.Success != null)
                    {
                    }

                    _ib._CustomerId = _pb._ShoppingCartId;
                    _ib.Execute("SelectCustomerWishListByCustomerIdCapability");
                    if (_ib.Success != null)
                    {
                        CustomerBookWishListDT = (DataTable)_ib.Success;
                    }

                    _ib._BookId = int.Parse(idtxt.Text);
                    _ib.Execute("SelectCustomerRateByBookIdCapability");
                    if (_ib.Success != null)
                    {
                        CustomerBookRateListDT = (DataTable)_ib.Success;
                        double sum = 0;
                        for (int i = 0; i < CustomerBookRateListDT.Rows.Count; i++)
                        {
                            sum += double.Parse(CustomerBookRateListDT.Rows[i]["Rate"].ToString());
                        }
                        double v = sum / CustomerBookRateListDT.Rows.Count;
                        ratelbl.Text = v.ToString();
                    }

                    _ib._BookId = int.Parse(idtxt.Text);
                    _ib.Execute("SelectCustomerReviewByBookIdCapability");
                    if (_ib.Success != null)
                    {
                        CustomerBookReviewListDT = (DataTable)_ib.Success;
                        CommentGV.DataSource     = CustomerBookReviewListDT;
                        CommentGV.DataBind();
                    }
                }
            }
            catch (Exception)
            {
            }
        }