Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _users = new Tea.Web.UI.ShopPage().GetUserInfo();
        data_type.DataSource = Tea.DBUtility.DbHelperSQL.Query("select * from shop_article_category where channel_id=7 and call_index='1' order by sort_id desc");
        data_type.DataBind();

        key       = TWRequest.GetQueryString("key");
        this.page = TWRequest.GetQueryInt("page", 1);
        this.tid  = TWRequest.GetQueryInt("tid", 0);
        this.hid  = TWRequest.GetQueryInt("hid", 0);
        this.sort = TWRequest.GetQueryInt("sort", 0);


        if (sort == 1)
        {
            _orderby = "add_time desc,id desc";
        }
        if (sort == 2)
        {
            _orderby = "click desc";
        }
        if (sort == 3)
        {
            _orderby = "market_price,id";
        }
        if (sort == 4)
        {
            _orderby = "market_price desc,id";
        }
        if (tid != 0)
        {
            _sql  = _sql + " and (category_id=" + tid + " or more_type like'%," + tid + ",%')";
            tname = new Tea.BLL.article_category().GetTitle(tid);
            try
            {
                Tea.Model.article_category model = new Tea.BLL.article_category().GetModel(tid);
                title    = model.seo_title;
                keyword  = model.seo_keywords;
                describe = model.seo_description;
            }
            catch (Exception eee) { }
        }
        if (!string.IsNullOrEmpty(key))
        {
            _sql  = _sql + " and title like'%" + key + "%'";
            tname = key;
        }
        Tea.Web.UI.ShopPage bll_view = new Tea.Web.UI.ShopPage();

        data_list.DataSource = bll_view.GetViewList("view_article_product", "", this.pageSize, this.page, _sql, _orderby, out this.totalCount);
        data_list.DataBind();

        string pageUrl = Utils.CombUrlTxt("index.aspx", "tid={0}&key={1}&sort={2}&page={3}", tid.ToString(), key.ToString(), sort.ToString(), "__id__");

        PageContent.InnerHtml = Utils.OutPageListWeb(this.pageSize, this.page, this.totalCount, pageUrl, 8);
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        key       = TWRequest.GetQueryString("key");
        this.page = TWRequest.GetQueryInt("page", 1);

        _sql = _sql + " and quan_where='zhe'";
        Tea.BLL.article bll = new Tea.BLL.article();

        Tea.Web.UI.ShopPage bll_view = new Tea.Web.UI.ShopPage();

        data_list.DataSource = bll_view.GetViewList("shop_quan", "", this.pageSize, this.page, _sql, _orderby, out this.totalCount);
        data_list.DataBind();

        string pageUrl = Utils.CombUrlTxt("quan.aspx", "key={0}&page={1}", key.ToString(), "__id__");

        PageContent.InnerHtml = Utils.OutPageListWeb(this.pageSize, this.page, this.totalCount, pageUrl, 8);
    }
Ejemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        key       = TWRequest.GetQueryString("key");
        this.page = TWRequest.GetQueryInt("page", 1);
        this.tid  = TWRequest.GetQueryInt("tid", 0);
        this.sort = TWRequest.GetQueryInt("sort", 0);
        DataSet ds = new Tea.BLL.basic().GetList(0, "basic_where='news'", "basic_sort");

        data_news.DataSource = ds;
        data_news.DataBind();
        if (tid == 0)
        {
            if (ds.Tables[0].Rows.Count > 0)
            {
                tid = Utils.StrToInt(ds.Tables[0].Rows[0]["basic_value"].ToString(), 0);
            }
        }
        if (sort == 1)
        {
            _orderby = "add_time desc,id desc";
        }
        if (sort == 2)
        {
            _orderby = "add_time,id";
        }
        if (tid != 0)
        {
            _sql = _sql + " and category_id=" + tid + "";
        }
        if (!string.IsNullOrEmpty(key))
        {
            _sql = _sql + " and title like'%" + key + "%'";
        }
        Tea.Web.UI.ShopPage bll_view = new Tea.Web.UI.ShopPage();


        data_list.DataSource = bll_view.GetViewList("shop_about", "", this.pageSize, this.page, _sql, _orderby, out this.totalCount);
        data_list.DataBind();

        string pageUrl = Utils.CombUrlTxt("news.aspx", "tid={0}&sort={1}&page={2}", sort.ToString(), "__id__");

        PageContent.InnerHtml = Utils.OutPageListWeb(this.pageSize, this.page, this.totalCount, pageUrl, 8);
    }
Ejemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        id   = TWRequest.GetQueryInt("id");
        del  = TWRequest.GetQueryInt("del", 0);
        page = TWRequest.GetQueryInt("page", 1);
        if (id > 0)
        {
            Tea.BLL.goods_trace   bll_trace   = new Tea.BLL.goods_trace();
            Tea.Model.goods_trace model_trace = new Tea.Model.goods_trace();
            DataSet ds = Tea.DBUtility.DbHelperSQL.Query("select * from shop_goods_trace where user_name='" + userModel.user_name + "' and goods_id=" + id + "");
            if (ds.Tables[0].Rows.Count == 0)
            {
                Tea.Model.article model = new Tea.BLL.article().GetModel(id);
                model_trace.user_name   = userModel.user_name;
                model_trace.add_time    = System.DateTime.Now;
                model_trace.goods_id    = id;
                model_trace.goods_color = model.title;
                bll_trace.Add(model_trace);
            }
            Response.Redirect("goods.aspx");
        }
        if (del != 0)
        {
            Tea.Model.goods_trace model = new Tea.BLL.goods_trace().GetModel(del);
            if (model.user_name == userModel.user_name)
            {
                new Tea.BLL.goods_trace().Delete(del);
            }
            Response.Redirect("goods.aspx");
        }
        _sql = "username='******' ";

        Tea.Web.UI.ShopPage bll_view = new Tea.Web.UI.ShopPage();

        data_list.DataSource = bll_view.GetViewList("view_goods_trace", "", this.pageSize, this.page, _sql, _orderby, out this.totalCount);
        data_list.DataBind();
        show = data_list.Items.Count;
        string pageUrl = Utils.CombUrlTxt("goods.aspx", "page={0}", "__id__");

        PageContent.InnerHtml = Utils.OutPageListWeb(10, this.page, this.totalCount, pageUrl, 8);
    }
Ejemplo n.º 5
0
    private void RptBind(int _channel_id, int _category_id, string _strWhere, string _orderby)
    {
        string _sql = "";

        this.page = TWRequest.GetQueryInt("page", 1);
        if (this.category_id > 0)
        {
            this.ddlCategoryId.SelectedValue = _category_id.ToString();
            _sql = _sql + " and category_id in(select id from shop_article_category where class_list like '%," + _category_id + ",%')";
        }
        this.txtKeywords.Text = this.keywords;
        //圖表或列表顯示
        Tea.Web.UI.ShopPage bll_view = new Tea.Web.UI.ShopPage();
        this.rptList1.DataSource = bll_view.GetViewList("view_user_group_price", "", this.pageSize, this.page, _strWhere + _sql, _orderby, out this.totalCount);
        this.rptList1.DataBind();
        //綁定頁碼
        txtPageNum.Text = this.pageSize.ToString();
        string pageUrl = Utils.CombUrlTxt("goods.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}&page={4}&goods_ids={5}", _channel_id.ToString(), _category_id.ToString(), this.keywords, this.property, "__id__", this.goods_ids);

        PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
    }
Ejemplo n.º 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        key       = TWRequest.GetQueryString("key");
        this.page = TWRequest.GetQueryInt("page", 1);

        _sql = "user_id=" + userModel.id + "";
        Tea.BLL.article bll = new Tea.BLL.article();

        if (!string.IsNullOrEmpty(key))
        {
            _sql = _sql + " and title like'%" + key + "%'";
        }
        Tea.Web.UI.ShopPage bll_view = new Tea.Web.UI.ShopPage();

        data_list.DataSource = bll_view.GetViewList("view_order_point", "", this.pageSize, this.page, _sql, _orderby, out this.totalCount);
        data_list.DataBind();
        show = data_list.Items.Count;
        string pageUrl = Utils.CombUrlTxt("pint.aspx", "key={0}&page={1}", key.ToString(), "__id__");

        PageContent.InnerHtml = Utils.OutPageListWeb(this.pageSize, this.page, this.totalCount, pageUrl, 8);
    }
Ejemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        act = Request["act"];

        username = userModel.user_name;
        try
        {
            guo  = userModel.area.Split(',')[0].ToString();
            area = userModel.area.Split(',')[1].ToString();
            city = userModel.area.Split(',')[2].ToString();
            zip  = userModel.qq;
        }
        catch (Exception eee) { }
        try
        {
            year  = userModel.birthday.Value.Year.ToString();
            month = userModel.birthday.Value.Month.ToString();
            day   = userModel.birthday.Value.Day.ToString();
        }
        catch (Exception eee) { }
        data_guo.DataSource = Tea.DBUtility.DbHelperSQL.Query("select * from shop_basic where basic_where='city' order by basic_sort");
        data_guo.DataBind();
        if (act == "act_edit")
        {
            //檢查用戶是否登入
            Tea.Model.users model = new Tea.Web.UI.ShopPage().GetUserInfo();
            if (model == null)
            {
                Response.Write(ljd.function.LocalHint("對不起,用戶尚未登入或已超時!", "login.aspx"));
                return;
            }
            int    user_id     = model.id;
            string oldpassword = TWRequest.GetFormString("txt_pwd");
            string password    = TWRequest.GetFormString("txt_pwd1");
            if (!string.IsNullOrEmpty(oldpassword) && oldpassword != "ljd110!@#")
            {
                //檢查輸入的舊密碼
                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);
            }
            if (model.email.Length < 2 && !string.IsNullOrEmpty(TWRequest.GetFormString("txt_email").Trim()) && TWRequest.GetFormString("txt_email").Trim().Length > 5)
            {
                if (new Tea.BLL.users().ExistsEmail(TWRequest.GetFormString("txt_email").Trim()))
                {
                    Response.Write(ljd.function.LocalHint("此帳號信箱已存在於此網站,請換新mail", ""));
                    Response.End();
                }

                model.status = 1;
                try
                {
                    string mailTitle = "驗證郵箱通知信", mailContent = "";
                    string url = weburl + "mail/reg.aspx?id=" + model.id, ss = "";
                    mailContent = ljd.function.GetPage(url, out ss);
                    //發送郵件
                    TWMail.sendMail(config.emailsmtp, config.emailssl, config.emailport, config.emailusername, config.emailpassword, config.emailnickname, config.emailfrom, model.email, mailTitle, mailContent);
                }
                catch (Exception eee) { }
            }
            model.email     = TWRequest.GetFormString("txt_email");
            model.sex       = TWRequest.GetFormString("txt_sex");
            model.mobile    = TWRequest.GetFormString("txt_tel");
            model.address   = TWRequest.GetFormString("txt_address");
            model.exp       = TWRequest.GetFormInt("txt_sub");
            model.nick_name = TWRequest.GetFormString("txt_nichen");
            string birthday = TWRequest.GetFormString("txt_year").Trim() + "-" + TWRequest.GetFormString("txt_month").Trim() + "-" + TWRequest.GetFormString("txt_day").Trim();
            try
            {
                model.birthday = System.DateTime.Parse(birthday);
            }
            catch (Exception eee)
            {
                Response.Write(ljd.function.LocalHint("請輸入正確的日期!", ""));
                Response.End();
                return;
            }
            if (TWRequest.GetFormInt("txt_year") < 1900 || TWRequest.GetFormInt("txt_year") > System.DateTime.Now.Year)
            {
                Response.Write(ljd.function.LocalHint("請輸入正確的日期!", ""));
                Response.End();
                return;
            }
            if (TWRequest.GetFormString("txt_guo") == "台灣")
            {
                model.area = TWRequest.GetFormString("txt_guo") + "," + TWRequest.GetFormString("txt_state") + "," + TWRequest.GetFormString("txt_city");
            }
            else
            {
                model.area = TWRequest.GetFormString("txt_guo") + "," + TWRequest.GetFormString("txt_state1") + "," + TWRequest.GetFormString("txt_city1");
            }
            if (model.reg_time == null)
            {
                model.reg_time = System.DateTime.Now;
            }
            model.qq = TWRequest.GetFormString("txt_zip");
            //執行修改操作

            new Tea.BLL.users().Update(model);
            Response.Write(ljd.function.LocalHint("送出成功", "edituser.aspx"));
            return;
        }
    }
