• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# BLL.users类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中BLL.users的典型用法代码示例。如果您正苦于以下问题:C# BLL.users类的具体用法?C# BLL.users怎么用?C# BLL.users使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BLL.users类属于命名空间,在下文中一共展示了BLL.users类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: DoAdd

        private bool DoAdd()
        {
            Model.users userModel = new BLL.users().GetModel(txtUserName.Text.Trim());
            if (userModel == null)
            {
                return false;
            }

            bool result = false;
            Model.user_recharge model = new Model.user_recharge();
            BLL.user_recharge bll = new BLL.user_recharge();

            model.user_id = userModel.id;
            model.user_name = userModel.user_name;
            model.recharge_no = "R" + txtRechargeNo.Text.Trim(); //订单号R开头为充值订单
            model.payment_id = Utils.StrToInt(ddlPaymentId.SelectedValue, 0);
            model.amount = Utils.StrToDecimal(txtAmount.Text.Trim(), 0);
            model.status = 1;
            model.add_time  = DateTime.Now;
            model.complete_time = DateTime.Now;

            if (bll.Recharge(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "给会员:" + model.user_name + ",充值:" + model.amount + "元"); //记录日志
                result = true;
            }
            return result;
        }
开发者ID:sfwjiao,项目名称:MyTestProject,代码行数:28,代码来源:recharge_edit.aspx.cs


示例2: IsUserLogin

 /// <summary>
 /// 判断用户是否已经登录(解决Session超时问题)
 /// </summary>
 public bool IsUserLogin()
 {
     //如果Session为Null
     if (HttpContext.Current.Session[MXKeys.SESSION_USER_INFO] != null)
     {
         return true;
     }
     else
     {
         //检查Cookies
         string username = Utils.GetCookie(MXKeys.COOKIE_USER_NAME_REMEMBER, "MxWeiXinPF");
         string password = Utils.GetCookie(MXKeys.COOKIE_USER_PWD_REMEMBER, "MxWeiXinPF");
         if (username != "" && password != "")
         {
             BLL.users bll = new BLL.users();
             Model.users model = bll.GetModel(username, password, 0, 0, false);
             if (model != null)
             {
                 HttpContext.Current.Session[MXKeys.SESSION_USER_INFO] = model;
                 return true;
             }
         }
     }
     return false;
 }
开发者ID:yi724926089,项目名称:MyWx,代码行数:28,代码来源:BasePage.cs


示例3: btnAudit_Click

 //审核通过
 protected void btnAudit_Click(object sender, EventArgs e)
 {
     ChkAdminLevel("user_audit", MXEnums.ActionEnum.Audit.ToString()); //检查权限
     int sucCount = 0;
     int errorCount = 0;
     BLL.users bll = new BLL.users();
     for (int i = 0; i < rptList.Items.Count; i++)
     {
         int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
         CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
         if (cb.Checked)
         {
             if (bll.UpdateField(id, "status=0") > 0)
             {
                 sucCount += 1;
             }
             else
             {
                 errorCount += 1;
             }
         }
     }
     AddAdminLog(MXEnums.ActionEnum.Audit.ToString(), "审核用户成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志
     JscriptMsg("审核通过" + sucCount + "条,失败" + errorCount + "条!",
         Utils.CombUrlTxt("user_audit.aspx", "keywords={0}", this.keywords), "Success");
 }
开发者ID:yi724926089,项目名称:MyWx,代码行数:27,代码来源:user_audit.aspx.cs


示例4: btnDelete_Click

 //批量删除
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     ChkAdminLevel("user_list", DTEnums.ActionEnum.Delete.ToString()); //检查权限
     int sucCount = 0;
     int errorCount = 0;
     BLL.users bll = new BLL.users();
     for (int i = 0; i < rptList.Items.Count; i++)
     {
         int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
         CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
         if (cb.Checked)
         {
             if (bll.Delete(id))
             {
                 sucCount += 1;
             }
             else
             {
                 errorCount += 1;
             }
         }
     }
     AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), "删除用户" + sucCount + "条,失败" + errorCount + "条"); //记录日志
     JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!",
         Utils.CombUrlTxt("user_list.aspx", "group_id={0}&keywords={1}", this.group_id.ToString(), this.keywords));
 }
