private void butUserDel_Click(object sender, System.EventArgs e) { string text = this.dgvUserAll.CurrentRow.Cells[0].Value.ToString(); DialogResult dialogResult = EcoMessageBox.ShowWarning(EcoLanguage.getMsg(LangRes.UsrInfo_delCrm, new string[0]), MessageBoxButtons.OKCancel); if (dialogResult == DialogResult.Cancel) { return; } int num = UserMaintain.DeleteByName(text); if (num < 0) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.UsrInfo_delfail, new string[] { text })); return; } EcoGlobalVar.setDashBoardFlg(8192uL, "USER:"******"Username"); if (!string.IsNullOrEmpty(valuePair)) { LogAPI.writeEventLog("0330001", new string[] { text, valuePair }); } else { LogAPI.writeEventLog("0330001", new string[] { text }); } this.changeTreeSelect(""); }
private void UsertreeInit() { this.tvUser.Nodes.Clear(); TreeNode treeNode = new TreeNode(); treeNode.Text = EcoLanguage.getMsg(LangRes.UserRoot, new string[0]); treeNode.Name = "UserRoot"; treeNode.Tag = "UserRoot"; this.tvUser.Nodes.Add(treeNode); System.Collections.Generic.List <UserInfo> allUsers = UserMaintain.getAllUsers(); for (int i = 0; i < allUsers.Count; i++) { UserInfo userInfo = allUsers[i]; string userName = userInfo.UserName; TreeNode treeNode2 = new TreeNode(); treeNode2.Text = userName; int userType = userInfo.UserType; int userStatus = userInfo.UserStatus; treeNode2.Name = userType + "|" + userStatus; treeNode2.Tag = "User"; treeNode.Nodes.Add(treeNode2); } }
private void butUserAdd_Click(object sender, System.EventArgs e) { System.Collections.Generic.List <UserInfo> allUsers = UserMaintain.getAllUsers(); int num = 8; if (allUsers.Count >= num) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.UsrInfo_limit, new string[] { num.ToString() })); return; } UserManAddUser userManAddUser = new UserManAddUser(); DialogResult dialogResult = userManAddUser.ShowDialog(); if (dialogResult == DialogResult.Cancel) { return; } string userNM = userManAddUser.UserNM; this.changeTreeSelect(userNM); }
private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { if (e.Node.Text.Trim() == "用户维护") { homeContent.Controls.Clear(); UserMaintain um = new UserMaintain(); homeContent.Controls.Add(um); um.Dock = DockStyle.Fill; } //if (e.Node.Text.Trim() == "用户权限") //{ // homeContent.Controls.Clear(); // UserJurisdiction uj = new UserJurisdiction(); // homeContent.Controls.Add(uj); // uj.Dock = DockStyle.Fill; //} //if (e.Node.Text.Trim() == "物品资料") //{ // homeContent.Controls.Clear(); // MerchandiseData md = new MerchandiseData(); // homeContent.Controls.Add(md); // md.Dock = DockStyle.Fill; //} if (e.Node.Text.Trim() == "库位绑定") { homeContent.Controls.Clear(); MerchandiseQuery mq = new MerchandiseQuery(); homeContent.Controls.Add(mq); mq.Dock = DockStyle.Fill; } if (e.Node.Text.Trim() == "当前命令") { homeContent.Controls.Clear(); OrderInfo oi = new OrderInfo(); homeContent.Controls.Add(oi); oi.Dock = DockStyle.Fill; } if (e.Node.Text.Trim() == "历史数据") { homeContent.Controls.Clear(); LocationData ld = new LocationData(); homeContent.Controls.Add(ld); ld.Dock = DockStyle.Fill; } if (e.Node.Text.Trim() == "物料入库") { homeContent.Controls.Clear(); OneIn oi = new OneIn(); homeContent.Controls.Add(oi); oi.Dock = DockStyle.Fill; } if (e.Node.Text.Trim() == "整批入库") { MessageBox.Show("整批入库"); } if (e.Node.Text.Trim() == "空箱入库") { MessageBox.Show("空箱入库"); } if (e.Node.Text.Trim() == "物料出库") { homeContent.Controls.Clear(); OneOut oo = new OneOut(); homeContent.Controls.Add(oo); oo.Dock = DockStyle.Fill; } if (e.Node.Text.Trim() == "整批出库") { MessageBox.Show("整批出库"); } if (e.Node.Text.Trim() == "日(月)报表") { MessageBox.Show("日(月)报表"); } if (e.Node.Text.Trim() == "储位数据报表") { homeContent.Controls.Clear(); LocationDataReport ldr = new LocationDataReport(); homeContent.Controls.Add(ldr); ldr.Dock = DockStyle.Fill; } if (e.Node.Text.Trim() == "库对库") { MessageBox.Show("库对 库"); } if (e.Node.Text.Trim() == "站对站") { MessageBox.Show("站对站"); } if (e.Node.Text.Trim() == "库存盘点") { homeContent.Controls.Clear(); TakeStock ts = new TakeStock(); homeContent.Controls.Add(ts); ts.Dock = DockStyle.Fill; } if (e.Node.Text.Trim() == "拣料物料") { homeContent.Controls.Clear(); PickMaterial pm = new PickMaterial(); homeContent.Controls.Add(pm); pm.Dock = DockStyle.Fill; } }
public void pageInit(UserManPage.UserManPage pParent, string userName) { this.m_pParent = pParent; this.in_init = true; this.pageInit_1(); this.m_CurUser = UserMaintain.getUserByName(userName); if (this.m_CurUser == null) { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.UsrInfo_nofind, new string[] { userName })); this.in_init = false; return; } this.tbUserNmEdit.Text = this.m_CurUser.UserName; this.tbUserPwEdit.Text = this.m_CurUser.UserPwd; this.tbUserCPwEdit.Text = this.m_CurUser.UserPwd; int userType = this.m_CurUser.UserType; if (userType == 0) { this.rbRole2.Checked = true; if ((this.m_CurUser.UserRight & 1) != 0) { this.cbUManagement.Checked = true; } else { this.cbUManagement.Checked = false; } if ((this.m_CurUser.UserRight & 2) != 0) { this.cbDManagement.Checked = true; } else { this.cbDManagement.Checked = false; } if ((this.m_CurUser.UserRight & 4) != 0) { this.cbSManagement.Checked = true; } else { this.cbSManagement.Checked = false; } if ((this.m_CurUser.UserRight & 8) != 0) { this.cbLog.Checked = true; } else { this.cbLog.Checked = false; } this.cbUManagement.Enabled = true; this.cbDManagement.Enabled = true; this.cbSManagement.Enabled = true; this.cbSelectAll.Enabled = true; this.cbSelectAll.Checked = false; this.butSetDevice.Hide(); } else { this.rbRole1.Checked = true; if ((this.m_CurUser.UserRight & 8) != 0) { this.cbLog.Checked = true; } else { this.cbLog.Checked = false; } this.cbUManagement.Enabled = false; this.cbDManagement.Enabled = false; this.cbSManagement.Enabled = false; this.cbSelectAll.Enabled = false; this.butSetDevice.Show(); } this.m_deviceIds = this.m_CurUser.UserDevice; this.m_groupIds = this.m_CurUser.UserGroup; this.tbUserNmEdit.Enabled = true; this.tbUserPwEdit.Enabled = true; this.tbUserCPwEdit.Enabled = true; if (userName.Equals("administrator")) { this.tbUserNmEdit.Enabled = false; this.rbRole2.Enabled = false; this.rbRole1.Enabled = false; this.cbUManagement.Enabled = false; this.cbDManagement.Enabled = false; this.cbLog.Enabled = false; this.cbSManagement.Enabled = false; this.cbSelectAll.Enabled = false; } this.in_init = false; }