本文整理汇总了C#中System.Web.UI.WebControls.GridViewCommandEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# GridViewCommandEventArgs类的具体用法?C# GridViewCommandEventArgs怎么用?C# GridViewCommandEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GridViewCommandEventArgs类属于System.Web.UI.WebControls命名空间,在下文中一共展示了GridViewCommandEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GridView1_RowCommand
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (Page.IsValid)
{
if (e.CommandName == "Select")
{
Users newUser;
dbHelper helper = new dbHelper();
newUser = helper.GetUserbyName(TextBoxUser.Text);
if (newUser == null)
{
newUser = new Users();
newUser.UserName = TextBoxUser.Text;
newUser.UserType = "local";
newUser.SNUserId = "local" + TextBoxUser.Text;
helper.AddToModel(newUser);
}
Session["user"] = newUser;
WebControl wc = e.CommandSource as WebControl;
GridViewRow row = wc.NamingContainer as GridViewRow;
Session["UseCaseStartTime"] = DateTime.Now;
Session["UseCaseNumber"] = row.RowIndex + 1;
Session["UseCaseText"] = row.Cells[1].Text;
Server.Transfer("Design.aspx");
}
}
}
开发者ID:Juanjojara,项目名称:SimpleFlow,代码行数:29,代码来源:UseCase.aspx.cs
示例2: GridView1_RowCommand
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName.ToString().Equals("viewImage"))
{
Response.Redirect("ImageHome.aspx?imageId=" + Convert.ToString(e.CommandArgument), true);
}
}
开发者ID:guopeichengi,项目名称:CoolImagic,代码行数:7,代码来源:AlbumHome.aspx.cs
示例3: GridView1_RowCommand
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Delete")
{
}
else if (e.CommandName == "Edit")
{
DetailsView1.ChangeMode(DetailsViewMode.Edit);
}
else if(e.CommandName == "Select")
{
DetailsView1.ChangeMode(DetailsViewMode.Edit);
}
else if(e.CommandName== "New")
{
DetailsView1.ChangeMode(DetailsViewMode.Insert);
}
else
{
string cmdname = e.CommandName.ToString();
}
}
开发者ID:tienthanhsph,项目名称:webForm,代码行数:26,代码来源:TuDienLoaiNhaOCongTrinh.aspx.cs
示例4: gvContactType_RowCommand
protected void gvContactType_RowCommand(object sender, GridViewCommandEventArgs e)
{
LeadContactType contactType = null;
int contactTypeID = Convert.ToInt32(e.CommandArgument);
if (e.CommandName == "DoEdit") {
contactType = LeadContactTypeManager.Get(contactTypeID);
if (contactType != null) {
txtContactType.Text = contactType.Description;
showContactTypePanel();
}
}
else if (e.CommandName == "DoDelete") {
contactType = LeadContactTypeManager.Get(contactTypeID);
if (contactType != null) {
contactType.isActive = false;
LeadContactTypeManager.Save(contactType);
DoBind();
}
}
}
开发者ID:Antoniotoress1992,项目名称:asp,代码行数:26,代码来源:ContactTypeList.aspx.cs
示例5: gvTrash_RowCommand
protected void gvTrash_RowCommand(object sender, GridViewCommandEventArgs e)
{
int itemIndex = Convert.ToInt32(e.CommandArgument);
int itemID = Convert.ToInt32(gvTrash.DataKeys[itemIndex].Value);
ContentItem item = Engine.Persister.Get(itemID);
if (e.CommandName == "Restore")
{
try
{
Trash.Restore(item);
this.gvTrash.DataBind();
}
catch (N2.Integrity.NameOccupiedException)
{
cvRestore.IsValid = false;
}
RegisterRefreshNavigationScript(item);
}
else if (e.CommandName == "Purge")
{
if (Trash.TrashContainer != null && Trash.TrashContainer.AsyncTrashPurging)
{
Engine.Resolve<AsyncTrashPurger>().BeginPurge(item.ID);
Response.Redirect(Request.RawUrl.ToUrl().SetQueryParameter("showStatus", "true"));
}
else
Engine.Persister.Delete(item);
}
else
{
RegisterRefreshNavigationScript(CurrentItem);
}
}
开发者ID:grbbod,项目名称:drconnect-jungo,代码行数:35,代码来源:Default.aspx.cs
示例6: grdMain_RowCommand
protected void grdMain_RowCommand(object sender, GridViewCommandEventArgs e)
{
try
{
if (e.CommandName != "Page") //Paginação
{
int iIndice = grdMain.PageIndex * grdMain.PageSize + int.Parse(e.CommandArgument.ToString());
if (e.CommandName == "Alterar")
{
DataTable lTable = (DataTable)ViewState["WRK_TABLE"];
if (lTable.Rows.Count > 0)
{
txtDESCCENTES_APRESENTACAO.Text = lTable.Rows[iIndice][DESCCENTROESTUDOQD._DESCCENTES_APRESENTACAO.Name].ToString();
txtDESCCENTES_OBJETIVO.Text = lTable.Rows[iIndice][DESCCENTROESTUDOQD._DESCCENTES_OBJETIVO.Name].ToString();
txtDESCCENTES_CONTATO.Text = lTable.Rows[iIndice][DESCCENTROESTUDOQD._DESCCENTES_CONTATO.Name].ToString();
hidDESCCENTES_ID.Value = lTable.Rows[iIndice][DESCCENTROESTUDOQD._DESCCENTES_ID.Name].ToString();
}
}
else if (e.CommandName == "Excluir")
{
DataTable lTable = (DataTable)ViewState["WRK_TABLE"];
InterfaceUpdate(decimal.Parse(lTable.Rows[iIndice][DESCCENTROESTUDOQD._DESCCENTES_ID.Name].ToString()), "I");
}
}
}
catch (Exception err)
{
(new UnknownException(err)).TratarExcecao(true);
}
}
开发者ID:andreibaptista,项目名称:DEF_PUB_DEFNET_PORTAL,代码行数:35,代码来源:DESCCENTROESTUDO.aspx.cs
示例7: GridView1_RowCommand
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
String s = GridView1.Rows[Convert.ToInt16(e.CommandArgument)].Cells[1].Text;
Session["passing"] = s;
// the show entire items for respective row
Response.Redirect("HistoryDisbursementListDetails.aspx");
}
开发者ID:Tictaclu,项目名称:Team7AD,代码行数:7,代码来源:HistoryDisbursementList.aspx.cs
示例8: AddOneToPriority
private void AddOneToPriority(GridViewCommandEventArgs e)
{
Func<int, bool> func =
(int _issueId)
=> issueController.AddOneToPriority(_issueId);
ModifyIssue(e, func);
}
开发者ID:uncas,项目名称:hibes,代码行数:7,代码来源:Default.aspx.cs
示例9: grdStates_OnRowCommand
protected void grdStates_OnRowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "EditRow")
{
var row = ((Control)e.CommandSource).NamingContainer as GridViewRow;
if (row != null)
{
txtStateName.Text = ((Label)(row.FindControl("lblStateName"))).Text;
ddlcountryName.SelectedValue = ((Label)(row.FindControl("lblCountryId"))).Text;
_stateId = Convert.ToInt32(((Label)(row.FindControl("lblStateId"))).Text);
}
}
else if (e.CommandName == "Del")
{
var row = ((Control)e.CommandSource).NamingContainer as GridViewRow;
if (row != null)
{
var oState = new States();
var stateId = Convert.ToInt32(((Label)(row.FindControl("lblStateId"))).Text);
MasterDataMethods.DeleteState(stateId);
FillGrid();
}
}
}
开发者ID:mzrokz,项目名称:LssTms,代码行数:25,代码来源:State.aspx.cs
示例10: gvCourses_RowCommand
protected void gvCourses_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Delete")
{
string id = Convert.ToString(e.CommandArgument);
if (id == this.Id)
{
viewForm.Visible = false;
}
try
{
ISelection select = SelectionMgr.Get(id, LoginUser.Id);
if (select == null)
{
lblMessage.Text = "选课已取消!";
return;
}
BLL.SelectionMgr.Delete(select.Id);
lblMessage.Text = "选课取消成功!";
}
catch (Exception ex)
{
lblMessage.Text = ex.Message;
}
}
}
开发者ID:baikangwang,项目名称:April,代码行数:28,代码来源:StdQuery.aspx.cs
示例11: gvClaims_RowCommand
protected void gvClaims_RowCommand(object sender, GridViewCommandEventArgs e)
{
string[] ids = e.CommandArgument.ToString().Split(new char[] {'|'});
int claimID = Convert.ToInt32(ids[0]);
int policyID = Convert.ToInt32(ids[1]);
Claim claim = null;
if (e.CommandName == "DoEdit") {
Session["ClaimID"] = claimID;
Session["policyID"] = policyID;
Response.Redirect("~/Protected/ClaimEdit.aspx");
}
else if (e.CommandName == "DoDelete") {
try {
claim = ClaimsManager.Get(claimID);
if (claim != null) {
// make claim as deleted
claim.IsActive = false;
ClaimsManager.Save(claim);
// refresh claim list
bindData(claim.PolicyID);
}
}
catch (Exception ex) {
Core.EmailHelper.emailError(ex);
}
}
}
开发者ID:Antoniotoress1992,项目名称:asp,代码行数:34,代码来源:ucClaimList.ascx.cs
示例12: TransactionsTable_OnRowCommand
protected void TransactionsTable_OnRowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName != "DeleteTransaction")
return;
try
{
var connString = ConfigurationManager.ConnectionStrings["CineQuilla"].ConnectionString;
using (SqlConnection connection = new SqlConnection(connString))
{
connection.Open();
using (SqlCommand command = new SqlCommand(null, connection))
{
command.CommandText = "DELETE FROM transactions WHERE id = @id";
SqlParameter idParam = new SqlParameter("@id", SqlDbType.Int);
idParam.Value = e.CommandArgument;
command.Parameters.Add(idParam);
command.Prepare();
command.ExecuteNonQuery();
}
}
}
catch (SqlException ex)
{
ErrorLabel.Visible = true;
return;
}
Response.Redirect(Request.RawUrl);
}
开发者ID:Subv,项目名称:CineQuilla,代码行数:30,代码来源:ManageTransactions.aspx.cs
示例13: UserActive
public void UserActive(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "UserActive")
{
using (App_Data.DataClassesERPDataContext erpdb = new App_Data.DataClassesERPDataContext())
{
int index = Convert.ToInt32(e.CommandArgument);
string userstmp = GridView1.DataKeys[index].Value.ToString();
LblID.Text = userstmp;
var UserData = from u in erpdb.aspnet_Users
join m in erpdb.aspnet_Memberships on u.UserId equals m.UserId
where u.UserId.ToString() == userstmp
select new
{
user_code = u.UserName,
email = m.Email,
last_login_date = m.LastLoginDate,
register_date = m.CreateDate,
active_flag = u.MobileAlias
};
foreach (var ud in UserData)
{
txtLoginName.Text = ud.user_code;
txtEmail.Text = ud.email;
}
}
MultiView1.ActiveViewIndex = 1;
}
}
开发者ID:phwuxj99,项目名称:iserp,代码行数:31,代码来源:AdminUserActive.aspx.cs
示例14: gvAmortizations_RowCommand
protected void gvAmortizations_RowCommand(object sender, GridViewCommandEventArgs e)
{
//GridViewRow gvr = (GridViewRow)((e.CommandArgument));
//int RowIndex;
//int.TryParse(e.CommandArgument.ToString(),out RowIndex);
//((CheckBox)gvAmortizations.Rows[RowIndex].FindControl("ckPaid")).Enabled = true;
}
开发者ID:Nakadale,项目名称:NPFIS,代码行数:7,代码来源:LoanManagement.aspx.cs
示例15: gvProductVariantAttributeValues_RowCommand
protected void gvProductVariantAttributeValues_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "UpdateProductVariantAttributeValue")
{
int index = Convert.ToInt32(e.CommandArgument);
GridViewRow row = gvProductVariantAttributeValues.Rows[index];
HiddenField hfProductVariantAttributeValueId = row.FindControl("hfProductVariantAttributeValueId") as HiddenField;
SimpleTextBox txtName = row.FindControl("txtName") as SimpleTextBox;
DecimalTextBox txtPriceAdjustment = row.FindControl("txtPriceAdjustment") as DecimalTextBox;
DecimalTextBox txtWeightAdjustment = row.FindControl("txtWeightAdjustment") as DecimalTextBox;
CheckBox cbIsPreSelected = row.FindControl("cbIsPreSelected") as CheckBox;
NumericTextBox txtDisplayOrder = row.FindControl("txtDisplayOrder") as NumericTextBox;
int productVariantAttributeValueId = int.Parse(hfProductVariantAttributeValueId.Value);
string name = txtName.Text;
decimal priceAdjustment = txtPriceAdjustment.Value;
decimal weightAdjustment = txtWeightAdjustment.Value;
bool isPreSelected = cbIsPreSelected.Checked;
int displayOrder = txtDisplayOrder.Value;
ProductVariantAttributeValue productVariantAttributeValue = ProductAttributeManager.GetProductVariantAttributeValueById(productVariantAttributeValueId);
if (productVariantAttributeValue != null)
{
productVariantAttributeValue = ProductAttributeManager.UpdateProductVariantAttributeValue(productVariantAttributeValue.ProductVariantAttributeValueId,
productVariantAttributeValue.ProductVariantAttributeId, name,
priceAdjustment, weightAdjustment, isPreSelected, displayOrder);
SaveLocalizableContentGrid(productVariantAttributeValue);
}
BindData();
}
}
开发者ID:netmatrix01,项目名称:Innocent,代码行数:34,代码来源:ProductVariantAttributeValues.ascx.cs
示例16: Action_gridview_RowCommand
protected void Action_gridview_RowCommand(object sender, GridViewCommandEventArgs e)
{
GridView _gridView = (GridView)sender;
GridViewRow row = Action_gridview.SelectedRow;
// Get the selected index and the command name
string _commandName = e.CommandName;
if (_commandName == "DoubleClick")
{
int id = Int32.Parse(e.CommandArgument.ToString());
try
{
if (id >= 0)
{
Response.Redirect("~/Detail/DetailAction2.aspx?id=" + id);
//Page.ClientScript.RegisterStartupScript(this.GetType(), "OpenWindow", "window.open('~/Detail/DetailRole2.aspx?id='" + id + ",'_newtab');", true);
}
}
catch
{
Response.Write(Action_gridview.SelectedIndex + " " + id);
}
}
}
开发者ID:donghang11,项目名称:Support-Page,代码行数:27,代码来源:Action.aspx.cs
示例17: GridView1_RowCommand
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
//GridViewRow gvr = (GridViewRow)((Control)e.CommandSource).Parent.Parent
User u = (User)Session["UserEntity"];
if (u.RoleId != 4)
{
Response.Redirect("../Security.aspx");
}
purchase s = (purchase)Session["purchaseitem"];
int index=Convert.ToInt32(e.CommandArgument);
string k =GridView1.Rows[index].Cells[0].Text;
index = Convert.ToInt32(k);
DropDownList dp = (DropDownList)GridView1.Rows[0].Cells[0].FindControl("choosesupplier");
string sp = dp.Text;
if (e.CommandName == "ChangeSupplier")
{
pl.changesupplier(index, s.purchaserId, sp,u.UserId);
Response.Redirect("Purchaseitems.aspx");
};
if (e.CommandName == "DeleteItem")
{
pl.delete(index, s.supplierId, s.purchaserId);
Response.Redirect("Purchaseitems.aspx");
}
}
开发者ID:yumengjin,项目名称:Team7AD,代码行数:26,代码来源:Purchaseitems.aspx.cs
示例18: uiGridViewCats_RowCommand
protected void uiGridViewCats_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "EditCat")
{
MainCat objData = new MainCat();
objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()));
uiTextBoxEnName.Text = objData.NameEng;
uiTextBoxArName.Text = objData.NameAr;
uiPanelAllCats.Visible = false;
uiPanelEditCat.Visible = true;
CurrentMainCat = objData;
BindCats();
}
else if (e.CommandName == "DeleteCat")
{
try
{
MainCat objData = new MainCat();
objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()));
objData.MarkAsDeleted();
objData.Save();
CurrentMainCat = null;
BindCats();
}
catch (Exception ex)
{
uipanelError.Visible = true;
}
}
}
开发者ID:menasbeshay,项目名称:ivalley-svn,代码行数:33,代码来源:MainCat_ps.aspx.cs
示例19: GridView_stuff_list_RowCommand
protected void GridView_stuff_list_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Del_Btn")
{
int index = Convert.ToInt32(e.CommandArgument);
GridViewRow selectedRow = GridView_stuff_list.Rows[index];
TableCell SID = selectedRow.Cells[0];
Session["SID"] = SID.Text;
string ConnectionString = @"DATA SOURCE=127.0.0.1:1521/XE;PERSIST SECURITY INFO=True;USER ID=TAHMID; Password=anik";
string cmdQuery = "delete from STUFF where STUFF_ID = '" +Session["SID"]+"'";
OracleDataAdapter a = new OracleDataAdapter(cmdQuery, ConnectionString);
OracleCommandBuilder builder = new OracleCommandBuilder(a);
DataSet ds = new DataSet();
a.Fill(ds, "STUFF_delete");
Response.Redirect("stuff_list.aspx");
}
else if (e.CommandName == "edit_Btn")
{
int index = Convert.ToInt32(e.CommandArgument);
GridViewRow selectedRow = GridView_stuff_list.Rows[index];
TableCell SID = selectedRow.Cells[0];
Session["U_SID"] = SID.Text;
Response.Redirect("edit_stuff.aspx");
}
}
开发者ID:tahmidanik,项目名称:ConventionHallManagementSystem,代码行数:26,代码来源:stuff_list.aspx.cs
示例20: PermisosGridView_RowCommand
protected void PermisosGridView_RowCommand(object sender, GridViewCommandEventArgs e)
{
int item = Convert.ToInt32(e.CommandArgument);
List<Entidades.Permiso> lista = (List<Entidades.Permiso>)ViewState["Permisos"];
Entidades.Permiso permiso = lista[item];
switch (e.CommandName)
{
case "CambiarEstado":
if (permiso.WF.Estado == "Vigente" || permiso.WF.Estado == "DeBaja")
{
TituloConfirmacionLabel.Text = "Confirmar " + (permiso.WF.Estado == "Vigente" ? "Baja" : "Anulación Baja");
AccionLabel.Text = permiso.Accion.Tipo + " nº " + permiso.Accion.Nro;
CuitLabel.Text = permiso.Cuit;
IdTipoPermisoLabel.Text = permiso.TipoPermiso.Id;
EstadoLabel.Text = permiso.WF.Estado;
FechaFinVigenciaLabel.Text = permiso.FechaFinVigencia.ToString("dd/MM/yyyy");
UNLabel.Text = permiso.IdUN.ToString();
UsuarioLabel.Text = permiso.Usuario.Id;
UsuarioSolicitanteLabel.Text = permiso.UsuarioSolicitante.Id;
ViewState["Permiso"] = permiso;
ModalPopupExtender1.Show();
}
else
{
MensajeLabel.Text = "El cambio de estado sólo puede usarse para Bajas o Anulaciones de bajas.";
}
break;
}
}
开发者ID:pjeconde,项目名称:CedServicios,代码行数:29,代码来源:ExploradorPermiso.aspx.cs
注:本文中的System.Web.UI.WebControls.GridViewCommandEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论