예제 #1
0
    //提交
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (this.Session["uid"] == null || this.Session["uid"].ToString() == "")
        {
            this.Response.Redirect("../login.aspx");
        }

        string ls_tip = "审核成功!";

        TPortalClass.JpActivity JpActivity = new TPortalClass.JpActivity();
        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        TPortalClass.DAO db = new TPortalClass.DAO();
        string sql_cg = "update hy_activity set hy_ifsh=2 where id=" + System.Int32.Parse(this.txtid.Value) + "";
        db.Execute(sql_cg);
        //写系统日志
        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());
        JpActivity.Update();

        Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
    }
예제 #2
0
    //删除
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        TPortalClass.JpActivity JpActivity = new TPortalClass.JpActivity();
        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)
            {
                JpActivity.id = int.Parse(id);
                JpActivity.Delete();
            }
        }
        string pageUrl = JpCommon.CombUrlTxt("list_activity_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>");
    }
예제 #3
0
 public string showActive()
 {
     StringBuilder stringBuilder = new StringBuilder();
     JpActivity jpActivity = new JpActivity();
     DataTable dt = jpActivity.getActive(5);
     HyFileatt HyFileatt = new HyFileatt();
     string strTitle = "";
     if (dt.Rows.Count > 0)
     {
         for (int i = 0; i < dt.Rows.Count; i++)
         {
             strTitle = dt.Rows[i]["hy_bt"].ToString();
             if (strTitle.Length > 20)
             {
                 strTitle = strTitle.Substring(0, 20) + "...";
             }
             stringBuilder.Append("<div class=\"wszw\">" + Convert.ToDateTime(dt.Rows[i]["hy_addtime"].ToString()).ToString("mm:ss") + "</div>");
             stringBuilder.Append("<div class=\"jptx\"><a  onclick=\"locationDetail('active_detail.aspx?id=" + dt.Rows[i]["id"].ToString() + "&rend=" + System.Guid.NewGuid().ToString() + "','" + locationType + "','0')\" href=\"javascript:void(0);\" >");
             stringBuilder.Append("<div class=\"jptxpp\">");
             DataTable dt_img = HyFileatt.Getdocsfm(dt.Rows[i]["docid"].ToString());
             if (dt_img.Rows.Count > 0)
             {
                 stringBuilder.Append("<span><img src=\"" + dt_img.Rows[0]["hy_filepath"].ToString() + "\" alt=\"" + strTitle + "\" /></span>");
             }
             else
             {
                 stringBuilder.Append("<span><img src=\"nophoto.jpg\" alt=\"" + strTitle + "\" /></span>");
             }
             //nophoto
             stringBuilder.Append("<div class=\"jptxsub\"><span>" + strTitle + "</span></a><i class=\"ico-bm\" onclick=\"hdbm('" + dt.Rows[i]["id"].ToString() + "')\" >报名</i></div>");
             stringBuilder.Append("</div></a>");
             stringBuilder.Append("</div>");
         }
     }
     return stringBuilder.ToString();
 }
예제 #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (this.txtUid.Value != "")
     {
         this.Session["hyuid"] = this.txtUid.Value;
     }
     if (this.Request.QueryString["id"] != null)
     {
         try
         {
             id = Convert.ToInt32(this.Request.QueryString["id"].ToString());
         }
         catch
         {
             id = 1;
         }
     }
     this.txtaid.Value = id.ToString();
     this.txtcid.Value = "008";
     this.lb_type.Text = "金点活动";
     StringBuilder stringBuilder = new StringBuilder();
     JpActivity jpActivity = new JpActivity();
     DataTable dt = jpActivity.Getdocbyid(id);
     HyFileatt HyFileatt = new HyFileatt();
     if (dt.Rows.Count > 0)
     {
         this.lb_time.Text = Convert.ToDateTime(dt.Rows[0]["hy_addtime"].ToString()).ToString("yyyy年MM月dd日");
         this.lb_title.Text = dt.Rows[0]["hy_bt"].ToString();
         DataTable dt_img = HyFileatt.Getdocs(dt.Rows[0]["docid"].ToString(), 1);
         if (dt_img.Rows.Count > 0)
         {
             imgPath = dt_img.Rows[0]["hy_filepath"].ToString();
         }
         this.lb_article.Text = dt.Rows[0]["hy_content"].ToString();
     }
 }
