protected void Page_Load(object sender, EventArgs e) { if ((string)Session["role"] == "Admin") { if (!IsPostBack) { DropXe.DataSource = sv.DanhSachAllXe(); DropXe.DataTextField = "TenBangSo"; DropXe.DataValueField = "MaXe"; DropXe.DataBind(); } } else { Response.Redirect("~/403page.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { string manv = sv.checkNV((string)Session["name"]); if ((string)Session["role"] != "User" && (string)Session["role"] != null && (string)Session["role"] != "Block") { if (!IsPostBack) { dropkhachhang.DataSource = sv.DanhSachKhachHang(); dropkhachhang.DataTextField = "TenKH"; dropkhachhang.DataValueField = "MaKH"; dropkhachhang.DataBind(); DropXe.DataSource = sv.DanhSachXe(); DropXe.DataTextField = "BangSo"; DropXe.DataValueField = "MaXe"; DropXe.DataBind(); try { if ((string)Session["role"] == "Admin") { Dropnhanvien.DataSource = sv.DanhSachNhanVien(); } else { Dropnhanvien.DataSource = sv.DanhSachNhanVien().Where(x => x.MaNV == int.Parse(manv)); } } catch (Exception) { Label2.Text = "!"; } Dropnhanvien.DataTextField = "HoTen"; Dropnhanvien.DataValueField = "MaNV"; Dropnhanvien.DataBind(); } load(); } else { Response.Redirect("~/403page.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { dropkhachhang.DataSource = sv.DanhSachKhachHang(); dropkhachhang.DataTextField = "HoTen"; dropkhachhang.DataValueField = "MaKH"; dropkhachhang.DataBind(); DropXe.DataSource = sv.DanhSachXe(); DropXe.DataTextField = "BangSo"; DropXe.DataValueField = "MaXe"; DropXe.DataBind(); Dropnhanvien.DataSource = sv.DanhSachNhanVien(); Dropnhanvien.DataTextField = "HoTen"; Dropnhanvien.DataValueField = "MaNV"; Dropnhanvien.DataBind(); } load(); }