开发者ID:rockhe168,项目名称:CMS,代码行数:27,代码来源:user_list.aspx.cs


示例5: get_user_avatar

 /// <summary>
 /// 返回用户头像图片地址
 /// </summary>
 /// <param name="user_name">用户名</param>
 /// <returns>String</returns>
 protected string get_user_avatar(string user_name)
 {
     BLL.users bll = new BLL.users();
     if (!bll.Exists(user_name))
     {
         return "";
     }
     return bll.GetModel(user_name).avatar;
 }
开发者ID:codefighting,项目名称:shouxinzhihui,代码行数:14,代码来源:users.cs


示例6: get_real_name

 /// <summary>
 /// 获取用户真实姓名
 /// </summary>
 /// <param name="user_id"></param>
 /// <returns></returns>
 protected string get_real_name(int user_id)
 {
     BLL.users bll = new BLL.users();
     Model.users model = bll.GetModel(user_id);
     if (model != null)
     {
         return model.real_name;
     }
     else {
         return "";
     }
 }
开发者ID:wangjinfang,项目名称:DTCMS,代码行数:17,代码来源:users.cs


示例7: GetUserInfo

 /// <summary>
 /// 取得用户信息
 /// </summary>
 public Model.users GetUserInfo()
 {
     if (IsUserLogin())
     {
         Model.users model = HttpContext.Current.Session[DTKeys.SESSION_USER_INFO] as Model.users;
         if (model != null)
         {
             //为了能查询到最新的用户信息,必须查询最新的用户资料
             model = new BLL.users().GetModel(model.id);
             return model;
         }
     }
     return null;
 }
开发者ID:wangjinfang,项目名称:DTCMS,代码行数:17,代码来源:BasePage.cs


示例8: RptBind

        private void RptBind(string _strWhere, string _orderby)
        {
            this.page = DTRequest.GetQueryInt("page", 1);
            this.txtKeywords.Text = this.keywords;
            BLL.users bll = new BLL.users();
            this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
            this.rptList.DataBind();

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("user_audit.aspx", "keywords={0}&page={1}",
                this.keywords, "__id__");
            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
开发者ID:silverdan,项目名称:ahxrmyy2.0,代码行数:14,代码来源:user_audit.aspx.cs


示例9: btnDelete_Click

 //批量删除
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     ChkAdminLevel("users", DTEnums.ActionEnum.Delete.ToString()); //检查权限
     BLL.users bll = new BLL.users();
     for (int i = 0; i < rptList.Items.Count; i++)
     {
         int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
         CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
         if (cb.Checked)
         {
             bll.Delete(id);
         }
     }
     JscriptMsg("批量删除成功啦!", Utils.CombUrlTxt("user_list.aspx", "group_id={0}&keywords={1}",
         this.group_id.ToString(), this.keywords), "Success");
 }
开发者ID:egojit,项目名称:B2C,代码行数:17,代码来源:user_list.aspx.cs


示例10: GetGroupMobile

 private string GetGroupMobile(ArrayList al)
 {
     StringBuilder str = new StringBuilder();
     foreach (Object obj in al)
     {
         DataTable dt = new BLL.users().GetList(0, "group_id=" + Convert.ToInt32(obj), "reg_time desc,id desc").Tables[0];
         foreach (DataRow dr in dt.Rows)
         {
             if (!string.IsNullOrEmpty(dr["mobile"].ToString()))
             {
                 str.Append(dr["mobile"].ToString() + ",");
             }
         }
     }
     return Utils.DelLastComma(str.ToString());
 }
