當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。