Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        DataSet ds = bll.GetList(100, "msn='" + System.DateTime.Now.ToString("yyyyMMdd") + "'", "id");

        foreach (DataRow dr in ds.Tables[0].Rows)
        {
            model = bll.GetModel(int.Parse(dr["id"].ToString()));
            try
            {
                string title = "積分清零提醒";
                string str   = "您還有" + dr["point"] + "積分年底到期請注意使用。";
                TWMail.sendMail(siteConfig.emailsmtp, siteConfig.emailssl, siteConfig.emailport, siteConfig.emailusername, siteConfig.emailpassword, siteConfig.emailnickname,
                                siteConfig.emailfrom, dr["email"].ToString(), title + " - " + siteConfig.webname + "", str);
            }
            catch (Exception eee) { }

            model.msn = System.DateTime.Now.ToString("yyyyMMdd");
            bll.Update(model);
        }

        if (ds.Tables[0].Rows.Count > 0)
        {
            Response.Write("正在發送請勿關閉本頁");
            Response.Redirect("mail.aspx");
        }
        else
        {
            Response.Write("發送完畢可以關閉本頁");
            Response.End();
        }
    }
Ejemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     id   = TWRequest.GetQueryInt("id");
     code = TWRequest.GetQueryString("code");
     Tea.Model.users model = bll.GetModel(id);
     if (model.password != code)
     {
         Response.Write(ljd.function.LocalHint("郵箱驗證失敗,請重新驗證", "reg.aspx"));
     }
     else
     {
         model.status = 0;
         bll.Update(model);
     }
 }
Ejemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     pwd = TWRequest.GetQueryString("pwd");
     id  = TWRequest.GetQueryInt("id");
     act = TWRequest.GetFormString("act");
     if (id > 0)
     {
         model = bll.GetModel(id);
         if (model.password != pwd)
         {
             Response.Write(ljd.function.LocalHint("該鏈接已經失效", "login.aspx"));
             Response.End();
         }
     }
     if (act == "act_edit")
     {
         model = bll.GetModel(id);
         //檢查輸入的舊密碼
         string oldpassword = TWRequest.GetFormString("txt_pwd");
         string password    = TWRequest.GetFormString("txt_pwd1");
         if (string.IsNullOrEmpty(oldpassword))
         {
             Response.Write(ljd.function.LocalHint("請輸入您的密碼!", ""));
             return;
         }
         //檢查輸入的新密碼
         if (string.IsNullOrEmpty(password))
         {
             Response.Write(ljd.function.LocalHint("請輸入確認密碼!", ""));
             return;
         }
         //舊密碼是否正確
         if (password != oldpassword)
         {
             Response.Write(ljd.function.LocalHint("對不起,您輸入的密碼不正確!", ""));
             return;
         }
         model.password = DESEncrypt.Encrypt(password, model.salt);
         bll.Update(model);
         Response.Write(ljd.function.LocalHint("重置密碼成功,請用新密碼登入", "login.aspx"));
         Response.End();
     }
 }
Ejemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        id   = Request["id"];
        name = Request["name"];
        if (!string.IsNullOrEmpty(id))
        {
            Tea.Model.users model = new Tea.Model.users();
            Tea.BLL.users   bll   = new Tea.BLL.users();
            //自動加入會員
            DataSet ds = bll.GetList(1, "user_name='" + id + "'", "id");

            if (ds.Tables[0].Rows.Count == 0)
            {
                model.group_id  = 1;
                model.status    = 0;
                model.user_name = id;
                model.password  = DESEncrypt.Encrypt(ljd.function.getUUIDString(12));
                //model.birthday = DateTime.Parse("1980-1-1");
                if (!string.IsNullOrEmpty(name))
                {
                    model.nick_name = name;
                }
                else
                {
                    model.nick_name = "暱名";
                }
                model.mobile   = "";
                model.address  = "";
                model.reg_time = DateTime.Now;
                model.reg_ip   = TWRequest.GetIP();
                model.user_hei = 1;
                model.point    = 0;
                model.avatar   = "https://graph.facebook.com/" + id + "/picture";
                try
                {
                    string tcode = Utils.GetCookie("tcode");
                    model.company = Utils.StrToInt(tcode, 0);
                }
                catch (Exception eee) { }
                int uid = bll.Add(model);

                model.id = uid;
                Session[TWKeys.SESSION_USER_INFO] = model;
                Session.Timeout = 4500;

                //防止Session提前過期
                Utils.WriteCookie(TWKeys.COOKIE_USER_NAME_REMEMBER, "Tea", model.user_name);
                Utils.WriteCookie(TWKeys.COOKIE_USER_PWD_REMEMBER, "Tea", model.password);



                //寫入登入日誌
                //new Tea.BLL.user_login_log().Add();
                if (model.email.Length < 2)
                {
                    Response.Write("2");
                    Response.End();
                }
                Response.Write("1");
                Response.End();
            }
            else
            {
                model        = bll.GetModel(id);
                model.avatar = "https://graph.facebook.com/" + id + "/picture";

                bll.Update(model);
                if (model == null)
                {
                    //Response.Write(Tea.Common.Utils.LocalHint("您已更改本站密碼,請用本站密碼登入!", "/login.aspx"));
                    //Response.End();
                }
            }
            //防止Session提前過期
            try
            {
                Session[TWKeys.SESSION_USER_INFO] = model;
                Session.Timeout = 4500;

                //防止Session提前過期
                Utils.WriteCookie(TWKeys.COOKIE_USER_NAME_REMEMBER, "Tea", model.user_name);
                Utils.WriteCookie(TWKeys.COOKIE_USER_PWD_REMEMBER, "Tea", model.password);


                //寫入登入日誌
                //new Tea.BLL.user_login_log().Add(model.id, model.user_name, "會員登入", TWRequest.GetIP());
                if (model.email.Length < 2)
                {
                    Response.Write("2");
                    Response.End();
                }
                Response.Write("1");
                Response.End();

                Tea.Model.cart_total cartModel = Tea.Web.UI.ShopCart.GetTotal(1);
                if (cartModel.total_quantity == 0)
                {
                    Response.Write("3");
                    Response.End();
                }
                else
                {
                    Response.Write("4");
                    Response.End();
                }
            }
            catch {// Response.Write("no"); Response.End();
            }
        }
    }