private bool KiemTraTonTai() { try { int kq = 0; string query = " select count(*) from tblXetGiaoDatNN Where MaDonViHanhChinh ='" + clsConfig.MaDonVihanhChinh + "' and MaHoSoCapGCNDatNN ='" + clsConfig.MaHoSo + "' "; if (cls.ExecuteQueryScalar(query) != null && cls.ExecuteQueryScalar(query).Trim() != "") { kq = Convert.ToInt32(cls.ExecuteQueryScalar(query)); } if (kq > 0) { return(true); } else { return(false); } } catch (Exception ex) { MessageBox.Show(ex.Message); return(false); } }
private void btnOK_Click(object sender, EventArgs e) { ExecuteProcedure(Flag, false); TrangThaiKetThuc(); if (Flag == 1) { MaDKBD = Convert.ToInt32(cls.ExecuteQueryScalar("Select Max(MaDangKyBienDong) from tblDangKyBienDongDatNN ")); } UpdateQuyetDinh(); ReLoad(); }
private int TimDanhSachHoSoBienDongTruoc(int _MaHoSo) { int kq = 0; string query = " select MaHoSo from tblDangKyBienDongDatNN Where MaHoSoMoi =" + _MaHoSo.ToString(); try { kq = Convert.ToInt32(cls.ExecuteQueryScalar(query)); } catch (Exception ex) { } return(kq); }
private void ThongTinBanDau() { string query = " select Thue from tblHoSoCapGCNDatNN where MaHoSoCapGCNDatNN ='" + clsConfig.MaHoSo + "' "; MucThue = cls.ExecuteQueryScalar(query); // tính tiền còn phải nộp ở đây }
public void TaoHoSoMoi() { if (clsConfig.MaHoSo != 0) { FillData(clsConfig.MaHoSo); } else { string query = " INSERT INTO tblHoSoCapGCNDatNN (MaDonViHanhChinh,TrangThaiHoSo,NgayNhapLieu) " + " VALUES ('" + clsConfig.MaDonVihanhChinh + "' ,2,'" + DateTime.Now.ToString() + "') "; cls.ExecuteQueryInsertUpdateDelete(query); query = " SELECT MAX(MaHoSoCapGCNDatNN) from tblHoSoCapGCNDatNN"; clsConfig.MaHoSo = Convert.ToInt32(cls.ExecuteQueryScalar(query)); FillData(clsConfig.MaHoSo); } }
private void ThemHoGiaDinh() { string[] Paras = new string[] { "@MaSoGiaDinh", "@DaiDien", "@ThanhVien", "@SoNguoi", "@DiaChi", "@KhauChinhThuc", "@KhauXemXet", "@GhiChu" }; string[] Values = new string[] { "", "", "", "", "", "", "", "" }; string spName; spName = "spThemHoGiaDinh"; int kq = cls.ExecuteSP(spName, Paras, Values); if (kq > 0) { //MessageBox.Show("Đã thêm " + kq.ToString() + " hộ gia đình"); string query = " select Max(MaSoGiaDinh) from tblHoGiaDinh "; clsConfig.MaGiaDinh = Convert.ToInt32(cls.ExecuteQueryScalar(query)); btnThem.Enabled = false; } else { MessageBox.Show("Không thêm được hộ gia đình nào!"); } }
private void LayTrangThaiHoSo() { try { if (clsConfig.MaHoSo != 0) { string query = " select TrangThaiHoSo from tblHoSoCapGCNDatNN where MaHoSoCapGCNDatNN ='" + clsConfig.MaHoSo + "' "; if (cls.ExecuteQueryScalar(query) != null && cls.ExecuteQueryScalar(query).ToString() != "") { clsConfig.TrangThaiHoSo = Convert.ToInt32(cls.ExecuteQueryScalar(query)); } } else { clsConfig.TrangThaiHoSo = 1; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }