本文整理汇总了C#中DataGridCommandEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# DataGridCommandEventArgs类的具体用法?C# DataGridCommandEventArgs怎么用?C# DataGridCommandEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataGridCommandEventArgs类属于命名空间,在下文中一共展示了DataGridCommandEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: g_ItemCommand
protected void g_ItemCommand(object source, DataGridCommandEventArgs e)
{
if (e.CommandName == "Edit")
{
base.Response.Redirect("AdvertisementsEdit.aspx?ID=" + e.Item.Cells[6].Text + "&LotteryID=" + this.ddlLotteries.SelectedValue + "&TypeID=" + this.ddlType.SelectedValue, true);
}
}
示例2: grdEmpl_Itemcommand
public void grdEmpl_Itemcommand(Object sender, DataGridCommandEventArgs e)
{
String loginid = "";
DataSet dsExpand = new DataSet();
WhitfieldPayroll _dbClass = new WhitfieldPayroll();
switch (e.CommandName)
{
case "Expand":
{
loginid = Convert.ToString(grdEmpl.DataKeys[e.Item.ItemIndex]);
dsExpand = _dbClass.GetPayRollProjectHoursForEmployee(loginid, txtFromDate.Text.Trim(), txtToDate.Text.Trim());
PlaceHolder exp = new PlaceHolder();
exp = (System.Web.UI.WebControls.PlaceHolder)e.Item.Cells[7].FindControl("ExpandedContent");
ImageButton img = new ImageButton();
img = (System.Web.UI.WebControls.ImageButton)e.Item.Cells[0].FindControl("btnExpand");
if (dsExpand.Tables[0].Rows.Count > 0)
{
if (img.ImageUrl == "assets/img/Plus.gif")
{
img.ImageUrl = "assets/img/Minus.gif";
exp.Visible = true;
((Whitfield_Payroll_ByProject)(e.Item.FindControl("DynamicTable1"))).Visible = true;
((Whitfield_Payroll_ByProject)(e.Item.FindControl("DynamicTable1"))).DisplayGrid(loginid, txtFromDate.Text.Trim(), txtToDate.Text.Trim());
}
else
{
exp.Visible = false;
((Whitfield_Payroll_ByProject)(e.Item.FindControl("DynamicTable1"))).Visible = false;
img.ImageUrl = "assets/img/Plus.gif";
}
}
else
{
if (img.ImageUrl == "assets/img/Plus.gif")
{
//((ViewDesignAdmin)(e.Item.FindControl("DynamicTable1"))).Visible = true;
img.ImageUrl = "assets/img/Minus.gif";
exp.Visible = true;
((Whitfield_Payroll_ByProject)(e.Item.FindControl("DynamicTable1"))).Visible = true;
((Whitfield_Payroll_ByProject)(e.Item.FindControl("DynamicTable1"))).DisplayGrid(loginid, txtFromDate.Text.Trim(), txtToDate.Text.Trim());
}
else
{
exp.Visible = false;
((Whitfield_Payroll_ByProject)(e.Item.FindControl("DynamicTable1"))).Visible = false;
img.ImageUrl = "assets/img/Plus.gif";
}
}
break;
}
default:
{
break;
}
}
}
示例3: grdCOSOV_CancelCommand
public void grdCOSOV_CancelCommand(object sender, DataGridCommandEventArgs e)
{
//'grdSOV_CancelCommand'
grdCOSOV.ShowFooter = true;
grdCOSOV.EditItemIndex = -1;
this.DisplayCOSOVGrid();
}
示例4: g_ItemCommand
protected void g_ItemCommand(object source, DataGridCommandEventArgs e)
{
if (e.CommandName == "Edit")
{
base.Response.Redirect("SiteAffichesEdit.aspx?id=" + e.Item.Cells[5].Text, true);
}
else if (e.CommandName == "Del")
{
int returnValue = -1;
string returnDescription = "";
if (Procedures.P_SiteAfficheDelete(base._Site.ID, long.Parse(e.Item.Cells[5].Text), ref returnValue, ref returnDescription) < 0)
{
PF.GoError(4, "数据库繁忙,请重试", "Admin_SiteAffiches");
}
else if (returnValue < 0)
{
PF.GoError(1, returnDescription, "Admin_SiteAffiches");
}
else
{
Shove._Web.Cache.ClearCache("SiteAffiches");
Shove._Web.Cache.ClearCache("Default_GetSiteAffiches");
this.BindData();
}
}
}
示例5: Grid_CartCommand
public void Grid_CartCommand(Object sender, DataGridCommandEventArgs e)
{
string name = e.Item.Cells[1].Text;
string op = e.Item.Cells[2].Text;
int err;
if ("Add".Equals(((Button)e.CommandSource).CommandName))
{
if ("新增".Equals(op) && College_Key.IsExist(name))
{
Response.Write("<script>window.alert('该关键词已经存在。');</script>");
return;
}
err = College_Key.AuditAccept(name, op);
}
else
err = College_Key.AuditReject(name, op);
if (err == 1)
{
ItemsGrid.DataSource = CreateDataSource();
ItemsGrid.DataBind(); e.Item.Cells[3].Enabled = false;
Response.Write("<script>window.alert('操作成功。');</script>");
}
else
Response.Write("<script>window.alert('通过或拒绝关键词的操作出错。');</script>");
}
示例6: dgCoaches_ItemCommand
protected void dgCoaches_ItemCommand(object source, DataGridCommandEventArgs e)
{
Label lbl = (Label)e.Item.FindControl("lblid");
id = int.Parse(lbl.Text);
ServiceReference1.Service1Client sv = new ServiceReference1.Service1Client();
ServiceReference1.get_Coach_By_ID_Result coaches = sv.Get_Coach_By_ID(id);
// get train name
string trainname = sv.get_Train_By_ID(int.Parse(coaches.Train_ID.ToString())).Train_Name;
// show data
ddlTrainName.SelectedValue = coaches.Train_ID.ToString();
ddlCoachesType.SelectedItem.Text = coaches.Coach_Type;
txtSeats.Text = coaches.Number_Of_Seats.ToString();
_train_id = int.Parse(coaches.Train_ID.ToString());
txtPrices.Text = coaches.Price.ToString();
if (coaches.Status.ToString() == "Active")
{
RadioButton1.Checked = true;
RadioButton2.Checked = false;
}
else
{
RadioButton2.Checked = true;
RadioButton1.Checked = false;
}
ddlTrainName.Enabled = false;
ddlCoachesType.Enabled = false;
btnUpdate.Visible = true;
btnDelete.Visible = true;
btnCancel.Visible = true;
btnAdd.Visible = false;
}
示例7: grid_ItemCommand
public void grid_ItemCommand(object source, DataGridCommandEventArgs e)
{
try
{
switch(e.CommandName)
{
case "Delete":
SessionManager.BlogService.DeleteHighlight(SessionManager.Ticket, int.Parse(e.CommandArgument.ToString()));
SessionManager.Invalidate<TransitHighlight>();
ReportInfo("Item Deleted");
GetData(source, e);
break;
case "Up":
SessionManager.BlogService.MoveHighlight(SessionManager.Ticket, int.Parse(e.CommandArgument.ToString()), -1);
SessionManager.Invalidate<TransitHighlight>();
GetData(source, e);
break;
case "Down":
SessionManager.BlogService.MoveHighlight(SessionManager.Ticket, int.Parse(e.CommandArgument.ToString()), 1);
SessionManager.Invalidate<TransitHighlight>();
GetData(source, e);
break;
}
}
catch(Exception ex)
{
ReportException(ex);
}
}
示例8: g1_ItemCommand
protected void g1_ItemCommand(object source, DataGridCommandEventArgs e)
{
if (e.CommandName == "Del")
{
long ID = Shove._Convert.StrToLong(e.Item.Cells[5].Text, 0);
if (MSSQL.ExecuteNonQuery("update T_StationSMS set isShow = 0 where [ID] = " + ID.ToString()) < 0)
{
PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", "Room_Message");
return;
}
Shove._Web.Cache.ClearCache("MemberMessage_System" + _User.ID.ToString());
BindDataForSystemMessage();
return;
}
else if (e.CommandName == "View")
{
long ID = Shove._Convert.StrToLong(e.Item.Cells[5].Text, 0);
Response.Redirect("ViewMessage.aspx?ID=" + ID);
}
}
示例9: dgvAccount_ItemCommand
protected void dgvAccount_ItemCommand(object source, DataGridCommandEventArgs e)
{
if (e.Item.DataSetIndex >= 0)
{
try
{
string cr_acc_nbr = "";
//xác định vị trí của row
// Button3.Enabled = true;
cr_acc_nbr = e.Item.Cells[3].Text;
//lbSource_no.Text = source_no;
// Loadreport(cr_acc_nbr);
load_data(cr_acc_nbr);
}
catch (Exception ex)
{
#region logException
executedb.WriteLogERROR(Session["Username"].ToString(), "IP: " + Request.UserHostAddress, this.Page.ToString(), System.Reflection.MethodBase.GetCurrentMethod().ToString(), ex.Message);
//executedb.WriteLogPri(Environment.NewLine + DateTime.Now.ToLongDateString() + " " + DateTime.Now.ToLongTimeString() + " - " + Session["Username"].ToString() + ": " + ex.Message);
//Response.Write("<script>alert('Error when executing coding')</script>");
Alert.Show("Error when executing coding!!!", this);
#endregion logException
}
}
}
示例10: grid_ItemCommand
public void grid_ItemCommand(object source, DataGridCommandEventArgs e)
{
try
{
switch(e.CommandName)
{
case "Delete":
SessionManager.BlogService.DeleteFeed(SessionManager.Ticket, int.Parse(e.CommandArgument.ToString()));
SessionManager.Invalidate<TransitFeed>();
ReportInfo("Item Deleted");
GetData(source, e);
break;
case "Update":
int count = SessionManager.BlogService.UpdateFeed(SessionManager.Ticket, int.Parse(e.CommandArgument.ToString()));
ReportInfo(string.Format("Feed Updated With {0} New Item(s)", count));
SessionManager.Invalidate<TransitFeed>();
grid_OnGetDataSource(source, e);
grid.DataBind();
break;
}
}
catch(Exception ex)
{
ReportException(ex);
}
}
示例11: g_ItemCommand
protected void g_ItemCommand(object source, DataGridCommandEventArgs e)
{
if (e.CommandName == "Edit")
{
base.Response.Redirect("ExpertsPredictEdit.aspx?ID=" + e.Item.Cells[6].Text, true);
}
}
示例12: g_ItemCommand
protected void g_ItemCommand(object source, DataGridCommandEventArgs e)
{
if (e.CommandName == "Cancel")
{
if (base._User == null)
{
JavaScript.Alert(this, "已退出登陆,请重新登陆", base.Request.Url.AbsoluteUri);
}
else
{
int num = _Convert.StrToInt(e.Item.Cells[6].Text, -1);
if (num < 0)
{
JavaScript.Alert(this, "取消定制失败!");
}
else if (MSSQL.ExecuteNonQuery("delete from T_CustomFriendFollowSchemes where FollowUserID = " + num.ToString() + " and UserID = " + base._User.ID.ToString(), new MSSQL.Parameter[0]) < 0)
{
JavaScript.Alert(this, "取消定制失败!");
}
else
{
Shove._Web.Cache.ClearCache("T_CustomFriendFollowSchemes" + this.HidLotteryID.Value);
this.BindData();
JavaScript.Alert(this, "取消定制成功!");
}
}
}
}
示例13: gridManage_ItemCommand
public void gridManage_ItemCommand(object sender, DataGridCommandEventArgs e)
{
switch (e.CommandName)
{
case "Delete":
{
int id = int.Parse(e.Item.Cells[(int)Cells.id].Text);
SessionManager.Delete<TransitAccountFeed>(id, SessionManager.SyndicationService.DeleteAccountFeed);
ReportInfo("Feed deleted.");
GetData(sender, e);
}
break;
case "Update":
{
int id = int.Parse(e.Item.Cells[(int)Cells.id].Text);
int item_count = SessionManager.SyndicationService.UpdateAccountFeedItems(SessionManager.Ticket, id);
int image_count = SessionManager.SyndicationService.UpdateAccountFeedItemImgs(SessionManager.Ticket, id);
int media_count = SessionManager.SyndicationService.UpdateAccountFeedItemMedias(SessionManager.Ticket, id);
SessionManager.InvalidateCache<TransitAccountFeedItem>();
SessionManager.InvalidateCache<TransitAccountFeedItemImg>();
SessionManager.InvalidateCache<TransitAccountFeedItemMedia>();
StringBuilder s = new StringBuilder("Feed updated with ");
s.AppendFormat("{0} new item{1}", item_count, item_count == 1 ? string.Empty : "s");
s.AppendFormat(", {0} new image{1}", image_count, image_count == 1 ? string.Empty : "s");
s.AppendFormat(" and {0} new media item{1}.", media_count, media_count == 1 ? string.Empty : "s");
ReportInfo(s.ToString());
gridManage_OnGetDataSource(sender, e);
gridManage.DataBind();
}
break;
}
}
示例14: dgvAccount_ItemCommand
protected void dgvAccount_ItemCommand(object source, DataGridCommandEventArgs e)
{
if (e.Item.DataSetIndex >= 0)
{
try
{
ClearDetail();
Button3.Enabled = true;
string source_no = "";
//xác định vị trí của row
Panel1.Visible = true;
source_no = e.Item.Cells[1].Text;
//tbType
string type=e.Item.Cells[10].Text;
tbType.Text = type;
LoadDetails(source_no,type);
}
catch (Exception ex)
{
#region logException
executedb.WriteLogERROR(Session["Username"].ToString(), "IP: " + Request.UserHostAddress, this.Page.ToString(), System.Reflection.MethodBase.GetCurrentMethod().ToString(), ex.Message);
//executedb.WriteLogPri(Environment.NewLine + DateTime.Now.ToLongDateString() + " " + DateTime.Now.ToLongTimeString() + " - " + Session["Username"].ToString() + ": " + ex.Message);
//Response.Write("<script>alert('Error when executing coding')</script>");
Alert.Show("Error when executing coding!!!", this);
#endregion logException
}
}
}
示例15: gridLookup_ItemCommand
public void gridLookup_ItemCommand(object sender, DataGridCommandEventArgs e)
{
switch (e.CommandName)
{
case "Impersonate":
int id = int.Parse(e.CommandArgument.ToString());
if (SessionManager.AccountId == id)
{
throw new Exception("You cannot impersonate self.");
}
if (!SessionManager.IsAdministrator)
{
// avoid round-trip
throw new Exception("You must be an administrator to impersonate users.");
}
if (SessionManager.IsImpersonating)
{
throw new Exception("You're already impersonating a user.");
}
SessionManager.Impersonate(SessionManager.AccountService.Impersonate(
SessionManager.Ticket, id));
Response.Redirect("AccountView.aspx");
break;
}
}