protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { DataTable dt = fdp.tabletypes(); DropDownList0.DataTextField = "tableType"; DropDownList0.DataValueField = "typeID"; DropDownList0.DataSource = dt; DropDownList0.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { DataTable dt = fdp.menucategories(); DropDownList0.DataTextField = "catName"; DropDownList0.DataValueField = "catID"; DropDownList0.DataSource = dt; DropDownList0.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { DataSet shebaList = new DataSet(); shebaList.ReadXml(Server.MapPath("DataXmlFile.xml")); DropDownList0.DataSource = shebaList.Tables["Shebalist"]; DropDownList0.DataTextField = "Sheba"; DropDownList0.DataValueField = "name"; DropDownList0.DataBind(); DropDownList1.DataSource = shebaList.Tables["Shebalist"]; DropDownList1.DataTextField = "Sheba"; DropDownList1.DataValueField = "Name"; DropDownList1.DataBind(); InitialTextBox(); } }
protected void Page_Load(object sender, EventArgs e) { mH = new maHoa(); connect = new connect(); System.Data.SqlClient.SqlConnection ketnoi = new System.Data.SqlClient.SqlConnection(connect.getconnect()); //1. danh sách TH string sql = "select id_thuong_hieu, ten_thuong_hieu from thuong_hieu"; connect = new connect(); DataTable tmp = new DataTable(); new System.Data.SqlClient.SqlDataAdapter(new System.Data.SqlClient.SqlCommand(sql, ketnoi)).Fill(tmp); for (int i = 0; i < tmp.Rows.Count; i++) { tmp.Rows[i][1] = mH.Base64Decode(tmp.Rows[i][1].ToString()); } if (!IsPostBack) { DropDownList0.DataSource = tmp; DropDownList0.DataTextField = "ten_thuong_hieu"; DropDownList0.DataValueField = "id_thuong_hieu"; DropDownList0.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { mH = new maHoa(); connect connect; try { if (Request.QueryString["id_san_pham"] != null && Request.QueryString["id_san_pham"] != "") { id_san_pham = int.Parse(Request.QueryString["id_san_pham"]); } } catch (Exception qqe) { } if (id_san_pham == 0) { Response.Redirect("./danhSach.aspx"); } connect = new connect(); System.Data.SqlClient.SqlConnection ketnoi = new System.Data.SqlClient.SqlConnection(connect.getconnect()); string sql = "SELECT id_san_pham " + ",id_thuong_hieu " + " ,ten_san_pham " + ",anh_san_pham " + " ,cast(gia_cao as int)" + " ,cast(gia_ban_ra as int)" + ",cast(gia_nhap_san_pham as int)" + ",mo_ta_san_pham_html " + ",dac_tinh_san_pham " + ",khoi_luong_san_pham_gram " + ",da_co_vat " + " , cast(FORMAT(ngay_cap_nhat, 'yyyy-MM-dd') as varchar) as ngay_cap_nhat" + " FROM san_pham " + "where id_san_pham=" + id_san_pham; DataTable ds = new DataTable(); new System.Data.SqlClient.SqlDataAdapter(new System.Data.SqlClient.SqlCommand(sql, ketnoi)).Fill(ds); if (ds == null || ds.Rows.Count == 0) { Response.Redirect("./danhSach.aspx"); } anh = ds.Rows[0][3].ToString(); //1. danh sách tỉnh sql = "select id_thuong_hieu, ten_thuong_hieu from thuong_hieu"; connect = new connect(); DataTable tmp = new DataTable(); new System.Data.SqlClient.SqlDataAdapter(new System.Data.SqlClient.SqlCommand(sql, ketnoi)).Fill(tmp); for (int i = 0; i < tmp.Rows.Count; i++) { tmp.Rows[i][1] = mH.Base64Decode(tmp.Rows[i][1].ToString()); } if (!IsPostBack) { DropDownList0.DataSource = tmp; DropDownList0.DataTextField = "ten_thuong_hieu"; DropDownList0.DataValueField = "id_thuong_hieu"; DropDownList0.DataBind(); } if (!IsPostBack) { DropDownList0.SelectedValue = ds.Rows[0][1].ToString(); TextBox0.Text = ds.Rows[0][0].ToString(); TextBox1.Text = mH.Base64Decode(ds.Rows[0][2].ToString()); TextBox3.Text = ds.Rows[0][4].ToString(); TextBox4.Text = ds.Rows[0][5].ToString(); TextBox5.Text = ds.Rows[0][6].ToString(); TextBox6.Text = mH.Base64Decode(ds.Rows[0][7].ToString()); TextBox7.Text = mH.Base64Decode(ds.Rows[0][8].ToString()); TextBox8.Text = ds.Rows[0][9].ToString(); TextBox9.Text = ds.Rows[0][11].ToString(); } }
protected void FillDeptDropdownList() { BLItem objBL = new BLItem(); DataTable dt = objBL.get_available_courses(int.Parse(Session["New"].ToString()), 3); DataTable dt1 = objBL.get_available_courses(int.Parse(Session["New"].ToString()), 1); DropDownList0.DataSource = dt; DropDownList0.DataTextField = "courseName"; DropDownList0.DataValueField = "courseID"; DropDownList0.DataBind(); //DropDownList0.Items.Insert(0, "Select Course"); DropDownList0.Items.Insert(0, new ListItem("Select Course", "-1")); DropDownList1.DataSource = dt; DropDownList1.DataTextField = "courseName"; DropDownList1.DataValueField = "courseID"; DropDownList1.DataBind(); //DropDownList1.Items.Insert(0, "Select Course"); DropDownList1.Items.Insert(0, new ListItem("Select Course", "-1")); DropDownList2.DataSource = dt; DropDownList2.DataTextField = "courseName"; DropDownList2.DataValueField = "courseID"; DropDownList2.DataBind(); //DropDownList2.Items.Insert(0, "Select Course"); DropDownList2.Items.Insert(0, new ListItem("Select Course", "-1")); DropDownList3.DataSource = dt; DropDownList3.DataTextField = "courseName"; DropDownList3.DataValueField = "courseID"; DropDownList3.DataBind(); //DropDownList3.Items.Insert(0, "Select Course"); DropDownList3.Items.Insert(0, new ListItem("Select Course", "-1")); DropDownList4.DataSource = dt; DropDownList4.DataTextField = "courseName"; DropDownList4.DataValueField = "courseID"; DropDownList4.DataBind(); //DropDownList4.Items.Insert(0, "Select Course"); DropDownList4.Items.Insert(0, new ListItem("Select Course", "-1")); DropDownList5.DataSource = dt1; DropDownList5.DataTextField = "courseName"; DropDownList5.DataValueField = "courseID"; DropDownList5.DataBind(); //DropDownList5.Items.Insert(0, "Select Course"); DropDownList5.Items.Insert(0, new ListItem("Select Course", "-1")); DropDownList6.DataSource = dt1; DropDownList6.DataTextField = "courseName"; DropDownList6.DataValueField = "courseID"; DropDownList6.DataBind(); //DropDownList6.Items.Insert(0, "Select Course"); DropDownList6.Items.Insert(0, new ListItem("Select Course", "-1")); DropDownList7.DataSource = dt1; DropDownList7.DataTextField = "courseName"; DropDownList7.DataValueField = "courseID"; DropDownList7.DataBind(); //DropDownList7.Items.Insert(0, "Select Course"); DropDownList7.Items.Insert(0, new ListItem("Select Course", "-1")); DropDownList8.DataSource = dt1; DropDownList8.DataTextField = "courseName"; DropDownList8.DataValueField = "courseID"; DropDownList8.DataBind(); //DropDownList8.Items.Insert(0, "Select Course"); DropDownList8.Items.Insert(0, new ListItem("Select Course", "-1")); DropDownList9.DataSource = dt1; DropDownList9.DataTextField = "courseName"; DropDownList9.DataValueField = "courseID"; DropDownList9.DataBind(); //DropDownList9.Items.Insert(0, "Select Course"); DropDownList9.Items.Insert(0, new ListItem("Select Course", "-1")); }