protected void seach_Click(object sender, EventArgs e) { Lop_Xl xl = new Lop_Xl(); DataClasses1DataContext db = new DataClasses1DataContext(); var loc = xl.timten(txttimsinhvien.Text); if (listloc.Text == "Tên") { dgvsearch.DataSource = from a in db.tlb_sinhviens where a.TenSV.Contains(txttimsinhvien.Text) select a; } else if (listloc.Text == "MSSV") { dgvsearch.DataSource = from a in db.tlb_sinhviens where a.MaSV.Contains(txttimsinhvien.Text) select a; } else if (listloc.Text == "Địa Chỉ") { dgvsearch.DataSource = from a in db.tlb_sinhviens where a.DiaChi.Contains(txttimsinhvien.Text) select a; } else if (listloc.Text == "Lớp") { dgvsearch.DataSource = from a in db.tlb_sinhviens where a.MaLop.Contains(txttimsinhvien.Text) select a; } else if (listloc.Text == "CVHT") { dgvsearch.DataSource = from a in db.tlb_sinhviens where a.TenCVHT.Contains(txttimsinhvien.Text) select a; } dgvsearch.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { int quyen = Convert.ToInt32(Session["quyen"]);; if (quyen == 4) { //string scr = "swal('Thông báo','Xin chào admin','success');"; //Page.ClientScript.RegisterStartupScript(this.GetType(), "tt", scr, true); string txttentk = Convert.ToString(Session["tentk"]); var svv = xl.timten(txttentk); txtms.Text = svv.MaSV; txtten.Text = svv.TenSV; txtlop.Text = svv.MaLop; txtdiachi.Text = svv.DiaChi; } }
protected void dgvxethb_SelectedIndexChanged(object sender, EventArgs e) { GridViewRow gr = dgvxethb.SelectedRow; //if (txtms.Text != "" || txtten.Text != "" || txtngaysinh.Text != "" || txtgioitinh.Text != "" || txtmalop.Text != "" || txtcvht.Text != "" || txtdc.Text != "") txtms.Text = gr.Cells[0].Text; txtten.Text = HttpUtility.HtmlDecode(gr.Cells[1].Text); txtsdt.Text = gr.Cells[2].Text; txtdkk.Text = gr.Cells[3].Text; TextBox1.Text = HttpUtility.HtmlDecode(gr.Cells[5].Text); string txttentk = gr.Cells[0].Text; var svv = xl.timten(txttentk); txtlop.Text = svv.MaLop; txtdiachi.Text = svv.DiaChi; }
protected void login(object sender, EventArgs e) { if (xl.Login(txttentk.Text, txtmk.Text) != null) { var tk = xl.Login(txttentk.Text, txtmk.Text); Session["tentk"] = txttentk.Text; Session["quyen"] = tk.quyen; DataClasses1DataContext db = new DataClasses1DataContext(); var svv = xl.timten(txttentk.Text); Session["ten"] = svv.TenSV; string scr = "swal('Thông báo','Đăng nhập thành công','success');"; Page.ClientScript.RegisterStartupScript(this.GetType(), "tt", scr, true); string a = "$(document).ready(function(){$('.swal-button.swal-button--confirm').click(function(){window.location.href='trangchu.aspx';});});"; Page.ClientScript.RegisterStartupScript(this.GetType(), "click", a, true); } else { string scr = "swal('Thông báo','Đăng nhập thất bại','error');"; Page.ClientScript.RegisterStartupScript(this.GetType(), "tt", scr, true); string scr2 = "$(document).ready(function(){$('.swal-button.swal-button--confirm').click(function(){window.location.href='dangnhap.aspx';});});"; Page.ClientScript.RegisterStartupScript(this.GetType(), "click", scr2, true); } }