当前位置: 首页>>代码示例>>C#>>正文


C# BLL.users类代码示例

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


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


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