예제 #5
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.JpActivity JpActivity = new TPortalClass.JpActivity();

        //旧文档
        if (this.txtop.Value == "modify")
        {
            DataTable dt = JpActivity.Getdocbyid(int.Parse(this.txtid.Value));
            if (dt.Rows.Count > 0)
            {
                this.txthy_bt.Text = dt.Rows[0]["hy_bt"].ToString();
                this.txthy_bt.Enabled = false;
                this.txthy_starttime.Value = Convert.ToDateTime(dt.Rows[0]["hy_starttime"].ToString()).ToString("yyyy-MM-dd");
                this.txthy_endtime.Value = Convert.ToDateTime(dt.Rows[0]["hy_endtime"].ToString()).ToString("yyyy-MM-dd");
                this.txthy_address.Text = dt.Rows[0]["hy_address"].ToString();
                this.txthy_contact.Text = dt.Rows[0]["hy_contact"].ToString();
                this.txthy_tel.Text = dt.Rows[0]["hy_tel"].ToString();
                //if (dt.Rows[0]["hy_images"].ToString() != "")
                //{
                //    this.txtpicurl.Value = dt.Rows[0]["hy_images"].ToString();
                //    this.lblpic.Text = "<img src='" + dt.Rows[0]["hy_images"].ToString() + "' onError=\"this.src='/images/index/images/nophoto.jpg';\" width=60px height=55px />";
                //}
                this.txthy_category.Text = dt.Rows[0]["hy_category"].ToString();
                this.txthy_content.Text = dt.Rows[0]["hy_content"].ToString();
                this.txthy_bz.Text = dt.Rows[0]["hy_bz"].ToString();
                this.txthy_sort.Text = dt.Rows[0]["hy_sort"].ToString();
                this.txtaddtime.Value = dt.Rows[0]["hy_addtime"].ToString();
                this.txtdjr.Value = dt.Rows[0]["hy_djr"].ToString();
            }
        }
        else
        {
            TPortalClass.DAO db = new TPortalClass.DAO();
            string sql = "select top 1  hy_sort   from hy_activity 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";
            }

        }
    }
예제 #6
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.JpActivity JpActivity = new TPortalClass.JpActivity();

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

        DataTable dt = new DataTable();
        string ls_where = "  and   hy_bt  like '%" + ls_key + "%' ";
        ls_where += "   and ( hy_ifsh=1 or hy_ifsh=2 )";
        dt = JpActivity.SearchdocsByKey(ls_where, "   order  by hy_sort desc ", Convert.ToInt32(txtPage.Text), 10);
        this.totalCount = JpActivity.SearchdocsByKeyNum(ls_where);
        rptList.DataSource = dt;
        rptList.DataBind();

        string pageUrl = JpCommon.CombUrlTxt("list_activity_sh.aspx", "page={0}&rnd={1}&keywords={2}",
            "__id__", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtKeywords.Text + "");
        PageContent.InnerHtml = JpCommon.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
    }
예제 #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.JpActivityusers JpActivityusers = new TPortalClass.JpActivityusers();
        TPortalClass.JpActivity JpActivity = new TPortalClass.JpActivity();
        //旧文档
        if (this.txtop.Value == "modify")
        {
            DataTable dt = JpActivityusers.Getdocbyid(int.Parse(this.txtid.Value));
            if (dt.Rows.Count > 0)
            {
                ddlhy_id.SelectedValue = dt.Rows[0]["hy_id"].ToString();
                this.txthy_name.Text = dt.Rows[0]["hy_name"].ToString();
                this.txthy_tel.Text = dt.Rows[0]["hy_tel"].ToString();
                this.txthy_addtime.Text = Convert.ToDateTime(dt.Rows[0]["hy_addtime"].ToString()).ToString("yyyy-MM-dd");
            }
            btnSubmit.Visible = true;
            ddlhy_id.Enabled = false;
            txthy_name.Enabled = false;
            txthy_tel.Enabled = false;
            txthy_addtime.Enabled = false;
        }
        else
        {
            // this.txthy_sort.Text = JpActivityusers.GetMaxSort();
        }
    }
