protected void Page_Load(object sender, EventArgs e) { if (Session["admin"] == null || (int)Session["admin"] == 0) { Response.Redirect("~/Home.aspx"); } if (!Page.IsPostBack) { listThuongHieu.DataSource = xuly.getListCategory(); listThuongHieu.DataValueField = "id"; listThuongHieu.DataTextField = "name"; listThuongHieu.SelectedIndex = 6; listThuongHieu.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["admin"] == null || (int)Session["admin"] == 0) { Response.Redirect("~/Home.aspx"); } id = int.Parse(Request.QueryString[0].ToString()); if (!Page.IsPostBack) { listThuongHieu.DataSource = xuly.getListCategory(); listThuongHieu.DataValueField = "id"; listThuongHieu.DataTextField = "name"; listThuongHieu.SelectedIndex = 6; listThuongHieu.DataBind(); Watch w = xuly.detailWatch(id); txtName.Text = w.name; listThuongHieu.SelectedValue = w.categoryid.ToString(); txtSoLuong.Text = w.soluong.ToString(); txtGia.Text = w.gia.ToString(); txtGiamGia.Text = w.giamgia.ToString(); txtBaoHanh.Text = w.baohanh; txtKieuMay.Text = w.kieumay; listGioiTinh.SelectedValue = w.gioitinh; txtKichCo.Text = w.kichco; txtDoDay.Text = w.doday; txtChatLieuVo.Text = w.chatlieuvo; txtChatLieuDay.Text = w.chatlieuday; txtChatLieuKinh.Text = w.chatlieukinh; txtChucNang.Text = w.chucnang; txtDoChiuNuoc.Text = w.dochiunuoc; txtMoTa.Value = w.mota; listType.SelectedValue = w.type.ToString(); img.Src = "~/Image/Watch/" + id + w.anh; } anh = xuly.detailWatch(id).anh; }