Ejemplo n.º 1
0
        private void RptBind(string _strWhere, string _orderby)
        {
            this.page = DTRequest.GetQueryInt("page", 1);
            if (this.site_id > 0)
            {
                this.ddlSiteId.SelectedValue = this.site_id.ToString();
            }
            if (this.group_id > 0)
            {
                this.ddlGroupId.SelectedValue = this.group_id.ToString();
            }
            this.txtStartTime.Text = this.start_time;
            this.txtEndTime.Text   = this.end_time;
            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", "site_id={0}&group_id={1}&start_time={2}&end_time={3}&keywords={4}&page={5}",
                                              this.site_id.ToString(), this.group_id.ToString(), this.start_time, this.end_time, this.keywords, "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
Ejemplo n.º 2
0
        /// 注册
        /// </summary>
        public void regist(HttpContext context)
        {
            string outmsg    = "{\"status\":1,\"msg\":\"注册成功!\"}";
            string mobile    = _Request.GetString("mobile");
            string usersname = _Request.GetString("usersname");
            string password  = _Request.GetString("password");
            string usersaera = _Request.GetString("usersaera");
            string usernick  = _Request.GetString("usernick");//y用户昵称



            string userPwd1 = Vincent._MD5Encrypt.GetMD5(password.Trim());

            Model.users model = new Model.users();
            BLL.users   bll   = new BLL.users();
            model.user_name    = mobile;
            model.mobile       = mobile;
            model.isEmail      = 0;
            model.isMobile     = 0;
            model.Parentid     = 0;
            model.Leftor_right = 0;
            model.MarketId     = 0;
            model.OrganizeId   = 0;
            model.PreId        = 0;
            model.nick_name    = usernick;//用户昵称
            //model.password = Vincent._DESEncrypt.Encrypt(password.Trim());
            //model.password = Vincent._DESEncrypt.Encrypt(password.Trim());
            model.salt     = Vincent._DTcms.Utils.GetCheckCode(6); //获得6位的salt加密字符串
            model.password = _DESEncrypt.Encrypt(password, model.salt);
            if (!bll.ExistsMobile(mobile))
            {
                int id = bll.AddPc(model);
                if (id > 0)
                {
                    DataTable dt = bll.GetList(0, "id  =" + id + " ", "id asc").Tables[0];
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        outmsg = CreateJsonParameters(dt);
                    }
                    //// 保存session值
                    context.Session[DTKeys.SESSION_USER_INFO] = model;
                    context.Session.Timeout = 45;
                    context.Response.Clear();
                    context.Response.Write(outmsg);
                    context.Response.End();
                }
                else
                {
                    context.Response.Clear();
                    context.Response.Write("{\"status\":0,\"msg\":\"注册未成功!\"}");
                    context.Response.End();
                }
            }
            else
            {
                context.Response.Clear();
                context.Response.Write("{\"status\":0,\"msg\":\"注册未成功!\"}");
                context.Response.End();
            }
        }
Ejemplo n.º 3
0
        private void Bind(int pageindex)
        {
            DTcms.BLL.users userbll = new BLL.users();
            int             count   = 0;

            repdata.DataSource = userbll.GetList(10, pageindex, " group_id=5 ", " id", out count);
            repdata.DataBind();
            aspPage.RecordCount = count;
            aspPage.PageSize    = 10;
        }
Ejemplo n.º 4
0
        private void loadUser()
        {
            BLL.users bllUser = new BLL.users();
            DataTable dt      = bllUser.GetList(100000, "", "ID DESC").Tables[0];

            if (dt != null)
            {
                Repeater1.DataSource = dt.DefaultView;
                Repeater1.DataBind();
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 数据列表绑定
        /// </summary>
        private void RptBind(string whereStr)
        {
            //绑定数据
            this.page           = Common.Utils.GetQueryInt("page", 1);
            rpt_list.DataSource = bll.GetList(this.pagesize, this.page, whereStr, " id asc", out this.totalCount);
            rpt_list.DataBind();
            txtTotalCount.InnerText = totalCount.ToString();//绑定总记录数
            //txtPageNum.Text = this.pagesize.ToString();//绑定页码
            // txtPageNum.InnerText = this.pagesize.ToString();//绑定页码
            string pageUrl = Common.Utils.CombUrlTxt("user_list.aspx", "page={0}", "__id__");

            PageContent.InnerHtml = Common.Utils.OutPageList(this.pagesize, this.page, this.totalCount, pageUrl, 8);
        }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
        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}", txtKeywords.Text, "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
Ejemplo n.º 8
0
        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='******' and 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, "用户名或密码错误!");
            }
        }