开发者ID:silverdan,项目名称:ahxrmyy2.0,代码行数:16,代码来源:user_sms.aspx.cs


示例11: btnLogin_Click

        protected void btnLogin_Click(object sender, EventArgs e)
        {
            BLL.users userService = new BLL.users();
            string userName = txtUserName.Text.Trim();
            string password = Maticsoft.Common.DEncrypt.DESEncrypt.Encrypt(txtPassword.Text.Trim(), ConfigHelper.GetConfigString("PassWordEncrypt"));
            //string password = txtPassword.Text.Trim();
            DataTable userList = userService.GetList("userName='" + userName + "' and password='" + password + "' and roleId in (4,10,11)").Tables[0];
            if (userList.Rows.Count > 0)
            {

                if (userList.Rows[0]["status"].ToString() == "0")
                {
                    MessageBox.Show(this, "此用户名已被冻结,无法登陆!");
                    return;
                }
                //写入Cookie
                try
                {
                    Common.Cookie.SetObject(StatusHelpercs.Cookie_Admin_UserId, 2, userList.Rows[0]["userId"].ToString());
                    Common.Cookie.SetObject(StatusHelpercs.Cookie_Admin_UserName, 2, txtUserName.Text.Trim());
                    Common.Cookie.SetObject(StatusHelpercs.Cookie_Admin_TrueName, 2, DESEncrypt.Encrypt(userList.Rows[0]["trueName"].ToString()));
                    Common.Cookie.SetObject(StatusHelpercs.Cookie_Admin_RoleId, 2, userList.Rows[0]["roleId"].ToString());
                    Common.Cookie.SetObject(StatusHelpercs.Cookie_Admin_RoleName, 2, DESEncrypt.Encrypt(userList.Rows[0]["roleName"].ToString()));
                    Common.Cookie.SetObject(StatusHelpercs.Cookie_Admin_DeptId, 2, userList.Rows[0]["deptId"].ToString());
                    Common.Cookie.SetObject(StatusHelpercs.Cookie_Admin_IsAdmin, 2, userList.Rows[0]["isAdmin"].ToString());
                    Common.Cookie.SetObject(StatusHelpercs.Cookie_Admin_Avatar, 2, userList.Rows[0]["avatar_small"].ToString());
                    Common.Cookie.SetObject(StatusHelpercs.Cookie_Admin_LastLoginTime, 2, DateTime.Parse(userList.Rows[0]["lastLoginTime"].ToString()).ToString("yyyy-MM-dd HH:mm:ss"));
                }
                catch
                {
                    //Session["userName"] = txtUserName.Text.Trim();
                    //Session["userType"] = ddrUserTyp.SelectedValue;
                    //Session["orgId"] = userList.Rows[0]["orgId"].ToString();
                }
                //更新最后登陆时间
                Model.users userModel = userService.GetModel(int.Parse(userList.Rows[0]["userId"].ToString()));
                userModel.lastLoginTime = DateTime.Now;
                userService.Update(userModel);

                Response.Redirect("index.aspx");
                //MessageBox.ShowAndRedirect(this, "登录成功!", "index.html");
            }
            else
            {
                MessageBox.Show(this, "用户名或密码错误!");
            }
        }
开发者ID:tcld2269,项目名称:hmdfs,代码行数:47,代码来源:Login.aspx.cs


