//-----------------------------THÔNG TIN CỬA HÀNG---------------------------------------- public void Thongtincuahang_Show() { try { DataTable dt = new DataTable(); dt = ThongtincuahangBUS.Thongtincuahang_Get(); txt_thongtincuahang_diachi.Text = dt.Rows[0][0].ToString(); txt_thongtincuahang_email.Text = dt.Rows[0][1].ToString(); txt_thongtincuahang_sdt.Text = dt.Rows[0][2].ToString(); txt_thongtincuahang_kinhdo.Text = dt.Rows[0][3].ToString(); txt_thongtincuahang_vido.Text = dt.Rows[0][4].ToString(); } catch (Exception) { } }
protected void Page_Load(object sender, EventArgs e) { if (Session["login"].ToString() == "guest") { btn_trangquantri.Visible = false; btn_dangnhap.Visible = true; btn_dangxuat.Visible = false; btn_dangki.Visible = true; btn_nguoidung.Visible = false; } else if (Session["login"].ToString() == "member") { btn_trangquantri.Visible = false; btn_dangnhap.Visible = false; btn_dangxuat.Visible = true; btn_dangki.Visible = false; btn_nguoidung.Visible = true; btn_nguoidung.Text = function.hoten; } else { btn_trangquantri.Visible = true; btn_dangnhap.Visible = false; btn_dangxuat.Visible = true; btn_dangki.Visible = false; btn_nguoidung.Visible = true; btn_nguoidung.Text = function.hoten; } if (Session["login"].ToString() != "member") { Session["giohang"] = null; } DataTable dt = new DataTable(); dt = ThongtincuahangBUS.Thongtincuahang_Get(); show_soluong_giohang(); lbl_diachi_.Text = dt.Rows[0][0].ToString(); lbl_email_.Text = dt.Rows[0][1].ToString(); lbl_dienthoai_.Text = dt.Rows[0][2].ToString(); }
protected void btn_thongtincuahang_sua_Click(object sender, EventArgs e) { Thongtincuahang ttch = new Thongtincuahang(); ttch.Diachi = txt_thongtincuahang_diachi.Text; ttch.Email = txt_thongtincuahang_email.Text; ttch.Sdt = txt_thongtincuahang_sdt.Text; ttch.Kinhdo = txt_thongtincuahang_kinhdo.Text; ttch.Vido = txt_thongtincuahang_vido.Text; try { ThongtincuahangBUS.Thongtincuahang_Update(ttch); string mapcontent = "var myCenter = new google.maps.LatLng(" + ttch.Kinhdo + ", " + ttch.Vido + ");function initialize() {var mapProp = {center: myCenter,zoom: 16,mapTypeId: google.maps.MapTypeId.ROADMAP};var map = new google.maps.Map(document.getElementById('plugin-map'), mapProp);var marker = new google.maps.Marker({position: myCenter,});marker.setMap(map);}google.maps.event.addDomListener(window, 'load', initialize);"; if (File.Exists(Server.MapPath("~/script/") + "google-map.js")) { File.Delete(Server.MapPath("~/script/") + "google-map.js"); using (StreamWriter sw = File.CreateText(Server.MapPath("~/script/") + "google-map.js")) { sw.Write(mapcontent); } } else { using (StreamWriter sw = File.CreateText(Server.MapPath("~/script/") + "google-map.js")) { sw.Write(mapcontent); } } Response.Write("<script>alert('Cập nhật thành công')</script>"); } catch (Exception) { Response.Write("<script>alert('Cập nhật thất bại')</script>"); } }