コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            String username = Request.Cookies["user"].Value;

            if (!username.Equals("*****@*****.**"))
            {
                Response.Redirect("~/Default.aspx");
            }

            shopID = int.Parse(Request.Params[0]);
            if (shopID <= 0)
            {
                Response.Redirect("Restaurant.aspx");
            }

            db = new DbLayer();

            if (!this.IsPostBack)
            {
                SqlDataReader sr = db.GetShopByID(shopID);
                sr.Read();
                tbShopName.Text             = sr.GetString(1);
                tbShopSubName.Text          = sr.GetString(2);
                tbShopInformation.Text      = sr.GetString(3);
                tbShopAddress.Text          = sr.GetString(4);
                tbShopPhone.Text            = sr.GetString(5);
                DropDownList1.SelectedValue = sr.GetString(6);
                Image1.ImageUrl             = sr.GetString(7);
                sr.Close();
                sr = null;
            }
        }