private void SaveNewComplain(string query) { DataHelper.UpdateOrDeleteRecord(query); }
private void SaveNewBuilding(string query) { DataHelper.UpdateOrDeleteRecord(query); }
private void SaveNewCommonRepair(string query) { DataHelper.UpdateOrDeleteRecord(query); }
private void 查询Button_Click(object sender, EventArgs e) { string v_计费年份 = this.计费年份ComboBox.Text.Trim(); string v_计费月份 = this.计费月份ComboBox.Text.Trim(); string v_楼栋名称 = this.楼栋名称ComboBox.Text.Trim(); string v_业主姓名 = this.业主姓名ComboBox.Text.Trim(); string v_小区名称 = this.小区名称ComboBox.Text.Trim(); string v_费用状态 = this.费用状态ComboBox.Text.Trim(); if (string.IsNullOrEmpty(v_计费年份) || string.IsNullOrEmpty(v_计费月份) || string.IsNullOrEmpty(v_小区名称) || string.IsNullOrEmpty(v_楼栋名称)) { new MsgBoxForm("提示", "没有选择正确的计费年份,计费月份,小区名称,楼栋名称等信息!").ShowDialog(); return; } dtData.Rows.Clear(); string query = "Select 楼栋名称,业主编号,业主姓名,计费年份,计费月份,费用状态,收据编号,round(sum(应交金额),2) as 应交金额 FROM 水电气费 WHERE (登记标志='完成登记') AND (计费年份= " + v_计费年份 + ")"; string ownerQuery = "Select 业主编号,业主姓名,楼栋名称,物业费用,预存金额,联系电话 from 业主信息 WHERE (业主编号 NOT IN (SELECT 业主编号 FROM 迁出信息))"; string reciptNoQuery = "Select 收据编号 FROM 水电气费 WHERE (登记标志='完成登记') AND (费用状态='已交费') AND (计费年份= " + v_计费年份 + ")"; if (v_计费月份 == "全年") { query += ""; } else { query += " AND (计费月份=" + v_计费月份 + ")"; reciptNoQuery += " AND (计费月份=" + v_计费月份 + ")"; } if (v_小区名称 == "全部") { query += ""; } else { if (v_楼栋名称 == "全部") { query += " AND (楼栋名称 in (select 楼栋名称 from 楼栋信息 where 小区名称='" + v_小区名称 + "'))"; ownerQuery += " AND (楼栋名称 in (select 楼栋名称 from 楼栋信息 where 小区名称='" + v_小区名称 + "'))"; reciptNoQuery += " AND (楼栋名称 in (select 楼栋名称 from 楼栋信息 where 小区名称='" + v_小区名称 + "'))"; } else { query += " AND (楼栋名称='" + v_楼栋名称 + "')"; ownerQuery += " AND (楼栋名称='" + v_楼栋名称 + "')"; reciptNoQuery += " AND (楼栋名称='" + v_楼栋名称 + "')"; } } if (v_业主姓名 == "全部") { query += ""; } else { query += " AND (业主姓名='" + v_业主姓名 + "')"; ownerQuery += " AND (业主姓名='" + v_业主姓名 + "')"; reciptNoQuery += " AND (业主姓名='" + v_业主姓名 + "')"; } if (v_费用状态 == "全部") { query += ""; } else { query += " AND (费用状态='" + v_费用状态 + "')"; } query += " group by 业主编号,计费年份,计费月份"; dtData = DataHelper.GetDataTable(query); if (dtData.Rows.Count == 0) { return; } DataTable ownerTable = DataHelper.GetDataTable(ownerQuery); string reciptQuery = string.Format("select * from 费用收据 where 收据编号 in ({0})", reciptNoQuery); DataTable reciptTable = DataHelper.GetDataTable(reciptQuery); RefreshDataGridView(ownerTable, reciptTable); }
private bool IsNewAdded(string repairNo) { string query = string.Format("select * from 业主维修 where 维修编号='{0}'", repairNo); System.Data.DataTable dt = DataHelper.GetDataTable(query); return dt.Rows.Count < 1; }