public DataTable GetmmmBUS(ThongTinKhachThueEntities l)
        {
            DataTable dt = null;

            dt = userTTDAO.Getmmm(l);
            return(dt);
        }
        public DataTable GetBUS(ThongTinKhachThueEntities add)
        {
            DataTable dt = null;

            dt = userTTDAO.GetTT(add);
            return(dt);
        }
Beispiel #3
0
        public void btn_TraPhong_Click(object sender, EventArgs e)
        {
            //string q, w, p;

            HoaDonEntities hd = new HoaDonEntities();

            hd.Phong      = ID;
            hd.Ten        = lb_contentNguoiThue.Text;
            hd.Sdt        = lb_contentSDT.Text;
            hd.NgayVao    = lb_contentNgayVao.Text;
            hd.NgayTra    = Convert.ToString(System.DateTime.Today.ToString());
            hd.SoDien     = txt_contentDien.Text;
            hd.SoNuoc     = txt_contentNuoc.Text;
            hd.SoInternet = txt_contentInternet.Text;
            hd.TongCong   = lb_TongCong.Text;
            HoaDonBUS hdbus = new HoaDonBUS();
            DataTable dtt   = hdbus.ThemHDBUS(hd);

            PhongEntities             ee = new PhongEntities();
            ThongTinKhachThueEntities c  = new ThongTinKhachThueEntities();

            c.ID       = Convert.ToInt32(ID);
            c.Ten      = null;
            c.NgaySinh = null;
            //w = "";
            c.GioiTinh = Convert.ToBoolean(null);
            //q = "";
            c.CMND = Convert.ToInt32(null);
            //c.CMND = Convert.ToInt32(lb_contentCMND.Text);
            c.NgayCap = "";
            c.NoiCap  = "";
            c.NgayVao = "";
            //p = "";
            c.Sdt = Convert.ToInt32(null);
            //c.PhongId = Convert.ToInt32("");

            ee.HienTrang = mm;
            ee.Id        = Convert.ToInt32(ID);
            ThongTinKhachThueBUS cbus = new ThongTinKhachThueBUS();
            DataTable            dt   = cbus.GetTKBUS(c);
            PhongBUS             t    = new PhongBUS();
            DataTable            tt   = t.GetUpdate(ee);

            MessageBox.Show("Trả " + label3.Text + " thành công.");
            homee.doimauu(b1);
            Close();
        }
Beispiel #4
0
        private void TraPhong_Load(object sender, EventArgs e)
        {
            mm = "ConTrong";
            ThongTinKhachThueEntities table = new ThongTinKhachThueEntities();

            //string q, w;
            lb_contentCMND.Text = "0";
            lb_contentSDT.Text  = "0";
            ID = string.Format("{0}", label3.Text.Substring(6));
            ThongTinKhachThueEntities c = new ThongTinKhachThueEntities();

            c.ID = Convert.ToInt32(ID);
            ThongTinKhachThueBUS ll = new ThongTinKhachThueBUS();
            DataTable            dt = ll.Get(c);

            if (dt.Rows.Count > 0)
            {
                for (int p = 0; p < dt.Rows.Count; p++)
                {
                    table.ID       = Convert.ToInt32(dt.Rows[p][0].ToString());
                    table.Ten      = dt.Rows[p][1].ToString();
                    table.NgaySinh = dt.Rows[p][2].ToString();
                    table.GioiTinh = Convert.ToBoolean(dt.Rows[p][3].ToString());
                    table.CMND     = Convert.ToInt32(dt.Rows[p][4].ToString());
                    table.NgayCap  = dt.Rows[p][5].ToString();
                    table.NoiCap   = dt.Rows[p][6].ToString();
                    table.NgayVao  = dt.Rows[p][7].ToString();
                    table.Sdt      = Convert.ToInt32(dt.Rows[p][8].ToString());


                    lb_contentNguoiThue.Text = string.Format("{0}", dt.Rows[p][1].ToString());
                    lb_contentCMND.Text      = string.Format("{0}", dt.Rows[p][4].ToString());
                    lb_contentSDT.Text       = string.Format("{0}", dt.Rows[p][8].ToString());
                    lb_contentNgayVao.Text   = string.Format("{0}", dt.Rows[p][7].ToString());
                }
            }
        }
        public DataTable Getmmm(ThongTinKhachThueEntities l)
        {
            string sql = "select * from ThongTinKhachThue where Ten ='" + l.Ten + "'";

            return(getDataTable(sql));
        }
        public DataTable GetKT(ThongTinKhachThueEntities add)
        {
            string sql = "update ThongTinKhachThue set Ten='" + add.Ten + "',NgaySinh='" + add.NgaySinh + "',GioiTinh='" + add.GioiTinh + "',Cmnd='" + add.CMND + "',NgayCap='" + add.NgayCap + "',NoiCap='" + add.NgayCap + "',NgayVao='" + add.NgayCap + "',Sdt='" + add.Sdt + "',PhongId='" + add.PhongId + "' where ID=" + add.ID;

            return(getDataTable(sql));
        }
        public DataTable GetTT(ThongTinKhachThueEntities ttkt)
        {
            string sql = "select * from ThongTinKhachThue";

            return(getDataTable(sql));
        }
        public DataTable GetTK(ThongTinKhachThueEntities user)
        {
            string sql = "select * from ThongTinKhachThue where Ten!='' ";

            return(getDataTable(sql));
        }
