示例#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 Button1_Click(object sender, EventArgs e)
 {
     try
     {
         if (Session["TT"] != null)
         {
             DataTable dt = (DataTable)Session["TT"];
             xl.UodateThanhToan(dt);
             xl.Show("Thanh toán thành công");
         }
     }
     catch
     {
         xl.Show("Thanh toán thất bại");
     }
 }
示例#3
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");
     }
 }
示例#4
0
 protected void btnDangKi_Click(object sender, EventArgs e)
 {
     if (IsPostBack)
     {
         bool y = xl.CheckDaTonTaiDangKi(Session["DN"].ToString(), Session["Phong"].ToString());
         if (y == true)
         {
             int i = xl.DangKi(Session["Phong"].ToString(), Session["DN"].ToString(), txt_ngaydangky.Text);
             if (i == 0)
             {
                 xl.Show("Bạn đăng kí phòng này thất bại");
             }
             else
             {
                 xl.Show("Đã đăng kí thành công chờ thanh toán để xác nhận");
                 Server.Transfer("ThanhToan.aspx");
             }
         }
         else
         {
             xl.Show("Bạn đã đăng kí phòng kí túc xá rồi!");
         }
     }
 }