private void SearchWuFuTaskBill_Load(object sender, EventArgs e) { if (IsPingJia) { label2.Visible = false; comboBox2.Visible = false; label1.Visible = false; comboBox1.Visible = false; button1.Visible = false; BindData(); } else { if (Util.User.UserType == UserType.业主) { label2.Visible = false; comboBox2.Visible = false; } var list = new HHDapperSql().Query <MUser>("select * from MUser order by UserName "); comboBox2.Items.Clear(); comboBox2.Items.Add(""); foreach (MUser user in list) { comboBox2.Items.Add(user.UserName); } } }
private void button1_Click(object sender, EventArgs e) { var name = txtName.Text.Trim(); var pwd = txtPwd.Text.Trim(); var user = new HHDapperSql().Query <MUser>("select * from MUser where UserName='******' and UserPwd='" + pwd + "'").FirstOrDefault(); if (user == null) { MessageBox.Show("用户名或密码错误"); return; } Util.User = user; this.Hide(); if (user.UserType == UserType.管理员) { var f = new MainForm(); f.Show(); } else if (user.UserType == UserType.物业员工) { var f = new YuanGongLogin(); f.Show(); } else if (user.UserType == UserType.业主) { var f = new YeZhuLogin(); f.Show(); } else if (user.UserType == UserType.物业管理) { var f = new WuYeLogin(); f.Show(); } }
private void TaskBillEdit_Load(object sender, EventArgs e) { string sql = "select bill.PingJia,bill.Id,task.TName,task.TContent,bill.YeZhuDateTime,ywy.UserName as 'YeWuYuanName',yz.UserName as 'YuZhuName', bill.YeWuYuanJieShouDateTime,bill.YeWuYuanWanChengDateTime,bill.BillState from FuWuTaskBill bill left join FuWuTask task on bill.FuWuTaskId=task.Id left join MUser ywy on bill.YeWuYuanId=ywy.Id left join MUser yz on bill.YeZhuId=yz.Id where bill.Id='" + mId + "' "; var dt = new HHDapperSql().ExecuteDataSet(sql).Tables[0]; if (dt.Rows.Count < 1) { return; } var row = dt.Rows[0]; if (Util.User.UserType == UserType.物业员工 && row["BillState"] != null && (string)row["BillState"] == BillState.进行中) { button1.Visible = true; } else { button1.Visible = false; } txtTName.Text = row["TName"].ToString(); richTextBox1.Text = objtostring(row["TContent"]); txtYeZhuName.Text = objtostring(row["YuZhuName"]); txtCreateTime.Text = objtostring(row["YeZhuDateTime"]); txtBillState.Text = objtostring(row["BillState"]); txtYeWuYuanName.Text = objtostring(row["YeWuYuanName"]); txtFinishDateTime.Text = objtostring(row["YeWuYuanWanChengDateTime"]); txtPingJia.Text = objtostring(row["PingJia"]); if (IsPingJia) { button1.Text = "确 定 评 价"; button1.Visible = true; } else { lblPingJia.Visible = false; txtPingJia.Visible = false; } }
private void BindDataGrid() { var list = new HHDapperSql().Query <MUser>("select * from MUser where UserName <> 'admin' order by Id desc"); dataGridView1.DataSource = list; }
private void BindDataGrid() { var list = new HHDapperSql().Query <FuWuTask>("select * from FuWuTask order by Id desc"); dataGridView1.DataSource = list; }