Beispiel #9
0
        private void button1_Click(object sender, EventArgs e)
        {
            ThongTinKhachThueEntities c  = new ThongTinKhachThueEntities();
            LichSuEntities            d  = new LichSuEntities();
            PhongEntities             ee = new PhongEntities();


            if (textBox1.Text == "")
            {
                MessageBox.Show("Xin nhặp tên");
                textBox1.Focus();
            }
            else
            {
                if (checkBox1.Checked || checkBox2.Checked == true)
                {
                    if (textBox11.Text == "")
                    {
                        MessageBox.Show("Xin nhặp CMND");
                        textBox11.Focus();
                    }
                    else
                    {
                        if (comboBox3.Text == "")
                        {
                            MessageBox.Show("Xin chọn nơi cấp");
                            comboBox3.Focus();
                        }
                        else
                        {
                            if (textBox10.Text == "")
                            {
                                MessageBox.Show("Xin nhặp SĐT");
                                textBox10.Focus();
                            }
                            else
                            {
                                c.Ten      = textBox1.Text;
                                c.NgaySinh = dateTimePicker1.Text;
                                if (checkBox1.Checked == true)
                                {
                                    c.GioiTinh = true;
                                }
                                else
                                {
                                    c.GioiTinh = false;
                                }
                                if (checkBox2.Checked == true)
                                {
                                    c.GioiTinh = false;
                                }
                                else
                                {
                                    c.GioiTinh = true;
                                }

                                c.CMND    = Convert.ToInt32(textBox11.Text);
                                c.NgayCap = Convert.ToString(dateTimePicker4.Text);
                                c.NoiCap  = comboBox3.Text;
                                c.NgayVao = Convert.ToString(dateTimePicker5.Text);
                                c.Sdt     = Convert.ToInt32(textBox10.Text);
                                c.ID      = Convert.ToInt32(ID);

                                d.Ten      = textBox1.Text;
                                d.NgaySinh = Convert.ToString(dateTimePicker1.Text);
                                if (checkBox1.Checked == true)
                                {
                                    d.GioiTinh = true;
                                }
                                else
                                {
                                    d.GioiTinh = false;
                                }
                                if (checkBox2.Checked == true)
                                {
                                    d.GioiTinh = false;
                                }
                                else
                                {
                                    d.GioiTinh = true;
                                }

                                d.CMND    = Convert.ToInt32(textBox11.Text);
                                d.NgayCap = dateTimePicker4.Text;
                                d.NoiCap  = comboBox3.Text;
                                d.NgayVao = Convert.ToString(dateTimePicker5.Text);
                                d.Sdt     = Convert.ToInt32(textBox10.Text);
                                d.ID      = Convert.ToInt32(ID);

                                ee.HienTrang = mm;
                                ee.Id        = Convert.ToInt32(ID);
                                ThongTinKhachThueBUS cbus = new ThongTinKhachThueBUS();
                                DataTable            dt   = cbus.GetTKBUS(c);
                                LichSuBUS            a    = new LichSuBUS();
                                DataTable            s    = a.ThemLSBUS(d);
                                PhongBUS             t    = new PhongBUS();
                                DataTable            tt   = t.GetUpdate(ee);

                                MessageBox.Show("Thuê " + label3.Text + " thành công.");

                                home.doimau(b);
                                Close();
                            }
                        }
                    }
                }
                else
                {
                    MessageBox.Show("Hãy chọn giới tính");
                }
            }
        }