Пример #1
0
        protected void bntlogin_Click(object sender, EventArgs e)
        {
            string name = txtname.Text.Trim();
            string pwd  = txtpwd.Text.Trim();


            try
            {
                Aers service = new Aers();

                view_Login lg = new view_Login();

                ResModel <view_tbl_registereduser> op = service.UserLogin(lg);

                if (op != null)
                {
                    if (op.restag == "103")
                    {
                        if (op.model.RoleState == "147")
                        {
                            Session["user"] = op.model;
                            Response.Redirect("~/Index.aspx");
                        }
                        else
                        {
                            AlertMagess("您的权限不能登录该系统!");
                            return;
                        }
                    }
                    else if (op.restag == "102")
                    {
                        AlertMagess("密码错误!");
                        return;
                    }
                    else
                    {
                        AlertMagess("错误:" + op.restag);
                        return;
                    }
                }
                else
                {
                    AlertMagess("用户名不存在!");
                    return;
                }
            }
            catch (Exception ex)
            {
            }
        }
Пример #2
0
        private void btnkogin_Click(object sender, EventArgs e)
        {
            string name = txtname.Text.Trim();
            string pwd  = txtpwd.Text.Trim();

            if (string.IsNullOrEmpty(name))
            {
                MessageBox.Show("用户名不能为空!");
                return;
            }

            if (string.IsNullOrEmpty(pwd))
            {
                MessageBox.Show("密码不能为空!");
                return;
            }


            Aers service = new Aers();

            //2017.6.12 YM
            view_Login model = new view_Login();

            model.Name = name;
            model.Pwd  = pwd;


            //  ResModel<view_tbl_registereduser> aaa = service.UserLogin(name, pwd);
            //ResModel<view_tbl_registereduser> aaa = service.UserLogin(model);
            //if (aaa.restag == "103")
            //{
            //    if (aaa.model.RoleState.Contains("147"))
            //    {
            //        MainForm.user = aaa.model;

            //        this.DialogResult = DialogResult.OK;
            //    }
            //    else
            //    {
            //        MessageBox.Show("您的权限不能登录该系统!");
            //    }

            //}
            //else
            //{
            //    MessageBox.Show("用户名密码错误!");
            //}
        }