Example #1
0
        public static void Update(Thongtincuahang ttch)
        {
            using (SqlConnection cnn = ConnectDataBase())
            {
                SqlCommand cmd = new SqlCommand("sp_Thongtincuahang_Update", cnn);
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue("@diachi", ttch.Diachi);
                cmd.Parameters.AddWithValue("@email", ttch.Email);
                cmd.Parameters.AddWithValue("@sodienthoai", ttch.Sdt);
                cmd.Parameters.AddWithValue("@kinhdo", ttch.Kinhdo);
                cmd.Parameters.AddWithValue("@vido", ttch.Vido);

                try
                {
                    cmd.ExecuteNonQuery();
                }
                catch (Exception)
                {
                }
            }
        }
Example #2
0
    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>");
        }
    }
Example #3
0
 public static void Thongtincuahang_Update(Thongtincuahang ttch)
 {
     ThongtincuahangDAO.Update(ttch);
 }