protected void gridField_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "del") { bool success = web.DelCustomer(e.CommandArgument.ToString()); if (success) { GridBind(); Pagination2.Refresh(); } } if (e.CommandName == "update") { DataTable dt = web.SelCustomer(e.CommandArgument.ToString()); if (dt.Rows.Count > 0) { tab.Visible = true; imgAdd.Visible = false; imgSub.Visible = true; txtfenleiName.Text = dt.Rows[0]["tTilte"].ToString(); txtnum.Text = dt.Rows[0]["nPaiXu"].ToString(); txtMemo.Text = dt.Rows[0]["tMemo"].ToString(); hid1.Value = dt.Rows[0]["nID"].ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["AdminName"] == null) { Response.Redirect("../../Error.aspx"); } if (!IsPostBack) { Div1.Visible = false; if (Request.QueryString["nID"] != null) { _sid1 = "0"; _QuestionName = ""; _nID = Request.QueryString["nID"].ToString(); } else { //跳转到错误页面 // _nID = ""; } //Dropfenlei.Items.Add(new ListItem("请选择", "-1")); //BindDrop(Dropfenlei, "ML_InfoClassMain"); GridBind(); } Pagination2.MDataTable = info.SelQuWenDaResult(_nID, _sid1); Pagination2.MGridView = GridView1; Pagination2.Refresh(); }
//保存 protected void imgSub_Click(object sender, EventArgs e) { if (txtTlitle.Text == "") { ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('请选择消息标题!')</script>"); return; } string strTime = System.DateTime.Now.ToString(); bool success = false; success = news.NewsInsert(DropDownList1.SelectedItem.Value, txtTlitle.Text.Trim(), hid.Value, content1.InnerText, "", RadioState.SelectedItem.Value, strTime, "1"); if (success) { if (XueYuan_Add(MaxnID(), _userID)) { GridBind(); Pagination2.Refresh(); ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('添加成功!')</script>"); } else { ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('添加失败!')</script>"); } } else { ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('添加失败!')</script>"); } }
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 == "update") { Response.Redirect("HomeMakEdit.aspx?id=" + e.CommandArgument.ToString() + "&&ceid=" + gridField.PageIndex); } if (e.CommandName == "dingdan") { Response.Redirect("../Order/OrderMainDL.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>"); } } }
public static Pagination2 <T> GetInstance <T>() { Pagination2 <T> instance = new Pagination2 <T>() { Items = new List <T>() }; return(instance); }
protected void gridField_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "del") { string sql = "delete from ML_PoliciesClass where nID=" + e.CommandArgument.ToString(); bool success = her.ExecuteNonQuery(sql); if (success) { GridBind(); Pagination2.Refresh(); } } }
protected void gridField_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "WenDa") { Div1.Visible = true; _sid1 = e.CommandArgument.ToString(); _QuestionName = info.SelQuestionName(e.CommandArgument.ToString()); //GridView1.DataSource = info.SelQuWenDaResult(_nID, e.CommandArgument.ToString()); //GridView1.DataBind(); Pagination2.MDataTable = info.SelQuWenDaResult(_nID, e.CommandArgument.ToString()); Pagination2.MGridView = GridView1; Pagination2.Refresh(); } }
protected void gridField_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "del") { bool success = pc.DeleteProductByID(e.CommandArgument.ToString()); if (success) { GridBind(); Pagination2.Refresh(); } } if (e.CommandName == "update") { Response.Redirect("ProductEdit.aspx?id=" + e.CommandArgument.ToString() + "&ceid=" + gridField.PageIndex); } }
protected void gridField_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "detail") { Response.Redirect("OrderDetail.aspx?id=" + e.CommandArgument.ToString()); } if (e.CommandName == "del") { bool success = or.DelOrder(e.CommandArgument.ToString()); if (success) { GridBind(); Pagination2.Refresh(); } } }
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) { bool success = pc.DeleteProductByID(gridField.DataKeys[i].Value.ToString()); if (!success) { ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('发生未知错误!请重试')</script>"); } } } GridBind(); Pagination2.Refresh(); }
protected void gridField_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "del") { bool success = news.updateDo(e.CommandArgument.ToString()); if (success) { AjaxAlert.AlertMsgAndNoFlush(this, "发送成功"); GridBind(); Pagination2.Refresh(); } else { AjaxAlert.AlertMsgAndNoFlush(this, "发送失败"); } } }
protected void gridField_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "del") { DeletePhoto(e.CommandArgument.ToString()); bool success = web.DelImg(e.CommandArgument.ToString()); if (success) { GridBind(); Pagination2.Refresh(); } } if (e.CommandName == "update") { int aa = gridField.PageIndex; Response.Redirect("ImgEdit.aspx?id=" + e.CommandArgument.ToString() + "&&ceid=" + gridField.PageIndex); } }
protected void gridField_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "detail") { //写个触发器比较好 string sql1 = string.Format(@"update MoneyOrder set OrderState=1,UpdateTime='{0}' where nID={1}", System.DateTime.Now.ToString(), e.CommandArgument.ToString()); string sql = "select AnID,Tixian from [MoneyOrder] where nID=" + e.CommandArgument.ToString(); DataTable dt = her.ExecuteDataTable(sql); if (dt.Rows.Count > 0) { string sql2 = string.Format("update ML_Member set AllMoney = AllMoney+{0} where nID={1} " , Convert.ToInt32(dt.Rows[0]["Tixian"]), Convert.ToInt32(dt.Rows[0]["AnID"])); if (her.ExecuteNonQuery(sql2))//先转账,再去修改订单状态。免得转账失败了,但是订单却修改成功了 { if (her.ExecuteNonQuery(sql1)) { GridBind(); Pagination2.Refresh(); ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('修改成功')</script>"); } else { ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('修改失败,请联系管理员')</script>"); } } else { ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('转账失败,请联系管理员')</script>"); } } else { ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('数据查询失败了,请联系管理员')</script>"); } // int rowIndex = ((GridViewRow)((Button)e.CommandSource).NamingContainer).RowIndex; // Label lb = (Label)gridField.Rows[rowIndex].FindControl("lbprice"); //ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + lb.Text + "')</script>"); } }
protected void gridField_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "del") { bool success = web.DelMessage(e.CommandArgument.ToString()); if (success) { GridBind(); Pagination2.Refresh(); } } if (e.CommandName == "res") { string url = string.Format("ContactEdit.aspx?id={0}&ceid={1}", e.CommandArgument.ToString(), gridField.PageIndex); Response.Redirect(url); } }
protected void imgAdd_Click(object sender, EventArgs e) { if (txtfenleiName.Text == "" || txtnum.Text == "" || txtMemo.Text == "") { ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('请输入!')</script>"); return; } if (web.AddCustomer(txtfenleiName.Text.Trim(), txtnum.Text.Trim(), txtMemo.Text.Trim())) { //ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('添加成功!')</script>"); tab.Visible = false; GridBind(); Pagination2.Refresh(); } else { ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('添加失败!')</script>"); return; } }
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"; bool success = makbll.MakUpd(makinfo); if (!success) { ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('发生未知错误!请重试')</script>"); } } } GridBind(); Pagination2.Refresh(); }
protected void gridField_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "update") { Response.Redirect("BackCardEdit.aspx?id=" + e.CommandArgument.ToString() + "&&ceid=" + gridField.PageIndex); } if (e.CommandName == "dingdan") { bool success = bk.DelBank(e.CommandArgument.ToString()); if (!success) { ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('发生未知错误!请重试')</script>"); } else { GridBind(); Pagination2.Refresh(); } } }
/// <summary> /// 保存添加 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void imgAdd_Click1(object sender, EventArgs e) { if (txtfenleiName.Text == "") { ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('名称不能为空!')</script>"); return; } if (info.QusetionInsert(txtfenleiName.Text.Trim(), System.DateTime.Now.ToString())) { //ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('添加成功!')</script>"); tab.Visible = false; GridBind(); Pagination2.Refresh(); } else { ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('添加失败!')</script>"); return; } }
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>"); } }
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; } }
protected void btnSearh_Click(object sender, EventArgs e) { GridBind(); Pagination2.Refresh(); }
protected void ImgSrs_Click(object sender, ImageClickEventArgs e) { GridBind(); Pagination2.Refresh(); }
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()); } }