private void txtpUserID_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { frmUserInfoSearch _frm = new frmUserInfoSearch(); if (_frm.ShowDialog() == DialogResult.OK) { this.txtpUserID.EditValue = _frm.SelectRowData["UserID"].ToString(); } }
/// <summary> /// 根据工号,查询用户其他信息 /// </summary> private void txtUserID_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { frmUserInfoSearch _frm = new frmUserInfoSearch(); if (_frm.ShowDialog() == DialogResult.OK) { this.txtUserID.EditValue = _frm.SelectRowData["UserID"].ToString();//用户编号 this.txtUserName.EditValue = _frm.SelectRowData["UserName"].ToString();//用户姓名 this.txtSex.EditValue = _frm.SelectRowData["Sex"].ToString();//用户性别 this.txtDutyName.EditValue = _frm.SelectRowData["DutyName"].ToString();//用户职等 this.txtStatus.EditValue = _frm.SelectRowData["User_Status"].ToString();//用户状态 this.txtGuanwei.EditValue = _frm.SelectRowData["GuanweiName"].ToString();//用户关位 this.txtMyTeamName.EditValue = _frm.SelectRowData["myTeamName"].ToString();//向别-班别 } }
/// <summary> /// 选择人员信息 /// </summary> private void txtID_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { frmUserInfoSearch frm = new frmUserInfoSearch(); if (frm.ShowDialog() == DialogResult.OK) { txtUserID.Text = frm.SelectRowData["UserID"].ToString(); txtName.Text = frm.SelectRowData["UserName"].ToString(); CbxSex.Text = frm.SelectRowData["Sex"].ToString(); lookDuty.Text = frm.SelectRowData["DutyName"].ToString(); lookStatus.Text = frm.SelectRowData["user_status"].ToString(); textmyteamName.Text = frm.SelectRowData["myTeamName"].ToString(); textGuanwei.Text = frm.SelectRowData["GuanweiName"].ToString(); textSite.Text = frm.SelectRowData["GuanweiSite"].ToString(); } }
//根据用户id,查询用户其他信息 private void txtUserID_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { frmUserInfoSearch _frm = new frmUserInfoSearch(); if (_frm.ShowDialog() == DialogResult.OK) { this.txtUserID.EditValue = _frm.SelectRowData["UserID"].ToString(); this.txtUserName.EditValue = _frm.SelectRowData["UserName"].ToString(); this.txtmyTeamName.EditValue = _frm.SelectRowData["myTeamName"].ToString(); this.txtGuanwei.EditValue = _frm.SelectRowData["GuanweiName"].ToString(); //取得用户头像 //GetUserImage(); this.pictureEdit1.Image = Image.FromFile(GridCommon.GetUserImageOld(SysParam.m_daoCommon, _frm.SelectRowData["UserID"].ToString())); } }
/// <summary> /// 添加人员信息 /// </summary> private void btnAdd1_Click(object sender, EventArgs e) { try { DataTable dt = null; frmUserInfoSearch frm = new frmUserInfoSearch(); frm.ScanMode = Common.DataModifyMode.add; frm.blSearch = true; if (frm.ShowDialog() == DialogResult.OK) { DataRow[] d = null; DataRow drow; DataRow dr; if (this.gridView1.DataSource != null) //如果表数据不为空的话把表结构给datatable dt = ((DataView)this.gridView1.DataSource).Table; if (dt != null && dt.Rows.Count <= 0) dt = null; for (int i = 0; i <= frm.SelectRowDatas.Count - 1; i++) { drow = (DataRow)frm.SelectRowDatas[i]; if (dt == null) { dt = drow.Table.Clone(); } d = dt.Select("UserID ='" + drow["UserID"] + "'"); if (d.Count() <= 0) { if (!dt.Columns.Contains("SlctValue1")) { dt.Columns.Add("SlctValue1", typeof(Boolean)); dt.Columns.Add("status"); dt.Columns.Add("statusID"); dt.Columns.Add("passWord"); dt.Columns.Add("OperType"); dt.Columns.Add("OperT"); } dr = dt.NewRow(); for (int index = 0; index <= dt.Columns.Count - 1; index++) { if (drow.Table.Columns.Contains(dt.Columns[index].ColumnName)) { dr[dt.Columns[index].ColumnName] = drow[dt.Columns[index].ColumnName]; } } dr["SlctValue1"] = dr["SlctValue"].ToString(); dr["status"] = ""; dr["passWord"] = ""; dr["statusID"] = ""; dr["OperType"] = ""; dr["OperT"] = ""; dt.Rows.Add(dr); dt.AcceptChanges(); } } if (dt == null) { dt = new DataTable(); } this.gridControl1.DataSource = dt.DefaultView; GetRoleDt(); } } catch (Exception ex) { XtraMsgBox.Show("加载数据失败!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error, ex, this.GetType()); } }