예제 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsUserAlreadyLogin)
        {
            MemberCenterPageRedirect("", "goodsadd.aspx");
            return;
        }

        if (!IsPostBack)
        {
            DataTable dt = XiHuan_GoodsTypeFacade.GetInstance().GetGoodsParentType();
            CommonMethod.BindDrop(ddlGoodType, dt, "TypeName", "Id");
            ddlGoodType.Items.Insert(0, new ListItem("选择换品类别", ""));
            CommonMethod.BindDrop(ddlGoodType1, dt, "TypeName", "Id");
            ddlGoodType1.Items.Insert(0, new ListItem("不限", ""));
            if (CurrentUser.IsStarUser != 1)
            {
                chkTJ.Checked = false;
                chkTJ.Enabled = false;
                chkTJ.ToolTip = "明星换客可使用此功能,将换品推荐到首页显示!";
            }
            if (IsEdit)
            {
                LoadGoodInfo();
            }
        }
    }
예제 #2
0
 protected void ddlGoodType_SelectedIndexChanged(object sender, EventArgs e)
 {
     ddlGoodChildType.Items.Clear();
     if (ddlGoodType.SelectedValue.Trim().Length > 0)
     {
         CommonMethod.BindDrop(ddlGoodChildType, XiHuan_GoodsTypeFacade.GetInstance().GetGoodsChildType(ddlGoodType.SelectedValue), "Name", "Id");
     }
     ddlGoodChildType.Items.Insert(0, new ListItem("选择小类", ""));
 }
예제 #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         DataTable dt = XiHuan_GoodsTypeFacade.GetInstance().GetGoodsParentType();
         CommonMethod.BindDrop(ddlGoodType, dt, "TypeName", "Id");
         ddlGoodType.Items.Insert(0, new ListItem("不限", ""));
     }
 }
예제 #4
0
    private void GetGoodsChildType(string ddlid, string parentid)
    {
        DataTable     dtchildtypeInfo = XiHuan_GoodsTypeFacade.GetInstance().GetGoodsChildType(parentid);
        StringBuilder sbChildInfo     = new StringBuilder("$('" + ddlid + "').options.length=0;");

        sbChildInfo.Append("$('" + ddlid + "').options.add(new Option('选择小类',''));");
        for (int i = 0; i < dtchildtypeInfo.Rows.Count; i++)
        {
            sbChildInfo.Append("$('" + ddlid + "').options.add(new Option('" + dtchildtypeInfo.Rows[i]["Name"] + "','" + dtchildtypeInfo.Rows[i]["Id"] + "'));");
        }
        CommonMethod.ResponseAjaxContent(this.Page, sbChildInfo.ToString());
    }
예제 #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsUserAlreadyLogin)
        {
            MemberCenterPageRedirect("", "goodlist.aspx");
        }

        if (!IsPostBack)
        {
            DataTable dt = XiHuan_GoodsTypeFacade.GetInstance().GetGoodsParentType();
            CommonMethod.BindDrop(ddlGoodType, dt, "TypeName", "Id");
            ddlGoodType.Items.Insert(0, new ListItem("不限", ""));
            CommonMethod.BindDrop(ddlGoodState, XiHuan_UserGoodsFacade.GetGoodsState(), "Text", "Value");
            ddlGoodState.Items.Insert(0, new ListItem("不限", ""));
            BindData();
        }
    }
예제 #6
0
    private void LoadGoodInfo()
    {
        TitleName.Text = "修改换品";
        btnSubmit.Text = "保存修改";
        XiHuan_UserGoodsEntity goodinfo = XiHuan_UserGoodsEntityAction.RetrieveAXiHuan_UserGoodsEntity(CommonMethod.ConvertToInt(Request["id"], 0));

        if (goodinfo != null)
        {
            txtGoodName.Text = goodinfo.Name;
            chkTJ.Checked    = (goodinfo.IsTJ == 1);
            CommonMethod.SelectFlg(ddlGoodType, goodinfo.TypeId.ToString());
            CommonMethod.BindDrop(ddlGoodChildType, XiHuan_GoodsTypeFacade.GetInstance().GetGoodsChildType(goodinfo.TypeId.ToString()), "Name", "Id");
            CommonMethod.SelectFlg(ddlGoodChildType, goodinfo.ChildId.ToString());
            CommonMethod.SelectFlg(ddlGoodType1, goodinfo.HopeToChangeTypeId.ToString());
            CommonMethod.BindDrop(ddlGoodChildType1, XiHuan_GoodsTypeFacade.GetInstance().GetGoodsChildType(goodinfo.HopeToChangeChildTypeId.ToString()), "Name", "Id");
            CommonMethod.SelectFlg(ddlGoodChildType1, goodinfo.HopeToChangeChildTypeId.ToString());
            trimage.Visible   = uploadimage.Visible = false;
            txtGoodDesc.Value = goodinfo.Description;
            CommonMethod.SelectFlg(ddlNewOldDeep, goodinfo.NewDeep.ToString());
            chkValidCity.Checked     = (goodinfo.OnlyCityChange == 1);
            chkValidSchool.Checked   = (goodinfo.OnlySchoolChange == 1);
            txtHopeToChangeDesc.Text = goodinfo.HopeToChangeDesc;
        }
    }
예제 #7
0
    private void LoadInfo()
    {
        #region 换品排行榜

        string sql = @"select top 18 Id,Name,DefaultPhoto,ViewCount,DetailUrl from XiHuan_UserGoods with(nolock) where GoodState!=3 and IsChecked=1 order by NewId();
         select top 15 Id,UserName,HeadImage from XiHuan_UserInfo with(nolock) where IsStarUser=1 order by GoodsNumber desc;
         select top 15 Id,DefaultPhoto,Name,DetailUrl from XiHuan_UserGoods with(nolock) where GoodState!=3 and IsChecked=1 order by CreateDate desc;
         select top 15 Id,DefaultPhoto,Name,DetailUrl from XiHuan_UserGoods with(nolock) where GoodState=3 and IsChecked=1 order by CreateDate desc;
         select top 15 Id,DefaultPhoto,Name,DetailUrl from XiHuan_UserGoods with(nolock) where IsTJ=1 and GoodState!=3  and IsChecked=1 order by  NewId();
         select Name,Url,Alt from XiHuan_Links with(nolock) order by Sort asc;
         select top 3 Title,NewsUrl from XiHuan_News with(nolock) where Type={0} order by SortNumber asc;
         select top 6 Title,NewsUrl from XiHuan_News with(nolock) where Type={1} order by SortNumber asc;
         select top 10 Title,NewsUrl from XiHuan_News with(nolock) where Type={2} order by SortNumber asc;
         select top 10 Title,NewsUrl from XiHuan_News with(nolock) where Type={3} order by SortNumber asc;
         select top 15 Id,UserName,HeadImage from XiHuan_UserInfo with(nolock) order by RegisterDate desc;";

        DataSet ds = Query.ProcessMultiSql(string.Format(sql, XiHuan_NewsFacade.NewsType.站内公告.ToString("d"), XiHuan_NewsFacade.NewsType.最新服务.ToString("d"), XiHuan_NewsFacade.NewsType.精彩资讯.ToString("d"), XiHuan_NewsFacade.NewsType.站内新闻.ToString("d")), GlobalVar.DataBase_Name);
        dlsHotGoods.DataSource = ds.Tables[0];
        dlsHotGoods.DataBind();

        #endregion

        #region 明星换客

        rptStartUser.DataSource = ds.Tables[1];
        rptStartUser.DataBind();

        #endregion

        #region 最新换品

        rptNewGoods.DataSource = ds.Tables[2];
        rptNewGoods.DataBind();

        #endregion

        #region 最近成交

        rptSuccess.DataSource = ds.Tables[3];
        rptSuccess.DataBind();

        #endregion

        #region 推荐换品

        rptTJ.DataSource = ds.Tables[4];
        rptTJ.DataBind();

        #endregion

        #region 友情链接
        rptLinks.DataSource = ds.Tables[5];
        rptLinks.DataBind();
        #endregion

        #region 公告
        rptNotic.DataSource = ds.Tables[6];
        rptNotic.DataBind();
        #endregion

        #region 最新服务
        rptNewService.DataSource = ds.Tables[7];
        rptNewService.DataBind();
        #endregion

        //#region 精彩资讯
        //rptZiXun.DataSource = ds.Tables[8];
        //rptZiXun.DataBind();
        //#endregion

        //#region 站内新闻
        //rptSiteNews.DataSource = ds.Tables[9];
        //rptSiteNews.DataBind();
        //#endregion

        #region 换品分类

        DataTable dtparenttype = XiHuan_GoodsTypeFacade.GetInstance().GetGoodsParentType();
        for (int i = 0; i <= 8; i++)
        {
            DataRow[]     dr = dtparenttype.Select("FixId=" + i);
            StringBuilder sb = new StringBuilder();
            foreach (DataRow row in dr)
            {
                sb.AppendFormat("<li><a title=\"{0}\" href=\"searchlist.aspx?typeid={1}\" target=\"_blank\">{0}</a>", row["TypeName"], row["Id"]);
                sb.Append("<ul>");
                DataTable dtchildType = XiHuan_GoodsTypeFacade.GetInstance().GetGoodsChildType(row["Id"].ToString());
                foreach (DataRow childrow in dtchildType.Rows)
                {
                    sb.AppendFormat(" <li><a title=\"{0}\" href=\"searchlist.aspx?typeid={1}&childid={2}\" target=\"_blank\">{0}</a></li>", childrow["Name"], row["Id"], childrow["Id"]);
                }
                sb.Append("</ul>");
                sb.Append("</li>");
            }
            switch (i)
            {
            case 0: FixOne = sb.ToString(); break;

            case 1: FixTwo = sb.ToString(); break;

            case 2: FixThree = sb.ToString(); break;

            case 3: FixFour = sb.ToString(); break;

            case 4: FixFive = sb.ToString(); break;

            case 5: FixSix = sb.ToString(); break;

            case 6: FixServen = sb.ToString(); break;

            case 7: FixEight = sb.ToString(); break;

            case 8: FixNine = sb.ToString(); break;

            default: break;
            }
        }
        #endregion

        #region 喜换新人

        rptNewUser.DataSource = ds.Tables[10];
        rptNewUser.DataBind();

        #endregion
    }
