本文整理汇总了C#中GridViewDeleteEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# GridViewDeleteEventArgs类的具体用法?C# GridViewDeleteEventArgs怎么用?C# GridViewDeleteEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GridViewDeleteEventArgs类属于命名空间,在下文中一共展示了GridViewDeleteEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: gvTagCategory_RowDeleting
protected void gvTagCategory_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int tagCategoryId = (int)gvTagCategory.DataKeys[e.RowIndex].Value;
Bll.Delete(tagCategoryId);
gvTagCategory.EditIndex = -1;
Bind();
}
示例2: gvCart_RowDeleting
/// <summary>
/// GridView删除按钮处理事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void gvCart_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
DataTable cart = Session["cart"] as DataTable;
cart.Rows[e.RowIndex].Delete();
Session["cart"] = cart;
BindGridView();
}
示例3: grdRoutesInfo_RowDeleting
protected void grdRoutesInfo_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int userId = Convert.ToInt32(Session["userid"]);
string routeID = ((Label)grdRoutesInfo.Rows[e.RowIndex].FindControl("lblrtId")).Text;
dalRegisteredCars.DeleteRoute(Convert.ToInt32(routeID));
FillGrdRouresDetails(userId);
}
示例4: GridView_OnRowDeleting
protected void GridView_OnRowDeleting(object sender,GridViewDeleteEventArgs e)
{
string sql = "delete from Work where WorkSymbol = '" + GridView1.DataKeys[e.RowIndex].Value.ToString()
+ "'";
command = new SqlCommand(sql, con);
try
{
if (con.State == ConnectionState.Open)
con.Close();
con.Open();
if(command.ExecuteNonQuery() != 1)
Response.Write("<script language='JavaScript'>alert('删除失败!')</script>");
else Response.Write("<script language='JavaScript'>alert('删除成功!')</script>");
}
catch (Exception ee)
{
Response.Write("<script language='JavaScript'>alert('" + ee.Message.ToString() + "')</script>");
return;
}
finally
{
con.Close();
}
bind();
}
示例5: GridView1_RowDeleting
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
if (Session["ZT_ADMIN"] == null)
{
Response.Redirect("Login.aspx");
}
else
{
if (!Communal.CheckQx("CompanyInfoDelete.aspx"))
{
Response.Redirect("RightsWarn.aspx");
}
else
{
//删除数据库的信息
Label ll = (Label)this.GridView1.Rows[e.RowIndex].Cells[1].FindControl("lblInfoID");
int InfoID = Convert.ToInt32(ll.Text);
WebProject.BLL.BaseData.ZT_COM_CompanyInfo bll_CompanyInfo = new WebProject.BLL.BaseData.ZT_COM_CompanyInfo();
LogManage.WriteLog(Request.UserHostAddress, "公司信息管理", "删除公司信息", "成功", "信息标题:" + bll_CompanyInfo.GetModel(InfoID).Title + ", 操作人:" + SessionUtil.GetAdminSession().AdminNo);
bll_CompanyInfo.Delete(InfoID);
//删除文件夹的图片
Label l2 = (Label)this.GridView1.Rows[e.RowIndex].Cells[0].FindControl("lblImgUrl");
if (l2.Text != "onlinenone.jpg")
{
System.IO.File.Delete(Server.MapPath("IMG/" + l2.Text));
}
//重新加载信息
ShowData();
}
}
}
示例6: GridView1_RowDeleting
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int msgID = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value);
Message msg = new Message();
msg.Delete_msg(msgID);
Response.Write("<Script Language=JavaScript>alert(\"删除成功!\");window.location='inputbox.aspx';</Script>");
}
示例7: GridView1_RowDeleting
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
if (Session["ZT_ADMIN"] == null)
{
Response.Redirect("Login.aspx");
}
else
{
if (!Communal.CheckQx("LiuYanDelete.aspx"))
{
Response.Redirect("RightsWarn.aspx");
}
else
{
//删除数据库的信息
Label ll = (Label)this.GridView1.Rows[e.RowIndex].Cells[1].FindControl("lblLiuYanID");
int LiuYanID = Convert.ToInt32(ll.Text);
WebProject.BLL.BaseData.ZT_COM_LiuYan bll_LiuYan = new WebProject.BLL.BaseData.ZT_COM_LiuYan();
LogManage.WriteLog(Request.UserHostAddress, "留言管理", "删除留言", "成功", "留言主题:" + bll_LiuYan.GetModel(LiuYanID).MainInfo + ", 操作人:" + SessionUtil.GetAdminSession().AdminNo);
bll_LiuYan.Delete(LiuYanID);
//重新加载信息
ShowData();
}
}
}
示例8: DeleteRow
protected void DeleteRow(object sender, GridViewDeleteEventArgs e)
{
SetRowData();
if (ViewState["CurrentTable"] != null)
{
DataTable dt = (DataTable)ViewState["CurrentTable"];
DataRow drCurrentRow = null;
int rowIndex = Convert.ToInt32(e.RowIndex);
if (dt.Rows.Count > 1)
{
dt.Rows.Remove(dt.Rows[rowIndex]);
drCurrentRow = dt.NewRow();
ViewState["CurrentTable"] = dt;
NewTest_Questions_GridView.DataSource = dt;
NewTest_Questions_GridView.DataBind();
for (int i = 0; i < NewTest_Questions_GridView.Rows.Count; ++i)
NewTest_Questions_GridView.Rows[i].Cells[0].Text = (i + 1).ToString();
SetPreviousData();
}
}
}
示例9: GridView1_RowDeleting
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int userid = 0;
userid = int.Parse(GridView1.DataKeys[e.RowIndex].Values[0].ToString());
try
{
UserBLL ub = new UserBLL();
int i = ub.DeleteUser(userid);
if(i==1)
{ Response.Write("<script language='javascript'>alert('User has been deleted !');</script>");
GridView1.DataBind();
}
else
Response.Write("<script language='javascript'>alert('User is failed to be deleted !');</script>");
}
catch (SqlException ex)
{
Response.Write(ex.ToString());
}
}
示例10: gvExaminationInfo_RowDeleting
protected void gvExaminationInfo_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int ID = (int)gvExaminationInfo.DataKeys[e.RowIndex].Value;//获取GridView主键的值
string strsql = "delete from tb_examDetail where ID ='" + ID + "'";
BaseClass.OperateData(strsql);
gvExaminationInfo_Bind();
}
示例11: gvwCamera_RowDeleting
protected void gvwCamera_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
string id = gvwCamera.DataKeys[e.RowIndex].Value.ToString();
CameraManager cm = new CameraManager();
cm.DeleteCamera(id, Session["userid"].ToString());
Query();
}
示例12: gvGoodsInfo_RowDeleting
protected void gvGoodsInfo_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int IntProductID = Convert.ToInt32(gvGoodsInfo.DataKeys[e.RowIndex].Value);
string strSql = "select count(*) from OrderDetail where ProductID=" + IntProductID;
SqlCommand myCmd = dbObj.GetCommandStr(strSql);
if (Convert.ToInt32(dbObj.ExecScalar(myCmd)) > 0)
{
Response.Write(ccObj.MessageBox("You can't delete this product since is using now."));
}
else
{
string strDelSql = "delete from Products where ProductID=" + IntProductID;
SqlCommand myDelCmd = dbObj.GetCommandStr(strDelSql);
dbObj.ExecNonQuery(myDelCmd);
if (ViewState["search"] != null)
{
gvSearchBind();
}
else
{
gvBind();
}
}
}
示例13: DiaryGridView_RowDeleting
protected void DiaryGridView_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int diaryId = (int)DiaryGridView.DataKeys[e.RowIndex].Value;
svc.DeleteDiaryItem(diaryId);
UpdateGridView();
}
示例14: GvJuguetes_RowDeleting
protected void GvJuguetes_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
EntJuguete ent = new EntJuguete();
ent.Id = Convert.ToInt32(GvJuguetes.DataKeys[e.RowIndex].Values["Id"].ToString());
new BusJuguete().Borrar(ent);
Response.Redirect(Request.CurrentExecutionFilePath);
}
示例15: gvReaderInfo_RowDeleting
protected void gvReaderInfo_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
string id = gvReaderInfo.DataKeys[e.RowIndex].Value.ToString();
string sql = "delete tb_readerInfo where readerBarCode='" + id + "'";
dataOperate.execSQL(sql);
bindReaderInfo();
}