基本信息维护/业主信息/OwenrInformation.cs
(开头部分) 5KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace PropertyManagementSystem
{
public partial class OwenrInformation : Form
{
public OwenrInformation()
{
InitializeComponent();
}
//创建ds数据集对象
DataSet ds = new DataSet();
private void OwenrInformation_Load(object sender, EventArgs e)
{
string sql = "select * from Customer";
this.dataGridView1.DataSource = DBHelper.GetDataSet(sql).Tables[0];
}
private void btnSearch_Click(object sender, EventArgs e)
{
//获取筛选条件
string yezhu = txtName.Text;
string pnumber = txtPNumber.Text;
string sql = "select * from Customer where ownerName like '%" + yezhu + "%' and PNumber like '%" + pnumber + "%'";
this.dataGridView1.DataSource = DBHelper.GetDataSet(sql).Tables[0];
}
private void 删除ToolStripMenuItem_Click(object sender, EventArgs e)
{
string id = this.dataGridView1.SelectedRows[0].Cells["roomID"].Value.ToString();
DialogResult r = MessageBox.Show("您确定要删除?", "提示",
MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (r == DialogResult.Yes)
{
string sql = "delete from Customer where roomID=" + id;
bool result = DBHelper.GetExecuteNonQuery(sql);
if (result)
{
MessageBox.Show("删除成功!");
OwenrInformation_Load(sender, e);
}
else
{
MessageBox.Show("删除失败!");
}
}
}
private void 删除ToolStripMenuItem1_Click(object sender, EventArgs e)
{
后面还有 92 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读 AI
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
