主页面/GuanLiYuan.cs
(开头部分) 3KB这里只显示每个文件的开头 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;
namespace PropertyManagementSystem
{
public partial class GuanLiYuan : Form
{
public GuanLiYuan()
{
InitializeComponent();
}
private void GuanLiYuan_Load(object sender, EventArgs e)
{
string sql = "select id,userName,userPwd,companyName,companyAddress,phone,name,userGender,userAge,IDCard,mailBox, iif((loginType=0),'超级管理员','普通管理员')loginType from Users where loginType = '2'";
this.dataGridView1.DataSource = DBHelper.GetDataSet(sql).Tables[0];
}
private void label3_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
string name = this.textBox1.Text.ToString().Trim();
string phone = this.textBox2.Text.ToString().Trim();
string sex = "";
if (radioButton1.Checked)
{
sex = "男";
}
else
{
sex = "女";
}
try
{
string sql = string.Format("select id,userName,userPwd,companyName,companyAddress,phone,name,userGender,userAge,IDCard,mailBox, iif((loginType=0),'超级管理员','普通管理员')loginType from Users where userName like '%"+name+"%' and phone like '%"+phone+"%' and userGender like '%"+sex+"%'");
this.dataGridView1.DataSource = DBHelper.GetDataSet(sql).Tables[0];
}
catch (Exception ex)
{
MessageBox.Show("加载时发生错误!请联系系统管理员\n原因:" + ex.Message, "错误信息");
}
}
private void 删除ToolStripMenuItem_Click_1(object sender, EventArgs e)
{
string id = this.dataGridView1.SelectedRows[0].Cells["id"].Value.ToString();
DialogResult r = MessageBox.Show("您确定要删除吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (r == DialogResult.Yes)
后面还有 38 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
