示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["selectedID"] != null)
            {
                int selectedID = (int)Session["selectedID"];

                goods = new Goods();
                GoodsActions goodsActions = new GoodsActions();
                goods = goodsActions.FindSelectedGoods(selectedID);
                DataSourceAdapterBinding dataSourceAdapterBinding = new DataSourceAdapterBinding();
                GoodsPreview1.DataSource = dataSourceAdapterBinding.AdapterFill(goods);
            }
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ProfileControl1.TableRow_Pay.Visible = true;
                ProfileControl1.Button_Save.Text = "To order";
                ProfileControl1.TableRow_Language.Visible = false;

                var userInfo = new UserInfo();
                ProfileActions profileActions = new ProfileActions();
                UsersActions usersActions = new UsersActions();
                userID = usersActions.FindUserGuid(User.Identity.Name);
                userInfo = profileActions.GetUserInfo(userID);
                ProfileControl1.DataSource = userInfo;
            }

            ProfileControl1.Button_Save.Click += new EventHandler(Button_Save_Click);

            if (Session["OrderList"] != null)
            {
                
                Label1.Visible = false;
                List<Goods> orderList = new List<Goods>();
                orderList = (List<Goods>)Session["OrderList"];
                
                if (Roles.IsUserInRole(User.Identity.Name, premiumUser))
	            {
            		 discount = 10;
	            }
                else
	            {
                    if (Roles.IsUserInRole(User.Identity.Name, registerUser))
                    {
            		    discount = 5;
                    }
	                else
	                {
                        discount = 0;
	                }
	            }
                
                DataSourceAdapterBinding dataSourceAdapterBinding = new DataSourceAdapterBinding();
                OrderPreview1.DataSource = dataSourceAdapterBinding
                    .AdapterFillPriceCalculate(orderList, discount);
            }
            else
            {
                Label1.Visible = true;
            }
        }
示例#3
0
        protected void Page_Init(object sender, EventArgs e)
        {
            if (Session["SelectedGoodsID"] != null)
            {
                selectedGoodsID = int.Parse(Session["SelectedGoodsID"].ToString());
                GoodsEditControl1.GoodsID = selectedGoodsID;

                GoodsActions goodsActions = new GoodsActions();
                var goods = goodsActions.FindSelectedGoods(selectedGoodsID);

                DataSourceAdapterBinding dataSourceAdapterBinding = new DataSourceAdapterBinding();
                GoodsPreviewControl1.DataSource = dataSourceAdapterBinding.AdapterFill(goods);
            }
        }