Ejemplo n.º 9
0
        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='******' and password='******'").Tables[0];

            if (userList.Rows.Count > 0)
            {
                if (userList.Rows[0]["status"].ToString() == "0")
                {
                    MessageBox.Show(this, "此用户名已被冻结,无法登陆!");
                    return;
                }
                //写入Cookie
                try
                {
                    Common.Cookie.SetObject("userName", 2, txtUserName.Text.Trim());
                    Common.Cookie.SetObject("roleId", 2, userList.Rows[0]["roleId"].ToString());
                    Common.Cookie.SetObject("roleName", 2, DESEncrypt.Encrypt(userList.Rows[0]["roleName"].ToString()));
                    Common.Cookie.SetObject("userId", 2, userList.Rows[0]["userId"].ToString());
                    Common.Cookie.SetObject("deptId", 2, userList.Rows[0]["deptId"].ToString());
                    Common.Cookie.SetObject("trueName", 2, DESEncrypt.Encrypt(userList.Rows[0]["trueName"].ToString()));
                    Common.Cookie.SetObject("isAdmin", 2, userList.Rows[0]["isAdmin"].ToString());
                    Common.Cookie.SetObject("lastLoginTime", 2, DESEncrypt.Encrypt(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.html");
                //MessageBox.ShowAndRedirect(this, "登录成功!", "index.html");
            }
            else
            {
                MessageBox.Show(this, "用户名或密码错误!");
            }
        }
Ejemplo n.º 10
0
        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);
        }
Ejemplo n.º 11
0
        private void RptBind(string _strWhere, string _orderby)
        {
            this.page = Vincent._DTcms.DTRequest.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 + " and 1=1 and isDelete = 0", _orderby, out this.totalCount);
            this.rptList.DataBind();

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Vincent._DTcms.Utils.CombUrlTxt("user_list_level.aspx", "group_id={0}&keywords={1}&page={2}",
                                                             this.group_id.ToString(), this.keywords, "__id__");

            PageContent.InnerHtml = Vincent._DTcms.Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
Ejemplo n.º 12
0
        private void TreeBindLevel(string strWhere)
        {
            BLL.users bll = new BLL.users();



            DataTable dt = bll.GetList(0, strWhere, "id asc").Tables[0];

            this.DropDownList1.Items.Clear();
            this.DropDownList1.Items.Add(new ListItem("请选择店长...", ""));

            foreach (DataRow dr in dt.Rows)
            {
                if (dr["nick_name"].ToString() != "")
                {
                    this.DropDownList1.Items.Add(new ListItem(dr["nick_name"].ToString(), dr["id"].ToString()));
                }
            }
        }