예제 #8
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.JpActivity JpActivity = new TPortalClass.JpActivity();
        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();

        JpActivity.hy_bt = this.txthy_bt.Text;
        JpActivity.hy_content = this.txthy_content.Text;
        JpActivity.hy_address = this.txthy_address.Text;
        JpActivity.hy_tel = this.txthy_tel.Text;
        JpActivity.hy_starttime = this.txthy_starttime.Value;
        JpActivity.hy_endtime = this.txthy_endtime.Value;
        JpActivity.hy_contact = this.txthy_contact.Text;
        JpActivity.hy_category = this.txthy_category.Text;
        JpActivity.hy_bz = this.txthy_bz.Text;
        JpActivity.hy_sort = Convert.ToInt32(this.txthy_sort.Text);
        JpActivity.hy_addtime = this.txtaddtime.Value;
        JpActivity.hy_djr = this.txtdjr.Value;
        JpActivity.hy_ifsh = 0;
        JpActivity.docid = txtDocid.Value;

        //string lsfilename = FileUpload1.FileName;
        //string lspath = "", lsurl = "", str_path = "";
        //if (lsfilename != "")  //attsize
        //{
        //    lsfilename = System.Guid.NewGuid() + "_" + lsfilename;
        //    //将附件上传到服务器目录下
        //    lspath = Server.MapPath("~/");  //虚拟目录的位置
        //    lsurl = "/upload/activitypic_yt";  //原图存放的文件夹
        //    Directory.CreateDirectory(lspath + "/" + lsurl);
        //    str_path = lspath + "/" + lsurl + "/" + lsfilename;
        //    FileUpload1.SaveAs(str_path);
        //    JpActivity.hy_images = lsurl + "/" + lsfilename;
        //}
        //else
        //{
        //    JpActivity.hy_images = this.txtpicurl.Value;
        //}

        if (this.txtop.Value == "add")
        {
            if (JpActivity.IsExist())
            {
                this.Response.Write("<script language=javascript>alert('该活动名已经存在!')</script>");
                return;
            }
            //写系统日志
            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());

            JpActivity.Insert();
        }
        else
        {
            JpActivity.id = System.Int32.Parse(this.txtid.Value);
            //写系统日志
            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());

            JpActivity.Update();
        }
        Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
    }
예제 #9
0
    //提交
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (this.Session["uid"] == null || this.Session["uid"].ToString() == "")
        {
            this.Response.Redirect("../login.aspx");
        }

        string ls_tip = "保存成功!";

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

        JpActivity.hy_bt = this.txthy_bt.Text;
        JpActivity.hy_content = this.txthy_content.Text;
        JpActivity.hy_address = this.txthy_address.Text;
        JpActivity.hy_tel = this.txthy_tel.Text;
        JpActivity.hy_starttime = this.txthy_starttime.Value;
        JpActivity.hy_endtime = this.txthy_endtime.Value;
        JpActivity.hy_contact = this.txthy_contact.Text;
        JpActivity.hy_category = this.txthy_category.Text;
        JpActivity.hy_bz = this.txthy_bz.Text;
        JpActivity.hy_sort = Convert.ToInt32(this.txthy_sort.Text);
        JpActivity.hy_addtime = DateTime.Now.ToString();
        JpActivity.hy_djr = this.txtdjr.Value;
        JpActivity.hy_ifsh = 1;
        JpActivity.docid = txtDocid.Value;

        if (this.txtop.Value == "add")
        {
            if (JpActivity.IsExist())
            {
                this.Response.Write("<script language=javascript>alert('该活动名已经存在!')</script>");
                return;
            }
            //写系统日志
            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());

            JpActivity.Insert();
        }
        else
        {
            JpActivity.id = System.Int32.Parse(this.txtid.Value);
            //写系统日志
            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());

            JpActivity.Update();
        }
        Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
    }
예제 #10
0
 public string showRollingActive()
 {
     StringBuilder stringBuilder = new StringBuilder();
     JpActivity jpActivity = new JpActivity();
     DataTable dt = jpActivity.getActive(5);
     HyFileatt HyFileatt = new HyFileatt();
     string strTitle = "";
     if (dt.Rows.Count > 0)
     {
         for (int i = 0; i < dt.Rows.Count; i++)
         {
             strTitle = dt.Rows[i]["hy_bt"].ToString();
             if (strTitle.Length > 20)
             {
                 strTitle = strTitle.Substring(0, 20) + "...";
             }
             stringBuilder.Append("<li>");
             stringBuilder.Append("<div class=\"slide\">");
             DataTable dt_img = HyFileatt.Getdocsfm(dt.Rows[i]["docid"].ToString());
             if (dt_img.Rows.Count > 0)
             {
                 stringBuilder.Append("<span><a onclick=\"locationDetail('active_detail.aspx?id=" + dt.Rows[i]["id"].ToString() + "&rend=" + System.Guid.NewGuid().ToString() + "','" + locationType + "','0')\" href=\"javascript:void(0);\" ><img src=\"" + dt_img.Rows[0]["hy_filepath"].ToString() + "\" alt=\"" + strTitle + "\"/></span>");
             }
             stringBuilder.Append("<div class=\"caption\">");
             stringBuilder.Append("<p class=\"title\" >" + strTitle + "</a></p>");
             stringBuilder.Append("</div>");
             stringBuilder.Append("</div>");
             stringBuilder.Append("</li>");
         }
     }
     return stringBuilder.ToString();
 }