Ejemplo n.º 8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _users    = new Tea.Web.UI.ShopPage().GetUserInfo();
        key       = TWRequest.GetQueryString("key");
        this.page = TWRequest.GetQueryInt("page", 1);
        this.tid  = TWRequest.GetQueryInt("tid", 0);
        this.hid  = TWRequest.GetQueryInt("hid", 0);
        this.sort = TWRequest.GetQueryInt("sort", 0);


        if (sort == 1)
        {
            _orderby = "add_time desc,id desc";
        }
        if (sort == 2)
        {
            _orderby = "click desc";
        }
        if (sort == 3)
        {
            _orderby = "market_price,id";
        }
        if (sort == 4)
        {
            _orderby = "market_price desc,id";
        }
        if (tid != 0)
        {
            _sql  = _sql + " and (category_id=" + tid + " or more_type like'%," + tid + ",%')";
            tname = new Tea.BLL.article_category().GetTitle(tid);
        }
        if (!string.IsNullOrEmpty(key))
        {
            _sql   = _sql + " and (title like'%" + key + "%' or sub_title like'%" + key + "%')";
            sqlkey = sqlkey + " and (title like'%" + key + "%' or sub_title like'%" + key + "%')";

            tname = key;

            IList   _list = new ArrayList();
            DataSet ds    = Tea.DBUtility.DbHelperSQL.Query("select category_id,more_type from view_article_product where " + sqlkey);
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                if (!_list.Contains(dr["category_id"].ToString()))
                {
                    _list.Add(dr["category_id"].ToString());
                }
                string more_type = dr["more_type"].ToString();
                IList  __list    = more_type.Split(',');
                foreach (object ob in __list)
                {
                    if (!_list.Contains(ob.ToString()))
                    {
                        _list.Add(ob.ToString());
                    }
                }
            }
            sql = "0";
            foreach (object ob in _list)
            {
                if (!string.IsNullOrEmpty(ob.ToString()))
                {
                    sql = sql + "," + ob.ToString();
                }
            }
        }


        //Response.Write(sql);
        //Response.End();
        if (!string.IsNullOrEmpty(sql))
        {
            data_type.DataSource = Tea.DBUtility.DbHelperSQL.Query("select * from shop_article_category where channel_id=7 and id in(" + sql + ") and call_index='1' order by sort_id desc");
            data_type.DataBind();
        }

        Tea.Web.UI.ShopPage bll_view = new Tea.Web.UI.ShopPage();

        data_list.DataSource = bll_view.GetViewList("view_article_product", "", this.pageSize, this.page, _sql, _orderby, out this.totalCount);
        data_list.DataBind();

        string pageUrl = Utils.CombUrlTxt("search.aspx", "tid={0}&key={1}&sort={2}&page={3}", tid.ToString(), key.ToString(), sort.ToString(), "__id__");

        PageContent.InnerHtml = Utils.OutPageListWeb(this.pageSize, this.page, this.totalCount, pageUrl, 8);
    }
Ejemplo n.º 9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _sql       = "user_id='" + userModel.id + "' and status!=4";
        end        = TWRequest.GetQueryString("end");
        begin      = TWRequest.GetQueryString("begin");
        this.page  = TWRequest.GetQueryInt("page", 1);
        this.state = TWRequest.GetQueryInt("state", 0);
        this.day   = TWRequest.GetQueryInt("day", 0);
        del        = TWRequest.GetQueryInt("del");
        if (del > 0)
        {
            try
            {
                Tea.Model.orders model = bll.GetModel(del);
                if (model.user_id == userModel.id)
                {
                    if (model.status == 1)
                    {
                        model.status = 4;
                        bll.Update(model);
                        Response.Write(ljd.function.LocalHint("訂單取消成功!", "order.aspx"));
                    }
                    else
                    {
                        Response.Write(ljd.function.LocalHint("只是未確認的訂單才能取消!", "order.aspx"));
                    }
                }
            }
            catch (Exception eee) { }
        }


        if (state != 0)
        {
            if (state == 1)
            {
                _sql = _sql + " and payment_status=2";
            }
            if (state == 2)
            {
                _sql = _sql + " and express_status=2";
            }
            if (state == 3)
            {
                _sql = _sql + " and payment_status!=2";
            }
        }
        if (!string.IsNullOrEmpty(begin))
        {
            _sql = _sql + " and (add_time between '" + begin + "' and '" + end + "')";
        }
        if (day == 1)
        {
            _sql = "user_id='" + userModel.id + "' and status!=4 and datediff(year,add_time,getdate())=0";
        }


        Tea.Web.UI.ShopPage bll_view = new Tea.Web.UI.ShopPage();

        data_list.DataSource = bll_view.GetViewList("shop_orders", "", this.pageSize, this.page, _sql, _orderby, out this.totalCount);
        data_list.DataBind();
        show = data_list.Items.Count;

        string pageUrl = Utils.CombUrlTxt("order.aspx", "state={0}&day={1}&begin={2}&end={3}&page={4}", state.ToString(), day.ToString(), begin, end, "__id__");

        PageContent.InnerHtml = Utils.OutPageListWeb(this.pageSize, this.page, this.totalCount, pageUrl, 8);
    }