private void btnSave_Click(object sender, EventArgs e) { bds.EndEdit(); ClsD.TextBoxTrim(grpMain); if (string.IsNullOrEmpty(txtMC.Text)) { ClsMsgBox.Jg("序号不可为空!"); txtMC.Focus(); return; } try { tjigouTableAdapter1.Update(dSjckja1.tjigou); trV.SelectedNode.Name = lblld.Text; trV.SelectedNode.Text = txtJc.Text; if (!trV.Enabled) { trV.Enabled = true; } } catch (Exception ex) { ClsMsgBox.Cw("保存机构信息时遇到了如下错误:", ex); } }
private void btnSave_Click(object sender, EventArgs e) { #region 空值判断 ClsD.TextBoxTrim(this); if (string.IsNullOrEmpty(txtDm.Text)) { ClsMsgBox.Jg("代码不可为空!"); return; } if (!ClsReg.AlphaNumeric.IsMatch(txtDm.Text)) { ClsMsgBox.Jg("代码包含非字母数字字符!"); return; } if (string.IsNullOrEmpty(txtMc.Text)) { ClsMsgBox.Jg("名称不可为空!"); return; } #endregion try { bds.EndEdit(); toptionlbTableAdapter1.Update(dsJckja1.toptionlb); if (NED == EnumNED.NEW) { ClsD.TurnDgvToBdsCurrRec(dgv); } this.DialogResult = DialogResult.OK; } catch (Exception ex) { ClsMsgBox.Cw("保存选项项目时遇到了错误:", ex); } }
private void btnOK_Click(object sender, EventArgs e) { #region 账户或口令为空判断 txtLoginName.Text = txtLoginName.Text.Trim(); if (string.IsNullOrEmpty(txtLoginName.Text)) { ClsMsgBox.Jg("账户不能为空!"); return; } txtPassword.Text = txtPassword.Text.Trim(); if (string.IsNullOrEmpty(txtPassword.Text)) { ClsMsgBox.Jg("口令不能为空!"); return; } #endregion //获取用户信息 vusersTableAdapter uta = new vusersTableAdapter(); DSjckja.vusersDataTable u = uta.GetDataByLoginName(txtLoginName.Text); DSjckja.vusersRow userRow = u.Rows.Count == 0 ? null : (DSjckja.vusersRow)u.Rows[0]; #region 账户、口令有效性判断 if (userRow == null) { ClsMsgBox.Jg("账户不存在!"); return; } //判断口令 if (string.Compare(txtPassword.Text, userRow.password, false) != 0) { ClsMsgBox.Jg("口令不正确!"); return; } //判断活动状态 if (!userRow.active) { ClsMsgBox.Jg("此用户为非活动用户,不允许登录系统!"); return; } #endregion #region 是否保存到cookie if (chkAutoSave.Checked) { Context.Cookies["Account"] = txtLoginName.Text; Context.Cookies["Password"] = txtPassword.Text; } else { Context.Cookies["Account"] = ""; Context.Cookies["Password"] = ""; } #endregion //将登陆用户信息保存到session VWGContext.Current.Session["userRow"] = userRow; this.Context.Session.IsLoggedOn = true;//允许打开实际的窗体 }
private void btnSave_Click(object sender, EventArgs e) { txtPW.Text.Trim(); if (txtPW.Text.Length < nUDMinPWLen.Value) { ClsMsgBox.Jg("Ô¤ÖÿÚÁ¶È²»×ã!"); return; } ClsMSSQL.SetConfigItem("MinPWLen", nUDMinPWLen.Value, ClsDBCon.ConStrKj); ClsMSSQL.SetConfigItem("DefaultPassWord", txtPW.Text, ClsDBCon.ConStrKj); }
private void mnuDel_Click(object sender, EventArgs e) { if (trV.SelectedNode.HasNodes) { ClsMsgBox.Jg("本结点不是末端结点,不允许删除!"); } else { ClsMsgBox.YesNo("确实要删除当前模块吗?", deleting); } }
public override void Call(int aId, string aBm, string aMc) { #region 系统管理 //模块管理 if (string.Compare(aBm, "xtgl-mkgl", true) == 0) { FrmMKGL c = new FrmMKGL(); tp.Controls.Clear(); tp.Controls.Add(c); return; } #endregion ClsMsgBox.Jg(aId + "," + aBm + "," + aMc + Environment.NewLine + "此功能正在实现中"); }
private void btnSave_Click(object sender, EventArgs e) { #region 空值判断及数据验证 ClsD.TextBoxTrim(this); if (string.IsNullOrEmpty(txtXm.Text)) { ClsMsgBox.Jg("姓名不可为空!"); return; } if (string.IsNullOrEmpty(txtLoginName.Text)) { ClsMsgBox.Jg("账户不可为空!"); return; } if (string.IsNullOrEmpty(txtPassword.Text)) { ClsMsgBox.Jg("口令不可为空!"); return; } if (txtPassword.Text.Length < minPwLen) { ClsMsgBox.Jg(string.Format("口令长度小于{0}!", minPwLen)); return; } if (cmbRole.SelectedValue == null) { ClsMsgBox.Jg("角色不能为空!"); return; } if (cmbJgTree.SelectedValue == null) { ClsMsgBox.Jg("下拉列表不能为空"); return; } #endregion try { bds.EndEdit(); tygTableAdapter1.Update(dsJckja1.tyg); if (NED == EnumNED.NEW) { ClsD.TurnDgvToBdsCurrRec(dgv); } this.DialogResult = DialogResult.OK; } catch (Exception ex) { ClsMsgBox.Cw("保存员工时遇到了错误:", ex); } }
private void btnSave_Click(object sender, EventArgs e) { #region 空值判断及数据验证 ClsD.TextBoxTrim(this); if (!ClsReg.Naturalnum.IsMatch(txtXh.Text)) { ClsMsgBox.Jg("序号必须为整数!"); } if (string.IsNullOrEmpty(txtPm.Text)) { ClsMsgBox.Jg("品名不可为空!"); return; } if (string.IsNullOrEmpty(txtBm.Text)) { ClsMsgBox.Jg("编码不可为空!"); return; } if (string.IsNullOrEmpty(txtDw.Text)) { ClsMsgBox.Jg("单位不可为空!"); return; } if (!ClsReg.RMB.IsMatch(txtDj.Text)) { ClsMsgBox.Jg("单价数据不正确!"); return; } if (!ClsReg.Naturalnum.IsMatch(txtSl.Text)) { ClsMsgBox.Jg("数量必须为整数!"); return; } #endregion try { bds.EndEdit(); if (NED == EnumNED.NEW) { ClsD.TurnDgvToBdsCurrRec(dgv); } this.DialogResult = DialogResult.OK; } catch (Exception ex) { ClsMsgBox.Cw("保存进货明细时遇到了错误:", ex); } }
private void btnDel_Click(object sender, EventArgs e) { //数据表为空时不执行本操作 if (bds.Current == null) { return; } Datasets.DSjckja.toptionlbRow r = (Datasets.DSjckja.toptionlbRow)(((DataRowView)bds.Current).Row); string cmd = "SELECT * FROM toptionxm WHERE lbdm =" + ClsQ.Q1(r.dm); if (ClsMSSQL.Exists(cmd, ClsDBCon.ConStrKj)) { ClsMsgBox.Jg("该类别下存在项目无法删除"); return; } ClsMsgBox.YesNo("确定要删除该记录吗?", deleting); }
private void mnuNewChild_Click(object sender, EventArgs e) { if (trV.SelectedNode.Level == 5) { ClsMsgBox.Jg("机构层次不允许超过5级。"); return; } trV.Enabled = false; TreeNode tn = new TreeNode("*"); trV.SelectedNode.Nodes.Add(tn); trV.SelectedNode = tn; dSjckja1.tjigou.Rows.Clear(); DSjckja.tjigouRow r = (DSjckja.tjigouRow)((DataRowView)bds.AddNew()).Row; r.jb = Convert.ToByte(trV.SelectedNode.Level); r.pid = Int32.Parse(tn.Parent.Name); }
private void btnFuncs_Click(object sender, EventArgs e) { if (bds.Current == null) { return; } DSjckja.trolesRow r = (DSjckja.trolesRow)(((DataRowView)bds.Current).Row); if (r.qx < 1024) { ClsMsgBox.Jg("该角色为系统管理类角色,不需要设置可访问的功能模块。"); return; } FrmRoleFuncs f = new FrmRoleFuncs(); f.Prepare(r.id, r.mc); f.ShowDialog(); }
private void btnSave_Click(object sender, EventArgs e) { bds.EndEdit(); ClsD.TextBoxTrim(grpMain); if (string.IsNullOrEmpty(txtXh.Text)) { ClsMsgBox.Jg("序号不可为空!"); txtXh.Focus(); return; } if (!ClsReg.Naturalnum.IsMatch(txtXh.Text)) { ClsMsgBox.Jg("序号必须为数字!"); txtXh.Focus(); return; } if (string.IsNullOrEmpty(txtMc.Text)) { ClsMsgBox.Jg("名称不可为空!"); txtMc.Focus(); return; } if (string.IsNullOrEmpty(txtBm.Text)) { ClsMsgBox.Jg("编码不可为空!"); txtBm.Focus(); return; } try { tfuncsTableAdapter1.Update(dSjckja1.tfuncs); trV.SelectedNode.Name = lblld.Text; trV.SelectedNode.Text = txtMc.Text; trV.SelectedNode.Tag = txtBm.Text; if (!trV.Enabled) { trV.Enabled = true; } } catch (Exception ex) { ClsMsgBox.Cw("保存模块信息时遇到了如下错误:", ex); } }
private void btnOK_Click(object sender, EventArgs e) { #region 账户或口令为空判断 txtLoginName.Text = txtLoginName.Text.Trim(); if (string.IsNullOrEmpty(txtLoginName.Text)) { ClsMsgBox.Jg("账号不能为空!"); return; } txtPassword.Text = txtPassword.Text.Trim(); if (string.IsNullOrEmpty(txtPassword.Text)) { ClsMsgBox.Jg("口令不能为空!"); return; } #endregion #region 账户、口令有效性判断 if (!ClsMSSQL.Exists("tlogin", "loginname", txtLoginName.Text, ClsDBCon.ConStrKj)) { ClsMsgBox.Jg("账户不存在!"); return; } #endregion string cmd = string.Format("SELECT * FROM tlogin WHERE loginname = '{0}' AND " + "password = '******'", txtLoginName.Text, txtPassword.Text); if (!ClsMSSQL.Exists(cmd, ClsDBCon.ConStrKj)) { ClsMsgBox.Jg("口令不正确"); return; } #region 是否保存到cookie if (chkAutoSave.Checked) { Context.Cookies["Account"] = txtLoginName.Text; Context.Cookies["Password"] = txtPassword.Text; } else { Context.Cookies["Account"] = ""; Context.Cookies["Password"] = ""; } #endregion this.Context.Session.IsLoggedOn = true; }
private void btnSave_Click(object sender, EventArgs e) { #region 空值判断及数据验证 ClsD.TextBoxTrim(this); if (string.IsNullOrEmpty(txtJhdh.Text)) { ClsMsgBox.Jg("进货单不可为空!"); return; } if (string.IsNullOrEmpty(txtGhsh.Text)) { ClsMsgBox.Jg("供货单不可为空!"); return; } #endregion try { bds.EndEdit(); tableAdapterManager1.UpdateAll(dsJxc1); DataTable dt = dsJxc.Tables["vjhmxhj"]; DataRow[] r = dt.Select(string.Format("jhdId={0}", lblId.Text)); if (r.Length > 0) { r[0]["hj"] = string.IsNullOrEmpty(lblHj.Text) ? "0" : lblHj.Text; } if (NED == EnumNED.NEW) { ClsD.TurnDgvToBdsCurrRec(dgvMaster); } this.DialogResult = DialogResult.OK; } catch (Exception ex) { ClsMsgBox.Cw("保存进货单时遇到了错误:", ex); } }
private void btnSave_Click(object sender, EventArgs e) { #region 空值判断 ClsD.TextBoxTrim(this); if (string.IsNullOrEmpty(txtfax.Text)) { ClsMsgBox.Jg("传真不可为空!"); return; } if (string.IsNullOrEmpty(txtmetl.Text)) { ClsMsgBox.Jg("号码不可为空!"); return; } if (string.IsNullOrEmpty(txtQQ.Text)) { ClsMsgBox.Jg("QQ不可为空!"); return; } if (string.IsNullOrEmpty(txtwx.Text)) { ClsMsgBox.Jg("微信不可为空!"); return; } if (string.IsNullOrEmpty(txtxm.Text)) { ClsMsgBox.Jg("姓名不可为空!"); } if (!ClsReg.AlphaNumeric.IsMatch(txtfax.Text)) { ClsMsgBox.Jg("代码包含非字母数字字符!"); return; } if (string.IsNullOrEmpty(txtxh.Text)) { ClsMsgBox.Jg("序号不可为空!"); return; } if (string.IsNullOrEmpty(txtemail.Text)) { ClsMsgBox.Jg("邮箱不可为空!"); return; } if (!ClsReg.Naturalnum.IsMatch(txtemail.Text)) { ClsMsgBox.Jg("权限包含非字母数字字符!"); return; } #endregion try { bds.EndEdit(); tygTableAdapter1.Update(dsJckja1.tyg); if (NED == EnumNED.NEW) { ClsD.TurnDgvToBdsCurrRec(dgv); } this.DialogResult = DialogResult.OK; } catch (Exception ex) { ClsMsgBox.Cw("保存员工时遇到了错误:", ex); } }
public override void Call(int aId, string aBm, string aMc) { tp.Controls.Clear(); #region //配置管理 if (string.Compare(aBm, "xtgl-config", true) == 0) { FrmConfig c = new FrmConfig(); tp.Controls.Add(c); return; } #endregion #region 系统管理 //模块管理 if (string.Compare(aBm, "xtgl-mkgl", true) == 0) { FrmMKGL c = new FrmMKGL(); tp.Controls.Add(c); return; } #endregion #region 进销存 if (string.Compare(aBm, "jxc-jhdlr", true) == 0) { FrmJhdLB c = new FrmJhdLB(); c.Dock = DockStyle.Left; tp.Controls.Add(c); return; } #endregion #region 项管理 //选项管理 if (string.Compare(aBm, "xtgl-xxgl", true) == 0) { FrmOptionLBLB c = new FrmOptionLBLB(); tp.Controls.Add(c); return; } #endregion #region 机构管理 //机构管理 if (string.Compare(aBm, "xtgl-jggl", true) == 0) { FrmJGGL c = new FrmJGGL(); tp.Controls.Add(c); return; } #endregion #region 角色管理 //角色管理 if (string.Compare(aBm, "xtgl-jsgl", true) == 0) { FrmRolesLB c = new FrmRolesLB(); tp.Controls.Add(c); return; } #endregion #region 员工管理 //员工管理 if (string.Compare(aBm, "yggl", true) == 0) { FrmYgLB c = new FrmYgLB(); tp.Controls.Add(c); return; } #endregion #region //员工管理 if (string.Compare(aBm, "xtgl-yggl", true) == 0) { FrmYuanGongLB c = new FrmYuanGongLB(); c.Dock = DockStyle.Fill; tp.Controls.Add(c); return; } #endregion #region 实验 //实验模块 if (string.Compare(aBm, "shiyan", true) == 0) { FrmPractice d = new FrmPractice(); tp.Controls.Clear(); tp.Controls.Add(d); return; } #endregion ClsMsgBox.Jg(aId + "," + aBm + "," + aMc + Environment.NewLine + "此功能正在实现中…"); }