예제 #1
0
        private void FillData(int MaGD)
        {
            string      query = " select * from tblNguoi where MaSoGiaDinh ='" + MaGD + "' ";
            clsDatabase cls   = new clsDatabase();
            DataSet     ds    = cls.ExecuteQuery(query);

            dataGridView1.DataSource = ds.Tables[0];
            DatagridviewStyle();
        }
예제 #2
0
        void BtnTimClick(object sender, EventArgs e)
        {
            string query = "spTimKiemHoGiaDinh";

            string[] Paras  = new string[] { "@HoTen", "@CMND", "@DiaChi" };
            string[] Values = new string[] { txtTenNguoi.Text.Trim(), txtCMND.Text.Trim(),
                     txtDiaChi.Text.Trim() };
            clsDatabase cls = new clsDatabase();
            DataSet     ds  = cls.GetData(query, Paras, Values);

            dataGridView1.DataSource = ds.Tables[0];
            DatagridviewStyle();
        }
예제 #3
0
        private void TimKiem()
        {
            string query = "spTimKiemHoSoDatNN";

            string[] Paras  = new string[] { "@flag", "@MaDonViHanhChinh", "@HoTen", "@CMND", "@DiaChi", "@ToBanDo", "@SoThua" };
            string[] Values = new string[] { KieuTimKiem.ToString(), clsConfig.MaDonVihanhChinh, txtTenNguoi.Text.Trim(), txtCMND.Text.Trim(),
                     txtDiaChi.Text.Trim(), txtTBD.Text.Trim(), txtThua.Text.Trim() };
            clsDatabase cls = new clsDatabase();
            DataSet     ds  = cls.GetData(query, Paras, Values);

            dataGridView1.DataSource = ds.Tables[0];
            DatagridviewStyle();
        }
예제 #4
0
 private void btnThue_Click(object sender, EventArgs e)
 {
     try{
         if (textBox1.Text.Trim() != "" || IDThuaDat != 0)
         {
             string      query = " update tblThuaDatCapGCNDatNN set TienDaNop = TienDaNop +" + textBox1.Text.Trim() + " where ID =" + IDThuaDat;
             clsDatabase cls   = new clsDatabase();
             cls.ExecuteQueryInsertUpdateDelete(query);
             this.Close();
         }
     }
     catch (Exception ex)
     { MessageBox.Show(ex.Message); }
 }