示例#1
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     XuLyCode xl = new XuLyCode();
     try
     {
         if (txtGiaNormal.Text != "" && txtGiaVIP.Text != "")
         {
             var a = qlktx.LoaiPhongs.Where(t => t.MaLoai == "Loai1").FirstOrDefault();
             if (a != null)
             {
                 a.GiaPhong = txtGiaVIP.Text;
             }
             var b = qlktx.LoaiPhongs.Where(t => t.MaLoai == "Loai2").FirstOrDefault();
             if (b != null)
             {
                 b.GiaPhong = txtGiaNormal.Text;
             }
             qlktx.SubmitChanges();
         }
        
         xl.Show("Thay đổi giá thành công");
     }
     catch
     {
         xl.Show("Thay đổi thất bại");
     }
 }
示例#2
0
 protected void btnCN_Click(object sender, EventArgs e)
 {
     if ((string)Session["DN"] == "admin")
     {
         Response.Redirect("CapNhatBangGia.aspx", false);
     }
     else
     {
         XuLyCode xl = new XuLyCode();
         xl.Show("Cần admin để chỉnh giá phòng");
     }
 }