Ejemplo n.º 1
0
    ////保存排序
    //protected void btnSave_Click(object sender, EventArgs e)
    //{
    //    TPortalClass.HyCommon HyCommon = new TPortalClass.HyCommon();
    //    TPortalClass.HyCategory HyCategory = new TPortalClass.HyCategory();
    //    for (int i = 0; i < rptList.Items.Count; i++)
    //    {
    //        //int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
    //        string id = ((HiddenField)rptList.Items[i].FindControl("hidId")).Value;
    //        int sortId;
    //        if (!int.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId))
    //        {
    //            sortId = 99;
    //        }
    //        HyCategory.UpdateSort(id, sortId);
    //    }
    //    string pageUrl = HyCommon.CombUrlTxt("list_category.aspx", "page={0}&rnd={1}&cid={2}",
    //        "" + this.txtPage.Text + "", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtcid_url.Text + "");
    //    //写系统日志
    //    HyCommon.WriteLog("保存排序", "批量保存类别排序号", Session["uid"].ToString(), Session["uname"].ToString());
    //    Response.Write("<script>alert('保存排序成功!');window.location='" + pageUrl + "';</script>");
    //}
    //批量删除
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        TPortalClass.HyCommon HyCommon = new TPortalClass.HyCommon();
        TPortalClass.HyCategory HyCategory = new TPortalClass.HyCategory();
        string ls_tip = "删除成功!";
        for (int i = 0; i < rptList.Items.Count; i++)
        {
            //int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
            string id = ((HiddenField)rptList.Items[i].FindControl("hidId")).Value;
            CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
            if (cb.Checked)
            {
                //判断是否还有子类别,如果有子类别不能删除
                DataTable dt_sub = HyCategory.GetAllSubColumns(id,"0");
                if (dt_sub.Rows.Count > 0)
                {
                    ls_tip = "有下一级类别的信息无法删除,请先删除下一级类别!";
                }
                else
                {
                    HyCategory.CID = id;
                    HyCategory.Delete();
                }
            }
        }
        string pageUrl = HyCommon.CombUrlTxt("list_category.aspx", "page={0}&rnd={1}&cid={2}",
            "" + this.txtPage.Text + "", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtcid_url.Text + "");

        //写系统日志

        HyCommon.WriteLog("删除", "批量删除类别记录", Session["uid"].ToString(), Session["uname"].ToString());
        Response.Write("<script>alert('" + ls_tip + "');window.location='" + pageUrl + "';</script>");
    }
Ejemplo n.º 2
0
 //关健字查询
 protected void btnSearch_Click(object sender, EventArgs e)
 {
     TPortalClass.HyCommon HyCommon = new TPortalClass.HyCommon();
     string pageUrl = HyCommon.CombUrlTxt("list_log.aspx", "rnd={0}&keyword_s={1}&keyword_e={2}",
         "" + System.Guid.NewGuid().ToString() + "", "" + this.txtdate_s.Text + "", "" + this.txtdate_e.Text + "");
     Response.Redirect(pageUrl);
 }
Ejemplo n.º 3
0
    //批量删除
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        TPortalClass.HyCommon HyCommon = new TPortalClass.HyCommon();
        TPortalClass.HySyslogs HySyslogs = new TPortalClass.HySyslogs();
        string ls_tip = "删除成功!";
        for (int i = 0; i < rptList.Items.Count; i++)
        {
            //int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
            string id = ((HiddenField)rptList.Items[i].FindControl("hidId")).Value;
            CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
            if (cb.Checked)
            {
                HySyslogs.ID = id;
                HySyslogs.Delete();
            }
        }
        string pageUrl = HyCommon.CombUrlTxt("list_log.aspx", "page={0}&rnd={1}&keyword_s={2}&keyword_e={3}",
            "" + this.txtPage.Text + "", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtdate_s.Text + "", "" + this.txtdate_e.Text + "");

        HyCommon.WriteLog("删除", "批量删除操作日志记录", Session["uid"].ToString(), Session["uname"].ToString());
        Response.Write("<script>alert('" + ls_tip + "');window.location='" + pageUrl + "';</script>");
    }
Ejemplo n.º 4
0
 //转到第几页
 protected void btnGoto_Click(object sender, EventArgs e)
 {
     TPortalClass.HyCommon HyCommon = new TPortalClass.HyCommon();
     string pageUrl = HyCommon.CombUrlTxt("list_category.aspx", "page={0}&rnd={1}&cid={2}",
         this.txtGotoPage.Text, System.Guid.NewGuid().ToString(), this.txtcid_url.Text);
     Response.Redirect(pageUrl);
 }
Ejemplo n.º 5
0
    private void RptBind()
    {
        if (this.Request.QueryString["page"] != null)
            this.page = int.Parse(this.Request.QueryString["page"].ToString());
        else
            this.page = 1;

        if (this.Request.QueryString["cid"] != null)
            this.txtcid_url.Text = this.Request.QueryString["cid"].ToString();

        //如果depid等于空,则返回按钮隐藏
        if (this.Request.QueryString["cid"] == null || this.Request.QueryString["cid"] == "")
        {
            this.fhsjlb.Visible = false;
        }

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

        TPortalClass.HyCategory HyCategory = new TPortalClass.HyCategory();
        DataTable dt = new DataTable();

        if (this.txtcid_url.Text == "")
        {
            //列出一级类别 0001
            dt = HyCategory.GetFirstlevCategory("0", page, pageSize);
            this.totalCount = HyCategory.GetFirstlevCategoryNum("0");
        }
        else
        {
            //列出子级类别 00010001....
            dt = HyCategory.GetSubCategory(this.txtcid_url.Text, "0", page, pageSize);
            this.totalCount = HyCategory.GetSubCategoryNum(this.txtcid_url.Text, "0");
        }

        rptList.DataSource = dt;
        rptList.DataBind();

        TPortalClass.HyCommon HyCommon = new TPortalClass.HyCommon();
        string pageUrl = HyCommon.CombUrlTxt("list_category.aspx", "page={0}&rnd={1}&cid={2}",
            "__id__", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtcid_url.Text + "");
        PageContent.InnerHtml = HyCommon.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
    }
Ejemplo n.º 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.txtdate_s.Text = this.keyword_s;
        this.txtdate_e.Text = this.keyword_e;
        txtPageNum.Text = this.pageSize.ToString();
        txtPage.Text = this.page.ToString();

        TPortalClass.HySyslogs HySyslogs = new TPortalClass.HySyslogs();

        TPortalClass.HyCommon HyCommon = new TPortalClass.HyCommon();
        string ls_kssj = this.txtdate_s.Text;
        string ls_jssj = this.txtdate_e.Text;

        DataTable dt = HySyslogs.Getlogs_search(ls_kssj, ls_jssj);
        this.totalCount = dt.Rows.Count;
        DataTable tempTable = dt.Clone();
        for (int i = (this.page - 1) * this.pageSize; i < this.page * this.pageSize; i++)
        {
            if (i > dt.Rows.Count - 1)
                break;

            DataRow dr = tempTable.NewRow();
            for (int j = 0; j < dt.Columns.Count; j++)
            {
                dr[dt.Columns[j].ColumnName] = dt.Rows[i][j];
            }
            tempTable.Rows.Add(dr);
        }
        rptList.DataSource = tempTable;
        rptList.DataBind();

        string pageUrl = HyCommon.CombUrlTxt("list_log.aspx", "page={0}&rnd={1}&keyword_s={2}&keyword_e={3}",
            "__id__", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtdate_s.Text + "", "" + this.txtdate_e.Text + "");
        PageContent.InnerHtml = HyCommon.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
    }