本文整理汇总了C#中GridViewCommandEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# GridViewCommandEventArgs类的具体用法?C# GridViewCommandEventArgs怎么用?C# GridViewCommandEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GridViewCommandEventArgs类属于命名空间,在下文中一共展示了GridViewCommandEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: gvTipoDocumentos_RowCommand
protected void gvTipoDocumentos_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Editar")
GetTipoDocumento(int.Parse(e.CommandArgument.ToString()));
else if (e.CommandName == "Excluir")
DeleteTipoDocumento(int.Parse(e.CommandArgument.ToString()));
}
示例2: GridView1_RowCommand
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Edit")
{
f_id.Text = e.CommandArgument.ToString();
}
if (e.CommandName == "Delete")
{
int f_id = Convert.ToInt32(e.CommandArgument);
BLL.procate myb = new BLL.procate();
int result = myb.num(f_id);
if (result > 0)
{
msg("先把含有此父类的子类删除,才能删除父类");
}
else
{
BLL.fathercate f_b = new BLL.fathercate();
int rs = f_b.delete(f_id);
if (rs > 0)
{
msg("删除成功");
bing();
}
else
{
msg("删除失败");
}
}
}
}
示例3: grdManageMoneyReceipt_RowCommand
/// <summary>
/// To Show CanceMoneyReceiptScreen
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grdManageMoneyReceipt_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == Globals.GridCommandEvents.CANCEL)
{
Event_ShowCanceMoneyReceiptScreen(Convert.ToInt32(e.CommandArgument));
}
}
示例4: GridViewFriends_RowCommand
protected void GridViewFriends_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName.CompareTo("FriendsReject") == 0)
{
SqlConnection sqlConn = new SqlConnection(ConfigurationManager.ConnectionStrings["ShopConnectionString"].ConnectionString);
SqlCommand sqlCmd;
try
{
sqlCmd = new SqlCommand("sp_requestsConnectionsFriendsReject", sqlConn);
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.Parameters.Add("@RequestId", SqlDbType.Int).Value = Convert.ToInt32(e.CommandArgument.ToString());
sqlConn.Open();
sqlCmd.ExecuteNonQuery();
}
catch
{
}
finally
{
sqlConn.Close();
}
GridViewFriends.DataBind();
}
if (e.CommandName.CompareTo("FriendsAccept") == 0)
{
SqlConnection sqlConn = new SqlConnection(ConfigurationManager.ConnectionStrings["ShopConnectionString"].ConnectionString);
SqlCommand sqlCmd;
try
{
DataTable dt = new DataTable();
DataTable dt2 = new DataTable();
DataSet ds = new DataSet();
SqlDataAdapter sda = new SqlDataAdapter("sp_requestsConnectionsFriendsVerify", sqlConn);
sda.SelectCommand.CommandType = CommandType.StoredProcedure;
sda.SelectCommand.Parameters.Add("@RequestId", SqlDbType.Int).Value = Convert.ToInt32(e.CommandArgument.ToString());
sda.SelectCommand.Parameters.Add("@UserId", SqlDbType.Int).Value = Convert.ToInt32(Session["UserId"]);
sda.Fill(ds);
dt = ds.Tables[0];
dt2 = ds.Tables[1];
NotificationsClass nc = new NotificationsClass();
nc.addNotification(1, Convert.ToInt32(dt.Rows[0]["FriendId"].ToString()), 7, dt2.Rows[0]["FullName"].ToString(), "");
}
catch
{
}
finally
{
sqlConn.Close();
}
GridViewFriends.DataBind();
}
}
示例5: gvList_RowCommand1
protected void gvList_RowCommand1(object sender, GridViewCommandEventArgs e)
{
string cmdName = e.CommandName;
int nodeId = int.Parse(e.CommandArgument.ToString());
NodeVO nodeVO = m_PostService.GetNodeById(nodeId);
switch (cmdName)
{
case "myModify":
m_Mode = nodeId;
txtNodeName.Text = nodeVO.Name;
txtSortNo.Text = nodeVO.SortNo.ToString();
//txtContent.Text = nodeVO.HtmlContent;
ShowMode();
break;
case "myDel":
try
{
m_PostService.DeleteNode(nodeVO);
m_WebLogService.AddSystemLog(MsgVO.Action.刪除, nodeVO);
}
catch (Exception ex)
{
ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "js", JavascriptUtil.AlertJS("無法刪除品名,尚有關聯資料。"), false);
m_Log.Error(ex);
}
break;
default:
break;
}
GetList();
}
示例6: GridView1_RowCommand
//SexBLL bll = new SexBLL();
//protected void ButtonNew_Click(object sender, EventArgs e)
//{
// if (string.IsNullOrEmpty(txtName.Text)) return;
// Guid ID = bll.Insert(txtName.Text);
// GridView1.DataBind();
//}
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Select")
{
}
}
示例7: Press_OnRowCommand
protected void Press_OnRowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName.Equals("editPress"))
{
Response.Redirect("EditPress.aspx?pressId=" + e.CommandArgument.ToString());
}
}
示例8: Gridview1_RowCommand
protected void Gridview1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "delRecord")
{
string strMessage = "";
//int intIndex = Convert.ToInt32(e.CommandArgument);
/*strMessage = GridView1.SelectedIndex.ToString();
strMessage = GridView1.SelectedRow.Cells[0].Text.ToString();
strMessage = GridView1.Rows[GridView1.SelectedIndex].Cells[0].Text.ToString();*/
//GridView1.SelectedRow
/*BL_VirtualCard objVirtual = new BL_VirtualCard();
int intResult = objVirtual.DeleteWalletCard(strMessage);
if (intResult > 0)
strMessage = "Card Deleted successfully.";
else
strMessage = "Card not deleted. Please try again";
divMessage.Visible = true;
divMessage.InnerText = strMessage.ToString();
divAddCard.Visible = true;
clearData();
LoadExistingCards(strUserName);*/
}
}
示例9: GridView1_RowCommand
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "insert")
{
string lot_no, stack, size, no, vol, ctt, remarks, name_party, bid;
DropDownList chl = ((DropDownList)(GridView1.FooterRow.FindControl("chl")));
lot_no = ((TextBox)(GridView1.FooterRow.FindControl("lot_no"))).Text;
stack = ((TextBox)(GridView1.FooterRow.FindControl("stack_no"))).Text;
size = ((DropDownList)(GridView1.FooterRow.FindControl("size"))).Text;
no = ((TextBox)(GridView1.FooterRow.FindControl("no"))).Text;
vol = ((TextBox)(GridView1.FooterRow.FindControl("vol"))).Text;
ctt = ((TextBox)(GridView1.FooterRow.FindControl("ctt"))).Text;
remarks = ((TextBox)(GridView1.FooterRow.FindControl("remarks"))).Text;
name_party = ((TextBox)(GridView1.FooterRow.FindControl("name_party"))).Text;
bid = ((TextBox)(GridView1.FooterRow.FindControl("bid"))).Text;
SqlDataSource1.InsertParameters["challan_no"].DefaultValue = chl.SelectedItem.Text.ToString();
SqlDataSource1.InsertParameters["date"].DefaultValue = TextBox1.Text.ToString();
SqlDataSource1.InsertParameters["stack"].DefaultValue = stack.ToString();
SqlDataSource1.InsertParameters["lot_no"].DefaultValue = lot_no.ToString();
SqlDataSource1.InsertParameters["size"].DefaultValue = size.ToString();
SqlDataSource1.InsertParameters["no"].DefaultValue = no;
SqlDataSource1.InsertParameters["vol"].DefaultValue = vol.ToString();
SqlDataSource1.InsertParameters["ctt"].DefaultValue = ctt.ToString();
SqlDataSource1.InsertParameters["remarks"].DefaultValue = remarks.ToString();
SqlDataSource1.InsertParameters["bid"].DefaultValue = bid.ToString();
SqlDataSource1.InsertParameters["name_party"].DefaultValue = name_party.ToString();
SqlDataSource1.Insert();
GridView1.DataSource = SqlDataSource1;
GridView1.DataBind();
bnk();
}
}
示例10: AppointmentsGridView_RowCommand
/// <summary>
/// Get the appointmentId from the row that was clicked
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void AppointmentsGridView_RowCommand(object sender, GridViewCommandEventArgs e)
{
LinqDataManipulator apps = new LinqDataManipulator();
Notifier textDoctor;
try
{
GridViewRow gvr = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer);
int RowIndex = gvr.RowIndex;
appointmentId = Convert.ToInt32(gvr.Cells[1].Text);
apps.UpdateAppointments(appointmentId);
// Text the Doctor about the upcoming appointment
doctorText = apps.CreateText(appointmentId);
textDoctor = new Notifier(doctorText);
Page_Load(sender, e);
}
catch (Exception)
{
throw;
}
}
示例11: GridView1_RowCommand
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Add")
{
String strName = ((TextBox)GridView1.FooterRow.FindControl("txtName")).Text;
string strAge =((TextBox)GridView1.FooterRow.FindControl("txtAge")).Text;
string strSex = ((TextBox)GridView1.FooterRow.FindControl("txtSex")).Text;
//SqlDataSource1.InsertParameters.Clear();
//SqlDataSource1.InsertParameters.Add
//("FirstName", strFirstName);
//SqlDataSource1.InsertParameters.Add
//("LastName", strLastName);
//SqlDataSource1.InsertParameters.Add
//("Department", strDepartment);
//SqlDataSource1.InsertParameters.Add
//("Location", strLocation);
SqlDataSource1.InsertParameters["Name"].DefaultValue = strName;
SqlDataSource1.InsertParameters["Age"].DefaultValue = strAge;
SqlDataSource1.InsertParameters["Sex"].DefaultValue = strSex;
SqlDataSource1.Insert();
}
}
示例12: GridView1_RowCommand
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
int _langId = int.Parse(e.CommandArgument.ToString());
switch (e.CommandName)
{
case "Delete":
if (Enidc.Web.Business.Language.DeleteLanguage(_langId))
{
//delete ok
this.BindGrid();
}
else {
//delete has some problems
return;
}
// Response.Write(e.CommandArgument.ToString());
break;
case "ChangeStatus":
if (Enidc.Web.Business.Language.ChangeToDefault(_langId))
{
this.BindGrid();
}
else {
return;
}
break;
default:
break;
}
}
示例13: gdvMessDish_RowCommand
protected void gdvMessDish_RowCommand(object sender, GridViewCommandEventArgs e)
{
int i = 0;
if (e.CommandName == "editing")
{
txtDishName.Text = e.CommandArgument.ToString().Split('@')[1].ToString();
hdnMessDish.Value = e.CommandArgument.ToString().Split('@')[0].ToString();
if (e.CommandArgument.ToString().Split('@')[2].ToString() == "Morning Snacks")
ddlMeal.SelectedIndex = 1;
if (e.CommandArgument.ToString().Split('@')[2].ToString() == "Breakfast")
ddlMeal.SelectedIndex = 2;
if (e.CommandArgument.ToString().Split('@')[2].ToString() == "Lunch")
ddlMeal.SelectedIndex = 3;
if (e.CommandArgument.ToString().Split('@')[2].ToString() == "Evenin Snacks")
ddlMeal.SelectedIndex = 4;
if (e.CommandArgument.ToString().Split('@')[2].ToString() == "Dinner")
ddlMeal.SelectedIndex = 5;
btnAdd.Text = "Update";
}
if (e.CommandName == "del")
{
hdnMessDish.Value = e.CommandArgument.ToString().Split('@')[0].ToString();
i = objMess.DeleteMessDish(Convert.ToInt32(hdnMessDish.Value));
if (i > 0)
{
lblMessage.Visible = true;
lblMessage.Text = txtDishName.Text + " DishName Deleted Successfully";
txtDishName.Text = "";
bindMessDish();
}
btnAdd.Text = "Add";
}
}
示例14: GridView1_RowCommand
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
int index = Convert.ToInt32(e.CommandArgument);
GridViewRow row = GridView1.Rows[index];
if (e.CommandName == "Accept")
{
con.Open();
string id = (GridView1.Rows[index].Cells[0].Text);
SqlCommand com4 = new SqlCommand("UPDATE booking SET status='Confirmed' WHERE [email protected] and status='Requested'", con);
com4.Parameters.AddWithValue("@empid", id);
com4.ExecuteNonQuery();
con.Close();
GridView1.EditIndex = -1;
BindSubjectData();
}
else if (e.CommandName == "Reject")
{
con.Open();
string id = (GridView1.Rows[index].Cells[0].Text);
SqlCommand com4 = new SqlCommand("UPDATE booking SET status='Rejected' WHERE [email protected] and status='Requested'", con);
com4.Parameters.AddWithValue("@empid", id);
com4.ExecuteNonQuery();
con.Close();
GridView1.EditIndex = -1;
BindSubjectData();
}
}
示例15: grdMain_RowCommand
protected void grdMain_RowCommand(object sender, GridViewCommandEventArgs e)
{
try
{
if (e.CommandName != "Page")
{//Paginação
int iIndice = (((GridView)sender).PageIndex * ((GridView)sender).PageSize) + int.Parse(e.CommandArgument.ToString());
if (e.CommandName == "Alterar")
{
DataTable lTable = (DataTable)ViewState["WRK_TABLE"];
if (lTable.Rows.Count > 0)
{
Response.Redirect("editNoticia.aspx?NOT_ID=" + lTable.Rows[iIndice][PORT_NOTICIAQD._NOT_ID.Name].ToString());
}
}
else if (e.CommandName == "Excluir")
{
DataTable lTable = (DataTable)ViewState["WRK_TABLE"];
}
}
}
catch (Exception err)
{
exibirMensagem(UpdatePanelPrincipal, "Erro", err.Message, "erro");
}
}