Ejemplo n.º 13
0
        protected void Session_Start(object sender, EventArgs e)
        {
            //在新会话启动时运行的代码

            #region 构建购物车内存表
            //构建购物车内存表
            DataTable dtShopCart = new DataTable();

            //添加产品编号字段
            DataColumn keyCol = new DataColumn("GoodsId", typeof(Int32));
            dtShopCart.Columns.Add(keyCol);

            //添加产品内容字段
            dtShopCart.Columns.Add(new DataColumn("GoodsName", typeof(string)));
            dtShopCart.Columns.Add(new DataColumn("GoodsImage", typeof(string)));
            dtShopCart.Columns.Add(new DataColumn("GoodsPrice", typeof(decimal)));
            dtShopCart.Columns.Add(new DataColumn("GoodsCount", typeof(int)));
            dtShopCart.Columns.Add(new DataColumn("GoodsTotal", typeof(decimal)));
            dtShopCart.Columns.Add(new DataColumn("GoodsActive", typeof(int)));

            //将产品编号设置为主键
            DataColumn[] primKey = { keyCol };
            dtShopCart.PrimaryKey = primKey;

            //将数据表结构写入Session
            Session["DGCart"] = dtShopCart;
            #endregion

            #region 规定时间未付款,降级为普通会员
            DateTime dtNow = DateTime.Now;

            BLL.users bllUser    = new BLL.users();
            DataTable dtUserList = bllUser.GetList(1000000, "  group_id<>5 and is_lock=0", " reg_time desc").Tables[0];
            if (dtUserList != null)
            {
                for (int i = 0; i < dtUserList.Rows.Count; i++)
                {
                    if (!string.IsNullOrEmpty(dtUserList.Rows[i]["reg_time"].ToString()))
                    {
                        DateTime UserRegTime         = DateTime.Parse(dtUserList.Rows[i]["reg_time"].ToString()).AddYears(2);
                        DateTime SetEmailUserRegTime = DateTime.Parse(dtUserList.Rows[i]["reg_time"].ToString()).AddDays(699);
                        int      isFee  = int.Parse(dtUserList.Rows[i]["isFee"].ToString());
                        int      UserID = int.Parse(dtUserList.Rows[i]["ID"].ToString());
                        //int length = ((TimeSpan)(dtNow - UserRegTime)).Days;
                        string GroupID   = dtUserList.Rows[i]["group_id"].ToString();
                        string GroupName = "普通會員";
                        switch (GroupID)
                        {
                        case "1":
                            GroupName = "普通會員";
                            break;

                        case "2":
                            GroupName = "尊榮卡";
                            break;

                        case "3":
                            GroupName = "柏金卡";
                            break;

                        case "4":
                            GroupName = "御皇卡";
                            break;
                        }
                        if (isFee == 0 && dtNow == UserRegTime)
                        {
                            bllUser.UpUserSetCommon(UserID);
                            int bk = bllUser.UpFee(UserID, 0);
                        }
                        else if (isFee == 0 && dtNow == SetEmailUserRegTime)
                        {
                            string UserName = dtUserList.Rows[i]["user_name"].ToString();
                            string email    = dtUserList.Rows[i]["email"].ToString();
                            string Contnet  = "親愛的" + UserName + ",你的" + GroupName + "會員將在" + DateTime.Now.AddDays(30).ToString() + "到期" + ",請您儘快續費";
                            setEmail(email, "");
                        }
                    }
                }
            }
            #endregion
        }