예제 #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            CommonMethod.BindDrop(ddlProvince, ProvinceCityFacade.GetInstance().GetProvince(), "province", "provinceId");
            ddlProvince.Items.Insert(0, new ListItem("不限省份", ""));
            CommonMethod.BindDrop(ddlGoodType, XiHuan_GoodsTypeFacade.GetInstance().GetGoodsParentType(), "TypeName", "Id");
            ddlGoodType.Items.Insert(0, new ListItem("不限类别", ""));
            if (CommonMethod.FinalString(Request["typeid"]).Length > 0)
            {
                CommonMethod.SelectFlg(ddlGoodType, Request["typeid"]);
            }
            if (CommonMethod.FinalString(Request["childid"]).Length > 0)
            {
                CommonMethod.BindDrop(ddlGoodChildType, XiHuan_GoodsTypeFacade.GetInstance().GetGoodsChildType(Request["typeid"]), "Name", "Id");
                CommonMethod.SelectFlg(ddlGoodChildType, Request["childid"]);
                ddlGoodChildType.Items.Insert(0, new ListItem("不限子类别", ""));
            }

            if (CommonMethod.FinalString(Request["province"]).Length > 0)
            {
                CommonMethod.SelectFlg(ddlProvince, Request["province"]);
            }
            if (CommonMethod.FinalString(Request["city"]).Length > 0)
            {
                CommonMethod.BindDrop(ddlCity, ProvinceCityFacade.GetInstance().GetCityInfo(Request["province"]), "city", "cityID");
                CommonMethod.SelectFlg(ddlCity, Request["city"]);
                ddlCity.Items.Insert(0, new ListItem("不限城市", ""));
            }
            if (CommonMethod.FinalString(Request["area"]).Length > 0)
            {
                CommonMethod.BindDrop(ddlArea, ProvinceCityFacade.GetInstance().GetAreaInfo(Request["city"]), "area", "areaId");
                CommonMethod.SelectFlg(ddlArea, Request["area"]);
                ddlArea.Items.Insert(0, new ListItem("不限地区", ""));
            }
            if (CommonMethod.FinalString(Request["school"]).Length > 0)
            {
                CommonMethod.BindDrop(ddlSchool, ProvinceCityFacade.GetInstance().GetSchoolInfo(Request["province"], Request["city"]), "SchoolName", "Id");
                CommonMethod.SelectFlg(ddlSchool, Request["school"]);
                ddlSchool.Items.Insert(0, new ListItem("不限学校", ""));
            }

            if (CommonMethod.FinalString(Request["keyword"]).Length > 0)
            {
                txtGoodName.Text = GlobalObject.unescape(Request["keyword"]);
            }
            if (CommonMethod.FinalString(Request["ownername"]).Length > 0)
            {
                txtOwnerName.Text = GlobalObject.unescape(Request["ownername"]);
            }
            CommonMethod.SelectFlg(ddlTime, Request["time"]);
            CommonMethod.SelectFlg(ddlNewOldDeep, Request["newdeep"]);
            CommonMethod.SelectFlg(ddlOrderBy, Request["sort"]);
            chkHavePhoto.Checked = (CommonMethod.FinalString(Request["ph"]).Equals("true"));
            chkShow.Checked      = (CommonMethod.FinalString(Request["sc"]).Equals("true"));
            BindData();
        }

        lblLinkName.Text = "";
        string area = CommonMethod.FinalString(Request["changearea"]);

        if (area.Length > 0)
        {
            string type = "同城换区";
            string url  = "citychange.html";
            if (area.Equals("school"))
            {
                type = "校园换区";
                url  = "schoolchange.html";
            }
            if (area.Equals("idea"))
            {
                type = "创意换区";
                url  = "searchlist.aspx?type=idea";
            }

            lblLinkName.Text += string.Format(">><a href=\"{1}\">{0}</a>", type, url);
            title            += "-" + type;
        }

        if (ddlProvince.SelectedValue.Trim().Length > 0)
        {
            lblLinkName.Text += string.Format(">><a href=\"searchlist.aspx?province={0}\">{1}</a>", ddlProvince.SelectedValue, ddlProvince.SelectedItem.Text);
            title            += "-" + ddlProvince.SelectedItem.Text;
        }
        if (ddlCity.SelectedValue.Trim().Length > 0)
        {
            lblLinkName.Text += string.Format(">><a href=\"searchlist.aspx?city={0}\">{1}</a>", ddlCity.SelectedValue, ddlCity.SelectedItem.Text);
            title            += "  " + ddlCity.SelectedItem.Text;
        }
        if (ddlSchool.SelectedValue.Trim().Length > 0)
        {
            lblLinkName.Text += string.Format(">><a href=\"searchlist.aspx?province={2}&city={3}&school={0}\">{1}</a>", ddlSchool.SelectedValue, ddlSchool.SelectedItem.Text, ddlProvince.SelectedValue, ddlCity.SelectedValue);
            title            += "  " + ddlSchool.SelectedItem.Text;
        }
        if (ddlGoodType.SelectedValue.Trim().Length > 0)
        {
            lblLinkName.Text += string.Format(">><a href=\"searchlist.aspx?typeid={0}\">{1}</a>", ddlGoodType.SelectedValue, ddlGoodType.SelectedItem.Text);
            title            += "-" + ddlGoodType.SelectedItem.Text;
        }

        if (ddlGoodChildType.SelectedValue.Trim().Length > 0)
        {
            lblLinkName.Text += string.Format(">><a href=\"searchlist.aspx?typeid={0}&childid={1}\">{2}</a>", ddlGoodType.SelectedValue, ddlGoodChildType.SelectedValue, ddlGoodChildType.SelectedItem.Text);
            title            += "-" + ddlGoodChildType.SelectedItem.Text;
        }

        if (txtGoodName.Text.Trim().Length > 0)
        {
            lblLinkName.Text += string.Format(">><a href=\"searchlist.aspx?keyword={0}\">{1}</a>", Microsoft.JScript.GlobalObject.escape(txtGoodName.Text.Trim()), txtGoodName.Text.Trim());
            title            += "-" + txtGoodName.Text;
        }
        if (CommonMethod.FinalString(Request["ownername"]).Length > 0 && CommonMethod.FinalString(Request["ownerid"]).Length > 0)
        {
            lblLinkName.Text += string.Format(">><a href=\"xh.aspx?id={0}\">{1}</a>的所有换品</a>", Request["ownerid"], Server.UrlDecode(Request["ownername"]));
            title            += "-" + Server.UrlDecode(Request["ownername"]) + " 的所有换品";
        }
    }
예제 #9
0
 protected void btnRefreshType_Click(object sender, EventArgs e)
 {
     XiHuan_GoodsTypeFacade.Refresh();
     Alert("刷新成功!");
 }