示例12: DoAdd

        private bool DoAdd()
        {
            bool result = false;
            Model.users model = new Model.users();
            BLL.users bll = new BLL.users();

            model.group_id = int.Parse(ddlGroupId.SelectedValue);
            model.status = int.Parse(rblStatus.SelectedValue);
            //检测用户名是否重复
            if (bll.Exists(txtUserName.Text.Trim()))
            {
                return false;
            }
            model.user_name = Utils.DropHTML(txtUserName.Text.Trim());
            //获得6位的salt加密字符串
            model.salt = Utils.GetCheckCode(6);
            //以随机生成的6位字符串做为密钥加密
            model.password = DESEncrypt.Encrypt(txtPassword.Text.Trim(), model.salt);
            model.email = Utils.DropHTML(txtEmail.Text);
            model.nick_name = Utils.DropHTML(txtNickName.Text);
            model.avatar = Utils.DropHTML(txtAvatar.Text);
            model.sex = rblSex.SelectedValue;
            DateTime _birthday;
            if (DateTime.TryParse(txtBirthday.Text.Trim(), out _birthday))
            {
                model.birthday = _birthday;
            }
            model.telphone = Utils.DropHTML(txtTelphone.Text.Trim());
            model.mobile = Utils.DropHTML(txtMobile.Text.Trim());
            model.qq = Utils.DropHTML(txtQQ.Text);
            model.msn = Utils.DropHTML(txtMsn.Text);
            model.address = Utils.DropHTML(txtAddress.Text.Trim());
            model.amount = decimal.Parse(txtAmount.Text.Trim());
            model.point = int.Parse(txtPoint.Text.Trim());
            model.exp = int.Parse(txtExp.Text.Trim());
            model.reg_time = DateTime.Now;
            model.reg_ip = DTRequest.GetIP();

            if (bll.Add(model) > 0)
            {
                AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加用户:" + model.user_name); //记录日志
                result = true;
            }
            return result;
        }
开发者ID:sfwjiao,项目名称:MyTestProject,代码行数:45,代码来源:user_edit.aspx.cs


