コード例 #1
0
    protected void gridField_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "detail")
        {
            Response.Redirect("OrderDetail.aspx?id=" + e.CommandArgument.ToString());
        }



        if (e.CommandName == "del")
        {
            //Response.Redirect("OrderDetail.aspx?id=" + e.CommandArgument.ToString());

            bool success = or.DelOrder(e.CommandArgument.ToString());
            if (success)
            {
                GridBind();
                Pagination2.Refresh();
            }
        }
    }
コード例 #2
0
    protected void gridField_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "del")
        {
            bool success = news.NewsDelete(e.CommandArgument.ToString());
            if (success)
            {
                GridBind();
                Pagination2.Refresh();
            }
        }
        if (e.CommandName == "update")
        {
            Response.Redirect("NewsEdit.aspx?id=" + e.CommandArgument.ToString() + "&&ceid=" + gridField.PageIndex);
        }
        if (e.CommandName == "btnUser")
        {
            string jumpUrl = @"window.open('AddNewsMember.aspx?id=" + e.CommandArgument + "', 'top', 'width=1000,height=700,menubar=0,scrollbars=1, resizable=1,status=1,titlebar=0,toolbar=0,location=0')";

            ClientScript.RegisterStartupScript(GetType(), "", "<script>" + jumpUrl + "</script>");
        }
    }
コード例 #3
0
    protected void imgSub_Click(object sender, EventArgs e)
    {
        if (txtfenleiName.Text == "" || txtnum.Text == "")
        {
            ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('请输入!')</script>");
            return;
        }
        bool success = false;

        success = web.updateCustomer(hid1.Value, txtfenleiName.Text.Trim(), txtnum.Text.Trim(), txtMemo.Text.Trim());
        if (success)
        {
            //ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('添加成功!')</script>");
            tab.Visible = false;
            GridBind();
            Pagination2.Refresh();
        }
        else
        {
            ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('失败!')</script>");
            return;
        }
    }
コード例 #4
0
 protected void imgdelete_Click(object sender, EventArgs e)
 {
     for (int i = 0; i < gridField.Rows.Count; i++)
     {
         CheckBox ckb = (CheckBox)gridField.Rows[i].FindControl("CheckSel");
         if (ckb.Checked)
         {
             HomeMakInfo makinfo = new HomeMakInfo();
             makinfo.nID    = int.Parse(gridField.DataKeys[i].Value.ToString());
             makinfo.oCheck = "0";
             if (gridField.DataKeys[i].Value.ToString() != "1")
             {
                 bool success = makbll.MakUpd(makinfo);
                 if (!success)
                 {
                     ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('发生未知错误!请重试')</script>");
                 }
             }
         }
     }
     GridBind();
     Pagination2.Refresh();
 }
コード例 #5
0
 protected void btnSearh_Click(object sender, EventArgs e)
 {
     GridBind();
     Pagination2.Refresh();
 }
コード例 #6
0
    protected void gridField_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "del")
        {
            if (info.QusetionDelete(e.CommandArgument.ToString()))
            {
                GridBind();
                Pagination2.Refresh();
            }
        }
        if (e.CommandName == "update")
        {
            DataTable dt = info.SelQu(e.CommandArgument.ToString());
            if (dt.Rows.Count > 0)
            {
                // Dropfenlei.SelectedValue = dt.Rows[0]["sid0"].ToString();
                txtfenleiName.Text = dt.Rows[0]["tClassName"].ToString();
                // txtnum.Text = dt.Rows[0]["nPaiXu"].ToString();
                hid.Value      = dt.Rows[0]["nID"].ToString();
                tab.Visible    = true;
                imgAdd.Visible = false;
                imgSub.Visible = true;
            }
        }
        if (e.CommandName == "fabu")
        {
            if (info.CheckFabu())
            {
                ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('已经有发布的问卷,请先关闭再操作!')</script>");
            }
            else
            {
                if (info.UpdateFabu(e.CommandArgument.ToString()))
                {
                    ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('发布成功!')</script>");
                    GridBind();
                    Pagination2.Refresh();
                }
                else
                {
                    ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('发布失败!')</script>");
                }
            }
        }
        if (e.CommandName == "quxiao")
        {
            if (info.UpdateFabuCancel(e.CommandArgument.ToString()))
            {
                ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('取消成功!')</script>");
                GridBind();
                Pagination2.Refresh();
            }
            else
            {
                ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('取消失败!')</script>");
            }
        }

        if (e.CommandName == "Qu")
        {
            Response.Redirect("QuestionEdit.aspx?nID=" + e.CommandArgument.ToString());
        }
        if (e.CommandName == "Toge")
        {
            Response.Redirect("QuestionMain.aspx?QCid=" + e.CommandArgument.ToString());
        }
        if (e.CommandName == "wenda")
        {
            Response.Redirect("WendaMain.aspx?nID=" + e.CommandArgument.ToString());
        }
    }
コード例 #7
0
 protected void ImgSrs_Click(object sender, ImageClickEventArgs e)
 {
     GridBind();
     Pagination2.Refresh();
 }
コード例 #8
0
    protected void gridField_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "jinyong")
        {
            HomeMakInfo makinfo = new HomeMakInfo();
            makinfo.nID    = int.Parse(e.CommandArgument.ToString());
            makinfo.oCheck = "0";
            bool success = makbll.MakUpd(makinfo);
            if (success)
            {
                GridBind();
                Pagination2.Refresh();
            }
        }
        if (e.CommandName == "qiyong")
        {
            HomeMakInfo makinfo = new HomeMakInfo();
            makinfo.nID    = int.Parse(e.CommandArgument.ToString());
            makinfo.oCheck = "1";
            bool success = makbll.MakUpd(makinfo);
            if (success)
            {
                GridBind();
                Pagination2.Refresh();
            }
        }

        if (e.CommandName == "del")
        {
            HomeMakInfo makinfo = new HomeMakInfo();
            makinfo.nID = int.Parse(e.CommandArgument.ToString());
            bool success = makbll.MakDel(makinfo);
            if (success)
            {
                GridBind();
                Pagination2.Refresh();
            }
        }
        if (e.CommandName == "update")
        {
            Response.Redirect("HomeMakEdit.aspx?id=" + e.CommandArgument.ToString() + "&&ceid=" + gridField.PageIndex);
        }
        if (e.CommandName == "dingdan")
        {
            Response.Redirect("../Order/OrderMain.aspx?dlid=" + e.CommandArgument.ToString());
        }
        if (e.CommandName == "detail")
        {
            Response.Redirect("HomeMakByOne.aspx?id=" + e.CommandArgument.ToString());
        }


        if (e.CommandName == "AddUrl")
        {
            var         url     = makeUrl(e.CommandArgument.ToString());
            var         picName = ImageAdd(url);
            HomeMakInfo makinfo = new HomeMakInfo();
            makinfo.nID         = int.Parse(e.CommandArgument.ToString());
            makinfo.HomePic     = picName;
            makinfo.CreatorName = url;
            if (makbll.MakUrl(makinfo))
            {
                GridBind();
                Pagination2.Refresh();
            }
            else
            {
                ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('生成失败')</script>");
            }
        }
    }