Ejemplo n.º 1
0
        private void thốngKêNhânViênToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmWork f = new frmWork();

            this.Hide();
            f.ShowDialog();
            this.Show();
        }
Ejemplo n.º 2
0
 private void workToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         frmWork frm = new frmWork(UpdataType.Add);
         frm.MdiParent = this;
         frm.Show();
     }
     catch (Exception)
     {
     }
 }
Ejemplo n.º 3
0
        AutofacConfig AutofacConfig = new AutofacConfig(); //调用配置类
        #endregion
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSave_Press(object sender, EventArgs e)
        {
            string code = txtVcode1.Text.Trim();

            if (code.Length > 0)
            {
                if (isVerifyLogon == true)
                {
                    //判断验证码是否输入正确,当返回值为true时,表示验证成功,否则失败,弹出错误
                    ReturnInfo result = AutofacConfig.userService.LoginByVCode(Tel, code);
                    if (result.IsSuccess == true)
                    {
                        //获取当前用户角色
                        List <Role> role = AutofacConfig.userService.GetRoleByUserID(Tel);
                        Client.Session["U_ID"]  = Tel;
                        Client.Session["Roler"] = role;
                        //   Close();
                        frmWork frmWork = new frmWork();
                        Show(frmWork);
                    }
                    else
                    {
                        Toast(result.ErrorInfo, ToastLength.SHORT);
                    }
                }
                else
                {
                    // Close();
                    frmRegister frmRegister = new frmRegister();
                    frmRegister.Tel   = Tel;
                    frmRegister.VCode = code;
                    Show(frmRegister);
                }
            }
            else
            {
                Toast("请输入手机验证码!", ToastLength.SHORT);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 注册
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSave_Press(object sender, EventArgs e)
        {
            try
            {
                if (txtName.Text.Trim().Length <= 0)
                {
                    throw new Exception("请输入昵称!");
                }
                if (VCode == null)
                {
                    throw new Exception("请输入手机验证码!");
                }
                string pwd1 = txtPwd1.Text.Trim();
                string pwd2 = txtPwd2.Text.Trim();
                if (pwd1.Length <= 0)
                {
                    throw new Exception("请输入新密码!");
                }
                if (pwd1.Length < 6 || pwd1.Length > 12)
                {
                    throw new Exception("新密码必须为6-12位!");
                }

                if (pwd2.Length <= 0)
                {
                    throw new Exception("请输入确认密码!");
                }
                if (pwd2.Length < 6 || pwd2.Length > 12)
                {
                    throw new Exception("新密码必须为6-12位!");
                }
                if (!pwd1.Equals(pwd2))
                {
                    throw new Exception("两次密码输入不一致,请检查!");
                }

                RadioButton   selectRole = radioGroup1.CheckedButton;
                List <string> listrole   = new List <string>();
                listrole.Add(selectRole.Value);

                //密码处理,经过加密
                string     encryptPwd = AutofacConfig.userService.Encrypt(pwd2);
                ReturnInfo result     = AutofacConfig.userService.RegisterByVCode(Tel, encryptPwd, txtName.Text.Trim(), listrole, VCode);
                //如果返回true则注册成功,否则弹出错误
                if (result.IsSuccess == false)
                {
                    throw new Exception(result.ErrorInfo);
                }
                else
                {
                    List <Role> role = AutofacConfig.userService.GetRoleByUserID(Tel);
                    Client.Session["U_ID"]  = Tel;
                    Client.Session["Roler"] = role;
                    //  Close();//关闭当前界面
                    frmWork frmWork = new frmWork();//跳转到工作界面
                    Show(frmWork);
                }
            }
            catch (Exception ex)
            {
                Toast(ex.Message, ToastLength.SHORT);
            }
        }