示例13: RptBind

        private void RptBind(string _strWhere, string _orderby)
        {
            this.page = MXRequest.GetQueryInt("page", 1);
            if (this.group_id > 0)
            {
                this.ddlGroupId.SelectedValue = this.group_id.ToString();
            }
            this.txtKeywords.Text = this.keywords;
            BLL.users bll = new BLL.users();
            this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
            this.rptList.DataBind();

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("user_list.aspx", "group_id={0}&keywords={1}&page={2}",
                this.group_id.ToString(), this.keywords, "__id__");
            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
开发者ID:wujiang1984,项目名称:WechatBuilder,代码行数:18,代码来源:user_list.aspx.cs


示例14: cardnoStr

 /// <summary>
 /// 如果有该openid已经注册过会员卡信息,则拼接cardno=卡号
 /// </summary>
 /// <param name="openid"></param>
 /// <returns></returns>
 public string cardnoStr(int wid,string openid)
 {
     string ret = "";
     if (openid == null || openid.Trim() == "")
     {
         return "";
     }
     BLL.users ubll = new BLL.users();
     string cardno = ubll.getCardnoByOpenId(wid,openid);
     if (cardno == "")
     {
         ret = "";
     }
     else
     {
         ret = "&cardno=" + cardno;
     }
     return ret;
 }
开发者ID:yi724926089,项目名称:MyWx,代码行数:24,代码来源:wx_requestRuleContent.cs


示例15: UserPage_Init

        /// <summary>
        /// OnInit事件,检查用户是否已经登录
        /// </summary>
        void UserPage_Init(object sender, EventArgs e)
        {
            turl = Utils.GetCookie(MXKeys.COOKIE_URL_REFERRER);
            if (string.IsNullOrEmpty(turl) || turl == HttpContext.Current.Request.Url.ToString().ToLower())
            {
                turl = linkurl("usercenter", "index");
            }
            if (IsUserLogin())
            {
                //自动登录,跳转URL
                HttpContext.Current.Response.Redirect(turl);
                return;
            }
            //检查是否已授权
            if (HttpContext.Current.Session["oauth_name"] == null || HttpContext.Current.Session["oauth_access_token"] == null || HttpContext.Current.Session["oauth_openid"] == null)
            {
                HttpContext.Current.Response.Redirect(linkurl("error", "?msg=" + Utils.UrlEncode("登录失败,用户授权已过期,请重新登录!")));
                return;
            }
            Model.user_oauth oauthModel = new BLL.user_oauth().GetModel(HttpContext.Current.Session["oauth_name"].ToString(), HttpContext.Current.Session["oauth_openid"].ToString());
            if (oauthModel != null)
            {
                //检查用户是否存在
                Model.users model = new BLL.users().GetModel(oauthModel.user_name);
                if (model == null)
                {
                    HttpContext.Current.Response.Redirect(linkurl("error", "?msg=" + Utils.UrlEncode("登录失败,授权用户不存在或已被删除!")));
                    return;
                }

                //记住登录状态,防止Session提前过期
                HttpContext.Current.Session[MXKeys.SESSION_USER_INFO] = model;
                HttpContext.Current.Session.Timeout = 45;
                Utils.WriteCookie(MXKeys.COOKIE_USER_NAME_REMEMBER, "MxWeiXinPF", model.user_name);
                Utils.WriteCookie(MXKeys.COOKIE_USER_PWD_REMEMBER, "MxWeiXinPF", model.password);
                //更新最新的Access Token
                oauthModel.oauth_access_token = HttpContext.Current.Session["oauth_access_token"].ToString();
                new BLL.user_oauth().Update(oauthModel);
                //自动登录,跳转URL
                HttpContext.Current.Response.Redirect(turl);
                return;
            }
        }
开发者ID:yi724926089,项目名称:MyWx,代码行数:46,代码来源:oauth_login.cs


示例16: ShowInfo

        private void ShowInfo(int _id)
        {
            BLL.users bll = new BLL.users();
            Model.users model = bll.GetModel(_id);

            ddlGroupId.SelectedValue = model.group_id.ToString();
            rblStatus.SelectedValue = model.status.ToString();
            txtUserName.Text = model.user_name;
            txtUserName.ReadOnly = true;
            txtUserName.Attributes.Remove("ajaxurl");
            if (!string.IsNullOrEmpty(model.password))
            {
                txtPassword.Attributes["value"] = txtPassword1.Attributes["value"] = defaultpassword;
            }
            txtEmail.Text = model.email;
            txtNickName.Text = model.nick_name;
            txtAvatar.Text = model.avatar;
            rblSex.SelectedValue = model.sex;
            if (model.birthday != null)
            {
                txtBirthday.Text = model.birthday.GetValueOrDefault().ToString("yyyy-M-d");
            }
            txtTelphone.Text = model.telphone;
            txtMobile.Text = model.mobile;
            txtQQ.Text = model.qq;
            txtMsn.Text = model.msn;
            txtAddress.Text = model.address;
            txtAmount.Text = model.amount.ToString();
            txtPoint.Text = model.point.ToString();
            txtExp.Text = model.exp.ToString();
            lblRegTime.Text = model.reg_time.ToString();
            lblRegIP.Text = model.reg_ip.ToString();
            //查找最近登录信息
            Model.user_login_log logModel = new BLL.user_login_log().GetLastModel(model.user_name);
            if (logModel != null)
            {
                lblLastTime.Text = logModel.login_time.ToString();
                lblLastIP.Text = logModel.login_ip;
            }
        }
开发者ID:silverdan,项目名称:ahxrmyy2.0,代码行数:40,代码来源:user_edit.aspx.cs


示例17: btnSmsPost_Click

        //发送手机短信
        protected void btnSmsPost_Click(object sender, EventArgs e)
        {
            BLL.users bll = new BLL.users();
            StringBuilder str = new StringBuilder();

            for (int i = 0; i < rptList.Items.Count; i++)
            {
                int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
                CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
                if (cb.Checked)
                {
                    Model.users model = bll.GetModel(id);
                    if (model != null && !string.IsNullOrEmpty(model.mobile))
                    {
                        str.Append(model.mobile + ",");
                    }
                }
            }
            if (!string.IsNullOrEmpty(str.ToString()))
            {
                Response.Redirect("user_sms.aspx?mobiles=" + Utils.UrlEncode(Utils.DelLastComma(str.ToString())));
            }
        }
开发者ID:yi724926089,项目名称:MyWx,代码行数:24,代码来源:user_list.aspx.cs


示例18: ShowInfo

        private void ShowInfo(int _id)
        {
            BLL.users bll = new BLL.users();
            Model.users model = bll.GetModel(_id);

            ddlGroupId.SelectedValue = model.group_id.ToString();
            rblIsLock.SelectedValue = model.is_lock.ToString();
            txtUserName.Enabled = false;
            txtUserName.Text = model.user_name;
            hidUserName.Value = model.user_name;
            txtPassword.Attributes["value"] = model.password;
            txtEmail.Text = model.email;
            txtNickName.Text = model.nick_name;
            txtAvatar.Text = model.avatar;
            rblSex.SelectedValue = model.sex;
            if (model.birthday != null)
            {
                txtBirthday.Text = model.birthday.GetValueOrDefault().ToString("yyyy-M-d");
            }
            txtTelphone.Text = model.telphone;
            txtMobile.Text = model.mobile;
            txtQQ.Text = model.qq;
            txtAddress.Text = model.address;
            txtAmount.Text = model.amount.ToString();
            txtPoint.Text = model.point.ToString();
            txtExp.Text = model.exp.ToString();
            lblRegTime.Text = model.reg_time.ToString();
            lblRegIP.Text = model.reg_ip.ToString();
            //查找最近登录信息
            Model.user_login_log logModel = new BLL.user_login_log().GetLastModel(model.user_name);
            if (logModel != null)
            {
                lblLastTime.Text = logModel.login_time.ToString();
                lblLastIP.Text = logModel.login_ip;
            }
        }
开发者ID:sichina,项目名称:or-dtcms2.0,代码行数:36,代码来源:user_edit.aspx.cs


示例19: user_oauth_bind

        private void user_oauth_bind(HttpContext context)
        {
            //检查URL参数
            if (context.Session["oauth_name"] == null)
            {
                context.Response.Write("{\"msg\": 0, \"msgbox\": \"错误提示:授权参数不正确!\"}");
                return;
            }
            //获取授权信息
            string result = Utils.UrlExecute(siteConfig.webpath + "api/oauth/" + context.Session["oauth_name"].ToString() + "/result_json.aspx");
            if (result.Contains("error"))
            {
                context.Response.Write("{\"msg\": 0, \"msgbox\": \"错误提示:请检查URL是否正确!\"}");
                return;
            }
            //反序列化JSON
            Dictionary<string, object> dic = JsonMapper.ToObject<Dictionary<string, object>>(result);
            if (dic["ret"].ToString() != "0")
            {
                context.Response.Write("{\"msg\": 0, \"msgbox\": \"错误代码:" + dic["ret"] + ",描述:" + dic["msg"] + "\"}");
                return;
            }

            //检查用户名密码
            string username = DTRequest.GetString("txtUserName");
            string password = DTRequest.GetString("txtPassword");
            if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password))
            {
                context.Response.Write("{\"msg\": 0, \"msgbox\": \"温馨提示:请输入用户名或密码!\"}");
                return;
            }
            BLL.users bll = new BLL.users();
            Model.users model = bll.GetModel(username, DESEncrypt.Encrypt(password), userConfig.emaillogin);
            if (model == null)
            {
                context.Response.Write("{\"msg\":0, \"msgbox\":\"错误提示:用户名或密码错误,请重试!\"}");
                return;
            }
            //开始绑定
            Model.user_oauth oauthModel = new Model.user_oauth();
            oauthModel.oauth_name = dic["oauth_name"].ToString();
            oauthModel.user_id = model.id;
            oauthModel.user_name = model.user_name;
            oauthModel.oauth_access_token = dic["oauth_access_token"].ToString();
            oauthModel.oauth_openid = dic["oauth_openid"].ToString();
            int newId = new BLL.user_oauth().Add(oauthModel);
            if (newId < 1)
            {
                context.Response.Write("{\"msg\":0, \"msgbox\":\"错误提示:绑定过程中出现错误,请重新登录授权!\"}");
                return;
            }
            context.Session[DTKeys.SESSION_USER_INFO] = model;
            context.Session.Timeout = 45;
            //记住登录状态,防止Session提前过期
            Utils.WriteCookie(DTKeys.COOKIE_USER_NAME_REMEMBER, "DTcms", model.user_name);
            Utils.WriteCookie(DTKeys.COOKIE_USER_PWD_REMEMBER, "DTcms", model.password);
            //写入登录日志
            new BLL.user_login_log().Add(model.id, model.user_name, "会员登录", DTRequest.GetIP());
            //返回URL
            context.Response.Write("{\"msg\":1, \"msgbox\":\"会员登录成功!\"}");
            return;
        }
