Beispiel #1
0
        public void SuaPhong(GIA_THUE gIA_)
        {
            GIA_THUE a = ql.GIA_THUE.Where(x => x.SoNguoi == gIA_.SoNguoi).SingleOrDefault();

            a.GiaTien = gIA_.GiaTien;
            ql.SaveChanges();
        }
        private void dataGridView1_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            object   u    = dataGridView1.SelectedRows[0].Cells[0].Value;
            int      sn   = Convert.ToInt32(u.ToString());
            GIA_THUE gIA_ = ptbll.gIA_THUE(sn);

            txtSoNguoi.Text = gIA_.SoNguoi.ToString();
            var info = System.Globalization.CultureInfo.GetCultureInfo("vi-VN");

            txtGiaTien.Text = string.Format("{0:N}", gIA_.GiaTien);
            butSua.Enabled  = true;
        }
Beispiel #3
0
        public void ThemPhong(GIA_THUE gIA_)
        {
            int so = ql.GIA_THUE.Where(x => x.SoNguoi == gIA_.SoNguoi).Select(e => e.SoNguoi).SingleOrDefault();

            if (so != gIA_.SoNguoi)
            {
                ql.GIA_THUE.Add(gIA_);
                ql.SaveChanges();
            }

            else
            {
                MessageBox.Show("Mời kiểm tra lại thông tin!");
            }
        }
Beispiel #4
0
        private void butThem_Click(object sender, EventArgs e)
        {
            try
            {
                GIA_THUE gIA_ = new GIA_THUE
                {
                    SoNguoi = Convert.ToInt32(txtSoNguoi.Text),
                    GiaTien = Convert.ToDecimal(txtGiaTien.Text)
                };

                pt.Addgiaphong(gIA_);
                MessageBox.Show("Thêm Thành Công!", "OK", MessageBoxButtons.OK);
                t();
            }
            catch (Exception r)
            {
                MessageBox.Show("Mời kiểm tra lại thông tin!", "OK", MessageBoxButtons.OK);
            }
        }
        private void butSua_Click(object sender, EventArgs e)
        {
            object u  = dataGridView1.SelectedRows[0].Cells[0].Value;
            int    sn = Convert.ToInt32(u.ToString());

            try
            {
                if (MessageBox.Show("Bạn có chắc muốn sửa phòng này?", "Sửa", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    GIA_THUE gIA_ = new GIA_THUE
                    {
                        SoNguoi = Convert.ToInt32(txtSoNguoi.Text),
                        GiaTien = Convert.ToDecimal(txtGiaTien.Text)
                    };
                    ptbll.SuaPhong(gIA_);
                    MessageBox.Show("Sửa thành công!", "OK", MessageBoxButtons.OK);
                }
            }
            catch (Exception es)
            {
                MessageBox.Show("Mời kiểm tra lại thông tin!", "OK", MessageBoxButtons.OK);
            }
        }
Beispiel #6
0
 public void SuaPhong(GIA_THUE a)
 {
     ptdal.SuaPhong(a);
 }
Beispiel #7
0
 public void Addgiaphong(GIA_THUE a)
 {
     ptdal.ThemPhong(a);
 }