Ejemplo n.º 14
0
        protected void btnExport1_Click(object sender, EventArgs e)
        {
            string fileName = "用戶資料" + DateTime.Now.ToString("yyyyMMddHHmmssffff") + ".xls";

            BLL.users bll = new BLL.users();

            string strurl = "0";

            for (int ai = 0; ai < rptList.Items.Count; ai++)
            {
                int      id = Convert.ToInt32(((HiddenField)rptList.Items[ai].FindControl("hidId")).Value);
                CheckBox cb = (CheckBox)rptList.Items[ai].FindControl("chkId");
                if (cb.Checked)
                {
                    strurl = strurl + "," + id.ToString();;
                }
            }
            DataTable dt = new DataTable();

            //if (strurl.Length > 1)
            //{
            //    dt = bll.GetList(0, "id in(" + strurl + ")" + CombSqlTxt(this.group_id, this.keywords), "reg_time desc,id desc").Tables[0];
            //}
            //else
            //{
            dt = bll.GetList(0, "id>0 and exp=1" + CombSqlTxt(this.group_id, this.keywords), "reg_time desc,id desc").Tables[0];
            //}


            string[] titleCol = new string[] { "姓名", "性別", "⽣⽇_年", "⽣⽇_⽉", "⽣⽇_⽇", "電話1", "電話2", "傳真1", "傳真2", "⼿機1", "⼿機2", "Email1", "Email2", "Email3", "郵遞區號", "住址", "即時通訊", "群組", "啟⽤電⼦報", "公司名稱", "部⾨職稱", "公司電話", "公司傳真", "公司地址1", "公司地址2", "統⼀編號", "網站", "備註" };

            Response.Clear();
            Response.Buffer  = true;
            Response.Charset = "UTF-8";
            Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName);
            Response.ContentEncoding = System.Text.Encoding.GetEncoding("UTF-8");
            Response.Write("<metahttp-equiv=Content-Type content=application/ms-excel;charset=UTF-8>");
            Response.ContentType = "application/ms-excel;charset=UTF-8";

            ////定义表对象与行对象,同时用DataSet对其值进行初始化
            //DataTable dt = ds.Tables[0];
            DataRow[] myRow = dt.Select();//可以类似dt.Select("id>10")之形式达到数据筛选目的
            int       i     = 0;
            int       j     = 0;

            StringBuilder sb = new StringBuilder();

            sb.Append("<table borderColor='black' border='1' >");
            sb.Append("<thead>");
            sb.Append("<tr>");
            //取得数据表各列标题,各标题之间以t分割,最后一个列标题后加回车符
            for (i = 0; i < titleCol.Length; i++)
            {
                sb.Append("<th>" + titleCol[i].ToString() + "</th>");
            }
            sb.Append("</tr>");
            sb.Append("</thead>");
            sb.Append("<tbody>");
            //向HTTP输出流中写入取得的数据信息
            //逐行处理数据

            foreach (DataRow dr in dt.Rows)
            {
                sb.Append("<tr>");
                for (i = 0; i < titleCol.Length; i++)
                {
                    switch (i)
                    {
                    case 0:
                        sb.Append("<td>" + dr["nick_name"].ToString() + "</td>");
                        break;

                    case 1:
                        sb.Append("<td>" + dr["sex"].ToString() + "</td>");
                        break;

                    case 2:
                        sb.Append("<td>" + Utils.StrToDateTime(dr["birthday"].ToString()).Year + "</td>");
                        break;

                    case 3:
                        sb.Append("<td>" + Utils.StrToDateTime(dr["birthday"].ToString()).Month + "</td>");
                        break;

                    case 4:
                        sb.Append("<td>" + Utils.StrToDateTime(dr["birthday"].ToString()).Day + "</td>");
                        break;

                    case 5:
                        sb.Append("<td>" + dr["mobile"].ToString() + "</td>");
                        break;

                    case 6:
                        sb.Append("<td></td>");
                        break;

                    case 7:
                        sb.Append("<td></td>");
                        break;

                    case 8:
                        sb.Append("<td></td>");
                        break;

                    case 9:
                        sb.Append("<td>" + dr["mobile"].ToString() + "</td>");
                        break;

                    case 10:
                        sb.Append("<td></td>");
                        break;

                    case 11:
                        sb.Append("<td>" + dr["email"].ToString() + "</td>");
                        break;

                    case 12:
                        sb.Append("<td></td>");
                        break;

                    case 13:
                        sb.Append("<td></td>");
                        break;

                    case 14:
                        sb.Append("<td>" + dr["qq"].ToString() + "</td>");
                        break;

                    case 15:
                        sb.Append("<td>" + dr["area"].ToString() + "," + dr["address"].ToString() + "</td>");
                        break;

                    case 16:
                        sb.Append("<td></td>");
                        break;

                    case 17:
                        sb.Append("<td></td>");
                        break;

                    case 18:
                        sb.Append("<td>" + getexp(dr["exp"].ToString()) + "</td>");
                        break;

                    case 19:
                        sb.Append("<td></td>");
                        break;

                    case 20:
                        sb.Append("<td></td>");
                        break;

                    case 21:
                        sb.Append("<td></td>");
                        break;

                    case 22:
                        sb.Append("<td></td>");
                        break;

                    case 23:
                        sb.Append("<td></td>");
                        break;

                    case 24:
                        sb.Append("<td></td>");
                        break;

                    case 25:
                        sb.Append("<td></td>");
                        break;

                    case 26:
                        sb.Append("<td></td>");
                        break;

                    case 27:
                        sb.Append("<td></td>");
                        break;
                    }
                }
                sb.Append("</tr>");
            }
            sb.Append("</tbody></table>");
            Response.Write(sb.ToString());
            Response.End();
        }