开发者ID:qljiong,项目名称:LearnDTCMS,代码行数:62,代码来源:submit_ajax.ashx.cs


示例20: user_login

        private void user_login(HttpContext context)
        {
            string username = DTRequest.GetFormString("txtUserName");
            string password = DTRequest.GetFormString("txtPassword");
            string remember = DTRequest.GetFormString("chkRemember");
            //检查用户名密码
            if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password))
            {
                context.Response.Write("{\"msg\": 0, \"msgbox\": \"温馨提示:请输入用户名或密码!\"}");
                return;
            }

            BLL.users bll = new BLL.users();
            Model.users model = bll.GetModel(username, DESEncrypt.Encrypt(password), userConfig.emaillogin);
            if (model == null)
            {
                context.Response.Write("{\"msg\":0, \"msgbox\":\"错误提示:用户名或密码错误,请重试!\"}");
                return;
            }
            //检查用户是否通过验证
            if (model.is_lock == 1) //待验证
            {
                context.Response.Write("{\"msg\":1, \"url\":\"" + new Web.UI.BasePage().linkurl("register") + "?action=sendmail&username=" + Utils.UrlEncode(model.user_name) + "\", \"msgbox\":\"会员尚未通过验证!\"}");
                return;
            }
            else if (model.is_lock == 2) //待审核
            {
                context.Response.Write("{\"msg\":1, \"url\":\"" + new Web.UI.BasePage().linkurl("register") + "?action=verify&username=" + Utils.UrlEncode(model.user_name) + "\", \"msgbox\":\"会员尚未通过审核!\"}");
                return;
            }
            context.Session[DTKeys.SESSION_USER_INFO] = model;
            context.Session.Timeout = 45;
            //记住登录状态下次自动登录
            if (remember.ToLower() == "true")
            {
                Utils.WriteCookie(DTKeys.COOKIE_USER_NAME_REMEMBER, "DTcms", model.user_name, 43200);
                Utils.WriteCookie(DTKeys.COOKIE_USER_PWD_REMEMBER, "DTcms", model.password, 43200);
            }
            else
            {
                //防止Session提前过期
                Utils.WriteCookie(DTKeys.COOKIE_USER_NAME_REMEMBER, "DTcms", model.user_name);
                Utils.WriteCookie(DTKeys.COOKIE_USER_PWD_REMEMBER, "DTcms", model.password);
            }

            //写入登录日志
            new BLL.user_login_log().Add(model.id, model.user_name, "会员登录", DTRequest.GetIP());
            //返回URL
            context.Response.Write("{\"msg\":1, \"msgbox\":\"会员登录成功!\"}");
            return;
        }
开发者ID:qljiong,项目名称:LearnDTCMS,代码行数:51,代码来源:submit_ajax.ashx.cs



注:本文中的BLL.users类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# BLLCollection类代码示例发布时间:2022-05-24
下一篇:
C# BLL.siteconfig类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap