Esempio n. 1
0
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        TPortalClass.JpGoods JpGoods = new TPortalClass.JpGoods();
        string ls_tip = "删除成功!";
        for (int i = 0; i < rptList.Items.Count; i++)
        {
            string id = ((HiddenField)rptList.Items[i].FindControl("hidId")).Value;
            CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
            if (cb.Checked)
            {
                JpGoods.id = int.Parse(id);
                JpGoods.Delete();
            }
        }
        string pageUrl = JpCommon.CombUrlTxt("list_shop_tg.aspx", "page={0}&rnd={1}&cid={2}",
            "" + this.txtPage.Text + "", "" + System.Guid.NewGuid().ToString() + "", "" + txtcid.Value + "");

        //写系统日志

        string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
        if (userip == null || userip == "")
        {
            userip = Request.ServerVariables["REMOTE_ADDR"];
        }
        JpCommon.WriteLog(userip, "删除", "批量删除商城记录", Session["uid"].ToString(), Session["uname"].ToString());
        Response.Write("<script>alert('" + ls_tip + "');window.location='" + pageUrl + "';</script>");
    }
Esempio n. 2
0
    public string showPrivilege()
    {
        StringBuilder stringBuilder = new StringBuilder();
        JpGoods jpGoods = new JpGoods();
        DataTable dt = jpGoods.getPrivilege(10);
        string strTitle = "";
        for (int i = 0; i < dt.Rows.Count; i++)
        {

            strTitle = dt.Rows[i]["hy_goodsname"].ToString();
            if (strTitle.Length > 18)
            {
                strTitle = strTitle.Substring(0, 18);
            }
            stringBuilder.Append("<a onclick=\"locationDetail('" + dt.Rows[i]["hy_linkurl"].ToString() + "','" + locationType + "','0')\" > <li>");
            HyFileatt hyFileatt = new HyFileatt();
            DataTable dt_img = hyFileatt.Getdocsfm(dt.Rows[i]["docid"].ToString());
            if (dt_img.Rows.Count > 0)
            {
                stringBuilder.Append("<img src=\"" + dt_img.Rows[0]["hy_filepath"].ToString() + "\">");
            }
            stringBuilder.Append("<p>" + strTitle + "</p>");
            stringBuilder.Append("<span>¥" + Convert.ToDecimal(dt.Rows[i]["hy_goodsprice"].ToString()).ToString("0.00") + "</span><i class=\"btn-dg\">订购</i></li></a>");
        }
        return stringBuilder.ToString();
    }
Esempio n. 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     cid = this.Request.QueryString["cid"].ToString();
     JpGoods jpGoods = new JpGoods();
     if (this.Request.QueryString["type"] != null)
     {
         strType = this.Request.QueryString["type"].ToString();
     }
     string strWhere = "";
     if (strType == "0")
     {
         strWhere = " and hy_cid like '" + cid + "%' and hy_ifsh='2' ";
     }
     else if (strType == "1")
     {
         strWhere = " and (hy_cid = '006001001' or hy_cid='006002001' or  hy_cid='006003001'  or  hy_cid='006004001') and hy_ifsh='2' ";
     }
     else if (strType == "2")
     {
         strWhere = " and (hy_cid = '006001002' or hy_cid='006002002' or  hy_cid='006003002'  or  hy_cid='006004002') and hy_ifsh='2' ";
     }
     else if (strType == "3")
     {
         strWhere = " and (hy_cid = '006001003' or hy_cid='006002003' or  hy_cid='006003003'  or  hy_cid='006004003') and hy_ifsh='2' ";
     }
     pis_totalCount = jpGoods.getDataByCidCount(strWhere);
 }
Esempio n. 4
0
    //保存
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (this.Session["uid"] == null || this.Session["uid"].ToString() == "")
        {
            this.Response.Redirect("../login.aspx");
        }
        string ls_tip = "提交成功!";
        TPortalClass.DAO db = new TPortalClass.DAO();

        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        TPortalClass.JpGoods JpGoods = new TPortalClass.JpGoods();

        JpGoods.hy_cid =ddlcolname.Value;
        JpGoods.hy_goodsname = txthy_goodsname.Text;
        JpGoods.hy_goodstitle = txthy_goodstitle.Text;
        JpGoods.hy_linkurl = txthy_linkurl.Text;
        JpGoods.hy_content = txthy_content.Text;
        JpGoods.hy_goodsprice = Convert.ToDouble(txthy_goodsprice.Text);
        JpGoods.hy_sort = Convert.ToInt32(txthy_sort.Text);
        JpGoods.hy_ifsh = 0;
        JpGoods.docid = this.txtDocid.Value;

        if (this.txtop.Value == "add")
        {
            //写系统日志
            string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
            if (userip == null || userip == "")
            {
                userip = Request.ServerVariables["REMOTE_ADDR"];
            }
            JpCommon.WriteLog(userip, "新增", "新增商品记录[id:" + this.txtid.Value + "]", Session["uid"].ToString(), Session["uname"].ToString());

            JpGoods.Insert();

        }
        else
        {

            //写系统日志
            string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
            if (userip == null || userip == "")
            {
                userip = Request.ServerVariables["REMOTE_ADDR"];
            }
            JpCommon.WriteLog(userip, "修改", "修改广告链接记录[id:" + this.txtid.Value + "]", Session["uid"].ToString(), Session["uname"].ToString());

            JpGoods.id = int.Parse(txtid.Value.Trim());
            JpGoods.Update();
        }
        Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
    }
Esempio n. 5
0
 public string RptBind()
 {
     //获取数据
     StringBuilder stringBuilder = new StringBuilder();
     JpGoods jpGoods = new JpGoods();
     string strWhere = "";
     if (strType == "0")
     {
         strWhere = " and hy_cid like '" + cid + "%' and hy_ifsh='2' ";
     }
     else if (strType == "1")
     {
         strWhere = " and hy_cid like '" + cid + "%' and hy_ifsh='2' ";
     }
     else if (strType == "2")
     {
         strWhere = " and hy_cid like '" + cid + "%' and hy_ifsh='2' ";
     }
     else if (strType == "3")
     {
         strWhere = " and hy_cid like '" + cid + "%' and hy_ifsh='2' ";
     }
     DataTable dt = jpGoods.getDataByCid(10, strWhere);
     string strTitle = "";
     if (dt.Rows.Count > 0)
     {
         for (int i = 0; i < dt.Rows.Count; i++)
         {
             strTitle = dt.Rows[i]["hy_goodsname"].ToString();
             if (strTitle.Length > 18)
             {
                 strTitle = strTitle.Substring(0, 18) + "...";
             }
             stringBuilder.Append("<li>");
             HyFileatt hyFileatt = new HyFileatt();
             DataTable dt_img = hyFileatt.Getdocsfm(dt.Rows[i]["docid"].ToString());
             if (dt_img.Rows.Count > 0)
             {
                 stringBuilder.Append("<a onclick=\"locationDetail('" + dt.Rows[i]["hy_linkurl"].ToString() + "','" + locationType + "')\"><img src=\"" + dt_img.Rows[0]["hy_filepath"].ToString() + "\">");
             }
             stringBuilder.Append("<h1>");
             stringBuilder.Append("" + strTitle + "</h1><p class=\"fleft\">" + JpCommon.DateDiff(DateTime.Now, Convert.ToDateTime(dt.Rows[i]["hy_addtime"].ToString())) + "</p></a></li>");
         }
     }
     return stringBuilder.ToString();
 }
Esempio n. 6
0
 public string showScroll()
 {
     StringBuilder stringBuilder = new StringBuilder();
     JpGoods jpGoods = new JpGoods();
     DataTable dt = jpGoods.getNewsGood(5);
     string strTitle = "";
     for (int i = 0; i < dt.Rows.Count; i++)
     {
         strTitle = dt.Rows[i]["hy_goodsname"].ToString();
         if (strTitle.Length > 18)
         {
             strTitle = strTitle.Substring(0, 18);
         }
         stringBuilder.Append("<li>");
         stringBuilder.Append("<div class=\"slide\">");
         HyFileatt hyFileatt = new HyFileatt();
         DataTable dt_img = hyFileatt.Getdocsfm(dt.Rows[i]["docid"].ToString());
         if (dt_img.Rows.Count > 0)
         {
             stringBuilder.Append("<a onclick=\"locationDetail('" + dt.Rows[i]["hy_linkurl"].ToString() + "','" + locationType + "','0')\" ><img src=\"" + dt_img.Rows[0]["hy_filepath"].ToString() + "\" alt=\"" + strTitle + "\" >");
         }
         stringBuilder.Append("<div class=\"caption\">");
         stringBuilder.Append("<p class=\"title\">" + strTitle + "</p>");
         stringBuilder.Append("</div></a>");
         stringBuilder.Append("</div>");
         stringBuilder.Append("</li>");
     }
     return stringBuilder.ToString();
 }
Esempio n. 7
0
    private void DataPlay()
    {
        if (this.Request.QueryString["op"] != null)
        {
            this.txtop.Value = this.Request.QueryString["op"].ToString();           //新增还是修改
        }

        if (this.Request.QueryString["id"] != null)
        {
            this.txtid.Value = this.Request.QueryString["id"].ToString();     //文档ID
        }
        TPortalClass.JpGoods JpGoods = new TPortalClass.JpGoods();

        //旧文档
        if (this.txtop.Value == "modify")
        {
            DataTable dt = JpGoods.Getdocbyid(int.Parse(this.txtid.Value));
            if (dt.Rows.Count > 0)
            {
                this.txtDocid.Value = dt.Rows[0]["docid"].ToString();
                this.txtid.Value = dt.Rows[0]["id"].ToString();
                this.txtcid.Value = dt.Rows[0]["hy_cid"].ToString();
                ddlcolname.Value = dt.Rows[0]["hy_cid"].ToString();
                this.txthy_goodsname.Text = dt.Rows[0]["hy_goodsname"].ToString();
                this.txthy_goodstitle.Text = dt.Rows[0]["hy_goodstitle"].ToString();
                this.txthy_linkurl.Text = dt.Rows[0]["hy_linkurl"].ToString();
                this.txthy_content.Text = dt.Rows[0]["hy_content"].ToString();
                this.txthy_goodsprice.Text = dt.Rows[0]["hy_goodsprice"].ToString();
                this.txthy_sort.Text = dt.Rows[0]["hy_sort"].ToString();
            }
        }
        else
        {
            this.txthy_sort.Text = (JpGoods.GetMaxSort()).ToString();
        }
    }
Esempio n. 8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     string strCid = "";
     int ls_page = 1, ls_pagesize = 10;
     string strType = "";
     TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
     //获取参数
     if (this.Request.QueryString["cid"] != null)
     {
         strCid = this.Request.QueryString["cid"].ToString();
     }
     if (this.Request.QueryString["page"] != null)
     {
         ls_page = Convert.ToInt32(this.Request.QueryString["page"].ToString());
     }
     if (this.Request.QueryString["pagesize"] != null)
     {
         ls_pagesize = Convert.ToInt32(this.Request.QueryString["pagesize"].ToString());
     }
     if (this.Request.QueryString["type"] != null)
     {
         strType = this.Request.QueryString["type"].ToString();
     }
     JpGoods jpGoods = new JpGoods();
     string strWhere = " and  hy_cid like '" + strCid + "%' and hy_ifsh='2' ";
     if (strType == "0")
     {
         strWhere = " and hy_cid like '" + strCid + "%' and hy_ifsh='2' ";
     }
     else if (strType == "1")
     {
         strWhere = " and (hy_cid = '006001001' or hy_cid='006002001' or  hy_cid='006003001'  or  hy_cid='006004001') and hy_ifsh='2' ";
     }
     else if (strType == "2")
     {
         strWhere = " and (hy_cid = '006001002' or hy_cid='006002002' or  hy_cid='006003002'  or  hy_cid='006004002') and hy_ifsh='2' ";
     }
     else if (strType == "3")
     {
         strWhere = " and (hy_cid = '006001003' or hy_cid='006002003' or  hy_cid='006003003'  or  hy_cid='006004003') and hy_ifsh='2' ";
     }
     string orderby = " order by hy_addtime desc ";
     //获取数据
     DataTable dt = jpGoods.SearchdocsByKey(strWhere, orderby, ls_page, ls_pagesize);
     //复制一个DataTalbe
     DataTable tempTable = dt.Clone();
     //在现有的DatatTable增加一列
     DataColumn col = new DataColumn("showImg", typeof(String));
     //将列添加到DataTable中去
     tempTable.Columns.Add(col);
     DataColumn col2 = new DataColumn("showTime", typeof(String));
     //将列添加到DataTable中去
     tempTable.Columns.Add(col2);
     //循环  对DataTable重新赋值
     for (int i = 0; i < dt.Rows.Count; i++)
     {
         DataRow dr = tempTable.NewRow();
         for (int j = 0; j < dt.Columns.Count; j++)
         {
             dr[tempTable.Columns[j].ColumnName] = dt.Rows[i][j];
         }
         //获得间隔的时间
         HyFileatt hyFileatt = new HyFileatt();
         DataTable dt_img = hyFileatt.Getdocsfm(dt.Rows[i]["docid"].ToString());
         if (dt_img.Rows.Count > 0)
         {
             dr["showImg"] = dt_img.Rows[0]["hy_filepath"].ToString();
         }
         dr["showTime"] = JpCommon.DateDiff(DateTime.Now, Convert.ToDateTime(dt.Rows[i]["hy_addtime"].ToString()));
         tempTable.Rows.Add(dr);
     }
     //转换成json格式
     string strJson = JsonConvert.SerializeObject(tempTable);
     //数据抛出
     Response.Write(strJson);
 }
