示例#1
0
        public DataTable getmakh(nhanphong_DTO kh)
        {
            string    query  = "SELECT * FROM t_khachhang WHERE ID=N'" + kh.Makh + "'";
            DataTable result = new DataTable();

            result = processdata.Instance.ExecuteQuery(query);
            return(result);
        }
示例#2
0
        public bool themkh(nhanphong_DTO kh)
        {
            string query = "INSERT INTO t_thuephong(Idphong,Idkhachhang,Checkin) VALUES(N'" + kh.Idphong + "',N'" + kh.Makh + "',N'" + kh.Checkin + "')";

            if (processdata.Instance.ExecuteNonQuery(query))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#3
0
        public bool suatinhtrang(nhanphong_DTO kh)
        {
            string query = " UPDATE t_phong SET Idtinhtrang= 2 WHERE t_phong.ID ='" + kh.Idphong + "' ";

            if (processdata.Instance.ExecuteNonQuery(query))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#4
0
 private void cb_makhach_TextChanged(object sender, EventArgs e)
 {
     if (cb_makhach.Text == "")
     {
         panel3.Visible = false;
     }
     else
     {
         nhanphong_DTO kh = new nhanphong_DTO(cb_makhach.Text);
         DataTable     dt = new DataTable();
         dt = nhanphong_BUS.Instance.getmakh(kh);
         foreach (DataRow row in dt.Rows)
         {
             txt_hoten.Text    = row["Ten"].ToString();
             txt_ngaysinh.Text = row["Ngaysinh"].ToString();
             txt_gioitinh.Text = row["Gioitinh"].ToString();
             txt_sdt.Text      = row["sdt"].ToString();
             txt_cmt.Text      = row["CMND"].ToString();
             txt_quoctich.Text = row["Quoctich"].ToString();
             txt_email.Text    = row["Email"].ToString();
         }
         panel3.Visible = true;
     }
 }
示例#5
0
 private void bt_nhanphong_Click(object sender, EventArgs e)
 {
     if (dt_checkin.Value > DateTime.Now)
     {
         MessageBox.Show("Ngày nhận phòng lớn hơn ngày hiện tại, vui lòng nhập lại");
     }
     else
     {
         string        test = dt_checkin.Value.ToString("MM/dd/yyyy");
         nhanphong_DTO kh   = new nhanphong_DTO(cb_makhach.Text, txt_maphong.Text, test);
         if (nhanphong_BUS.Instance.themphong(kh))
         {
             MessageBox.Show("Nhận phòng thành công", "Thông Báo");
             this.Close();
             if (nhanphong_BUS.Instance.suatinhtrang(kh))
             {
             }
         }
         else
         {
             MessageBox.Show("fail", "Thông Báo");
         }
     }
 }
示例#6
0
 public DataTable getmakh(nhanphong_DTO temp)
 {
     return(nhanphong_DAO.Instance.getmakh(temp));
 }
示例#7
0
 public bool suatinhtrang(nhanphong_DTO kh)
 {
     return(nhanphong_DAO.Instance.suatinhtrang(kh));
 }
示例#8
0
 public bool themphong(nhanphong_DTO kh)
 {
     return(nhanphong_DAO.Instance.themkh(kh));
 }