Esempio n. 9
0
    private void DataPlay()
    {
        if (this.Request.QueryString["op"] != null)
        {
            this.txtop.Value = this.Request.QueryString["op"].ToString();           //新增还是修改
        }

        if (this.Request.QueryString["id"] != null)
        {
            this.txtid.Value = this.Request.QueryString["id"].ToString();     //文档ID
        }
        TPortalClass.JpGoods JpGoods = new TPortalClass.JpGoods();

        //旧文档
        if (this.txtop.Value == "modify")
        {
            DataTable dt = JpGoods.Getdocbyid(int.Parse(this.txtid.Value));
            if (dt.Rows.Count > 0)
            {
                this.txtid.Value = dt.Rows[0]["id"].ToString();
                this.txtcid.Value = dt.Rows[0]["hy_cid"].ToString();
                ddlcolname.Value = dt.Rows[0]["hy_cid"].ToString();
                this.txthy_goodsname.Text = dt.Rows[0]["hy_goodsname"].ToString();
                this.txthy_goodstitle.Text = dt.Rows[0]["hy_goodstitle"].ToString();
                this.txthy_linkurl.Text = dt.Rows[0]["hy_linkurl"].ToString();
                //if (dt.Rows[0]["hy_imgurl"].ToString() != "")
                //{
                //    this.txtpicurl.Value = dt.Rows[0]["hy_imgurl"].ToString();
                //    this.lblpic.Text = "<img src='" + dt.Rows[0]["hy_imgurl"].ToString() + "' onError=\"this.src='/images/index/images/nophoto.jpg';\" width=60px height=55px />";
                //}
                this.txthy_content.Text = dt.Rows[0]["hy_content"].ToString();
                this.txthy_goodsprice.Text = dt.Rows[0]["hy_goodsprice"].ToString();
                this.txthy_sort.Text = dt.Rows[0]["hy_sort"].ToString();
            }
        }
        else
        {
            TPortalClass.DAO db = new TPortalClass.DAO();
            string sql = "select top 1  hy_sort   from hy_goods order by hy_sort desc ";
            DataTable dt = db.GetDataTable(sql);
            if (dt.Rows.Count > 0)
            {
                this.txthy_sort.Text = (Convert.ToInt32(dt.Rows[0]["hy_sort"].ToString()) + 1).ToString();
            }
            else
            {
                this.txthy_sort.Text = "1";
            }
        }
    }
Esempio n. 10
0
    private void RptBind()
    {
        if (this.Request.QueryString["page"] != null)
            this.page = int.Parse(this.Request.QueryString["page"].ToString());
        else
            this.page = 1;

        this.txtKeywords.Text = this.keywords;
        txtPageNum.Text = this.pageSize.ToString();
        txtPage.Text = this.page.ToString();

        TPortalClass.JpGoods JpGoods = new TPortalClass.JpGoods();

        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        string ls_key = JpCommon.Filter(this.txtKeywords.Text.Trim());

        DataTable dt = new DataTable();
        string ls_where = "  and   hy_goodsname  like '%" + ls_key + "%' ";
        ls_where += "   and ( hy_ifsh=1 or hy_ifsh=0 )";
        ls_where += "   and hy_cid like '" + txtcid.Value.Trim() + "%'";

        dt = JpGoods.SearchdocsByKey(ls_where, "   order  by hy_sort desc ", Convert.ToInt32(txtPage.Text), 10);
        this.totalCount = JpGoods.SearchdocsByKeyNum(ls_where);
        rptList.DataSource = dt;
        rptList.DataBind();

        string pageUrl = JpCommon.CombUrlTxt("list_shop_tg.aspx", "page={0}&rnd={1}&keywords={2}&cid={3}",
            "__id__", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtKeywords.Text + "", "" + txtcid.Value + "");
        PageContent.InnerHtml = JpCommon.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
    }
Esempio n. 11
0
    protected void btnpubart_Click(object sender, EventArgs e)
    {
        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        TPortalClass.JpGoods JpGoods = new TPortalClass.JpGoods();
        string ls_tip = "发布成功!";
        for (int i = 0; i < rptList.Items.Count; i++)
        {
            string id = ((HiddenField)rptList.Items[i].FindControl("hidId")).Value;
            CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
            if (cb.Checked)
            {
                TPortalClass.DAO db = new DAO();
                string sql = "update hy_goods set hy_ifsh=2 where id=" + int.Parse(id) + "";
                db.Execute(sql);
            }
        }
        string pageUrl = JpCommon.CombUrlTxt("list_shop_sh.aspx", "page={0}&rnd={1}",
            "" + this.txtPage.Text + "", "" + System.Guid.NewGuid().ToString() + "");

        //写系统日志
        string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
        if (userip == null || userip == "")
        {
            userip = Request.ServerVariables["REMOTE_ADDR"];
        }
        JpCommon.WriteLog(userip, "审核", "批量审核商城记录", Session["uid"].ToString(), Session["uname"].ToString());
        Response.Write("<script>alert('" + ls_tip + "');window.location='" + pageUrl + "';</script>");
    }