本文整理汇总了C#中DataListCommandEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# DataListCommandEventArgs类的具体用法?C# DataListCommandEventArgs怎么用?C# DataListCommandEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataListCommandEventArgs类属于命名空间,在下文中一共展示了DataListCommandEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: dlCategory_ItemCommand
protected void dlCategory_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "select")
{
Response.Redirect("goodsList.aspx?id=" + e.CommandArgument);
}
}
开发者ID:nikkiLuan,项目名称:ASP.NET-Online-Order-System,代码行数:7,代码来源:Category.ascx.cs
示例2: dlCancellationDetails_UpdateCommand
protected void dlCancellationDetails_UpdateCommand(object source, DataListCommandEventArgs e)
{
DataModel.AdminDM objDataModel = new DataModel.AdminDM();
BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();
TextBox txtCancel = (TextBox)e.Item.FindControl("txtCancellationPercentage");
objDataModel._id=Convert.ToInt16( dlCancellationDetails.DataKeys[e.Item.ItemIndex]);
objDataModel._cancellationPercent =Convert.ToInt16( txtCancel.Text.Trim());
if (Convert.ToBoolean(objBusinessLogic.updateCancellationDetails(objDataModel)))
{
dlCancellationDetails.EditItemIndex = -1;
dlCancellationDetails.DataBind();
bindCancellationDetails();
lblMessage.Text = "Updated Succesfully";
lblMessage.ForeColor = System.Drawing.Color.Green;
lblMessage.Visible = true;
}
else
{
lblMessage.Text = "cannot update cancellation Percent";
lblMessage.ForeColor = System.Drawing.Color.Red;
lblMessage.Visible = true;
}
}
开发者ID:CaesaRBur,项目名称:WebProject,代码行数:26,代码来源:frmCancellationDetails.aspx.cs
示例3: subUpDel
//update delete function to update and delete contacts
protected void subUpDel(object sender, DataListCommandEventArgs e)
{
switch (e.CommandName)
{
case "Update":
TextBox txtfname = (TextBox)e.Item.FindControl("txt_fnameU");
//TextBox txtMessage = (TextBox)e.Item.FindControl("txt_messageU");
TextBox txtlname = (TextBox)e.Item.FindControl("txt_lnameU");
//DropDownList ddldept = (DropDownList)e.Item.FindControl("ddl_deptU");
//ddldept.DataTextField = "ddl_deptU";
//TextBox txtdept = (TextBox)e.Item.FindControl("txt_deptU");
TextBox txtemail = (TextBox)e.Item.FindControl("txt_emailU");
HiddenField hdfID = (HiddenField)e.Item.FindControl("hdf_idU");
int contactID = int.Parse(hdfID.Value.ToString());
_strMessage(objContact.commitUpdate(contactID, txtfname.Text, txtlname.Text,txtemail.Text), "update");
_subRebind();
break;
case "Delete":
int _id = int.Parse(((HiddenField)e.Item.FindControl("hdf_idD")).Value);
_strMessage(objContact.commitDelete(_id), "delete");
_subRebind();
break;
case "Cancel":
_subRebind();
break;
}
}
开发者ID:jacqueline27hh,项目名称:Dryden,代码行数:31,代码来源:admincontact.aspx.cs
示例4: gridManage_ItemCommand
public void gridManage_ItemCommand(object sender, DataListCommandEventArgs e)
{
switch (e.CommandName)
{
case "Delete":
{
int id = int.Parse(e.CommandArgument.ToString());
SessionManager.Delete<TransitAccountStoryPicture>(id, SessionManager.StoryService.DeleteAccountStoryPicture);
ReportInfo("Picture deleted.");
GetData(sender, e);
}
break;
case "Right":
{
int id = int.Parse(e.CommandArgument.ToString());
SessionManager.StoryService.MoveAccountStoryPicture(SessionManager.Ticket, id, 1);
if (e.Item.ItemIndex + 1 == gridManage.Items.Count && gridManage.CurrentPageIndex + 1 < gridManage.PagedDataSource.PageCount)
gridManage.CurrentPageIndex++;
SessionManager.InvalidateCache<TransitAccountStoryPicture>();
gridManage_OnGetDataSource(sender, e);
gridManage.DataBind();
}
break;
case "Left":
{
int id = int.Parse(e.CommandArgument.ToString());
SessionManager.StoryService.MoveAccountStoryPicture(SessionManager.Ticket, id, -1);
if (e.Item.ItemIndex == 0 && gridManage.CurrentPageIndex > 0) gridManage.CurrentPageIndex--;
SessionManager.InvalidateCache<TransitAccountStoryPicture>();
gridManage_OnGetDataSource(sender, e);
gridManage.DataBind();
}
break;
}
}
开发者ID:dblock,项目名称:sncore,代码行数:35,代码来源:AccountStoryPicturesManage.aspx.cs
示例5: EP
EP ep = new EP(); //实例化一个对象
#endregion Fields
#region Methods
protected void dlSoftIntro_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "Xiangxi")
{
Response.Redirect("list_softdownload.aspx");//将页面跳转到list_softdownload.aspx页面中
}
}
开发者ID:kinggod,项目名称:21SourceCode,代码行数:13,代码来源:Default.aspx.cs
示例6: dlTourArea_ItemCommand
protected void dlTourArea_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "Select")
{
Label lblLine = (Label)e.Item.FindControl("lblLine");
if (!string.IsNullOrEmpty(lblLine.Text.Trim()))
{
string citys = lblLine.Text.Trim().Replace(@",", @";");
string[] Citys = citys.Split(new char[] { ';' });
List<string> listCity = new List<string>();
for (int i = 0; i < Citys.Length; i++)
{
listCity.Add(Citys[i]);
}
string city = listCity[0];
Terms.Common.Domain.City City = m_CommonService.FindCityByCityCode(city);
if (City != null)
{
Label lblID = (Label)e.Item.FindControl("lblID");
Utility.TourCitys = listCity;
Utility.IsTourMain = true;
Utility.IsTourMore = true;
TourSearchCondition tourSearchCondition = new TourSearchCondition();
if (City.CountryCode == "US")
{
tourSearchCondition.Region = "U.S.";
}
else
{
tourSearchCondition.Region = City.CountryCode;
}
tourSearchCondition.Counrty = City.CountryCode ;
tourSearchCondition.CityList = listCity;
tourSearchCondition.City = city;
tourSearchCondition.DeptCity = city;
tourSearchCondition.IsLandOnly = true;
tourSearchCondition.PriceType = TERMS.Common.TourPriceType.All;
tourSearchCondition.TravelBeginDate = DateTime.Now.Date.AddDays(7);
tourSearchCondition.TravelDaysFrom = 1;
tourSearchCondition.TravelDaysTo = 800;
this.Transaction.IntKey = tourSearchCondition.GetHashCode();
this.Transaction.CurrentSearchConditions = tourSearchCondition;
this.Transaction.CurrentTransactionObject = new TERMS.Business.Centers.SalesCenter.TransactionObject();
//��¼Search More�¼�
OperaterAdvice.DoAdvice(Terms.Configuration.Utility.ConfigurationConst.OperateType.MV_SearchMoreTour, this);
this.Response.Redirect("~/Page/Common/Searching1.aspx?TourArea=" + Server.UrlEncode("U.S.") + "&ConditionID=" + Utility.Transaction.IntKey.ToString() + "&Type=More&target=~/Page/Tour/NewTourMoreSearchResultForm" + "&TopDestinations=" + lblID.Text);
}
}
}
}
开发者ID:foxvirtuous,项目名称:MVB2C,代码行数:60,代码来源:TopDestinationsControl.ascx.cs
示例7: DataList1_DeleteCommand
protected void DataList1_DeleteCommand(object source, DataListCommandEventArgs e)
{
string strid = this.DataList1.DataKeys[e.Item.ItemIndex].ToString(); //获取当前DataList控件列
string strSql = "Delete from tb_Reply where ID='" + Convert.ToInt32(strid) + "'";
dbObj.ExecNonQuery(dbObj.GetCommandStr(strSql));
Page.Response.Redirect("LeaveWordView.aspx?ID=" + Request["ID"].ToString() + "");
}
开发者ID:kinggod,项目名称:21SourceCode,代码行数:7,代码来源:LeaveWordView.aspx.cs
示例8: dlTourProduct_ItemCommand
protected void dlTourProduct_ItemCommand(object source, DataListCommandEventArgs e)
{
int index = 0;//e.Item.ItemIndex + PageNumber1.PageSize * PageNumber1.CurrentPageIndex;
Label lkTourName = (Label)e.Item.FindControl("lblTourName");
for (int i = 0; i < tourMerchandise.Items.Count; i++)
{
TourMaterial tm = (TourMaterial)tourMerchandise.Items[i];
if (tm.Profile.Name.Equals(lkTourName.Text))
{
index = i;
break;
}
}
if (e.CommandName == "Select")
{
TourSearchCondition tourSearchCondition = (TourSearchCondition)Utility.Transaction.CurrentSearchConditions;
tourSearchCondition.Counrty = ((Terms.Product.Business.MVTourProfile)((TourMaterial)tourMerchandise.Items[index]).Profile).StartCity.Country.Code;
tourSearchCondition.City = ((Terms.Product.Business.MVTourProfile)((TourMaterial)tourMerchandise.Items[index]).Profile).StartCity.Code;
tourSearchCondition.DeptCity = ((Terms.Product.Business.MVTourProfile)((TourMaterial)tourMerchandise.Items[index]).Profile).DefaultDepartureCity.Code;
this.Transaction.IntKey = tourSearchCondition.GetHashCode();
this.Transaction.CurrentSearchConditions = tourSearchCondition;
this.Response.Redirect("TourSelectTourForm.aspx?ReturnURL=TourSearchResultForm.aspx");
}
}
开发者ID:foxvirtuous,项目名称:MVB2C,代码行数:25,代码来源:TourSearchResultForm.aspx.cs
示例9: DataList1_DeleteCommand
protected void DataList1_DeleteCommand(object source, DataListCommandEventArgs e)
{
SqlDataSource3.DeleteParameters["code"].DefaultValue = DataList1.DataKeys[e.Item.ItemIndex].ToString();
SqlDataSource3.Delete();
DataList1.DataBind();
DropDownList2.DataBind();
}
开发者ID:hpie,项目名称:hpie,代码行数:7,代码来源:AttendanceSheet.aspx.cs
示例10: DlNewGoods_UpdateCommand
protected void DlNewGoods_UpdateCommand(object source, DataListCommandEventArgs e)
{
//*** CategoryID ***//
Label lblCateID = (Label)(e.Item.FindControl("lblCateID"));
//*** Category ***//
TextBox txtCategory = (TextBox)(e.Item.FindControl("txtCategory"));
strSQL = "UPDATE category SET CategoryName = '" + txtCategory.Text + "' " +
" WHERE CategoryID = " + lblCateID.Text + " ";
objCmd = new MySqlCommand(strSQL, objConn);
objCmd.ExecuteNonQuery();
//*** If Select File Upload ***//
HtmlInputFile filPicture = (HtmlInputFile)(e.Item.FindControl("filPicture"));
String strFileName;
if (filPicture.PostedFile.FileName != "")
{
strFileName = System.IO.Path.GetFileName(filPicture.Value);
filPicture.PostedFile.SaveAs(Server.MapPath("images/" + strFileName));
strSQL = "UPDATE category SET Picture = 'images/" + strFileName + "' " +
" WHERE CategoryID = " + lblCateID.Text + " ";
objCmd = new MySqlCommand(strSQL, objConn);
objCmd.ExecuteNonQuery();
}
DlNewGoods.EditItemIndex = -1;
BindData();
}
开发者ID:linbirg,项目名称:xiaoyaonv,代码行数:28,代码来源:About.aspx.cs
示例11: AddShopCart
public void AddShopCart(DataListCommandEventArgs e, DataList DLName)
{
if (Session["UID"] != null)
{
SaveSubGoodsClass Goods = null;
Goods = GetSubGoodsInformation(e, DLName);
if (Goods == null)
{
//Show wrong information
Response.Write("<script>alert('No useful data');</script>");
return;
}
else
{
ucObj.AddShopCart(Goods.GoodsID, Goods.MemberPrice, Convert.ToInt32(Session["UID"].ToString()), Goods.GoodsWeight);
Response.Write("<script>alert('Congratulations! Add Item Successfully!')</script>");
}
}
else
{
Response.Write("<script>alert('Please Log in First!');</script>");
}
}
开发者ID:znie0227,项目名称:E-Commerce-Database-Management-System,代码行数:25,代码来源:RHDGoods.aspx.cs
示例12: EP
EP ep = new EP(); //实例化对象
#endregion Fields
#region Methods
protected void DlLeibie_UpdateCommand(object source, DataListCommandEventArgs e)
{
//声明一个string类型的变量id,并且将主键的值赋值给id
string id = this.DlLeibie.DataKeys[e.Item.ItemIndex].ToString();
//跳转到softleibie.aspx页面中,并将id的值传递到softleibie.aspx页面中去
Response.Redirect("softleibie.aspx?id=" + id + "");
}
开发者ID:kinggod,项目名称:21SourceCode,代码行数:13,代码来源:list_softdownload.aspx.cs
示例13: listPending_ItemCommand
public void listPending_ItemCommand(object sender, DataListCommandEventArgs e)
{
switch (e.CommandName)
{
case "Accept":
{
int id = int.Parse(e.CommandArgument.ToString());
SessionManager.SocialService.AcceptAccountFriendRequest(SessionManager.Ticket, id, inputReason.Text);
GetData(sender, e);
ReportInfo("Friend request accepted." +
(string.IsNullOrEmpty(inputReason.Text) ? string.Empty : " An e-mail was sent."));
break;
}
case "Reject":
{
int id = int.Parse(e.CommandArgument.ToString());
SessionManager.SocialService.RejectAccountFriendRequest(SessionManager.Ticket, id, inputReason.Text);
GetData(sender, e);
ReportInfo("Friend request rejected." +
(string.IsNullOrEmpty(inputReason.Text) ? string.Empty : " An e-mail was sent."));
break;
}
}
SessionManager.InvalidateCache<TransitAccountFriendRequest>();
}
开发者ID:dblock,项目名称:sncore,代码行数:26,代码来源:AccountFriendRequestsManage.aspx.cs
示例14: DataList1_DeleteCommand
protected void DataList1_DeleteCommand(object source, DataListCommandEventArgs e)
{
if (CartView.Table.Rows.Count > e.Item.ItemIndex)
CartView.Table.Rows.RemoveAt(e.Item.ItemIndex);
BindList();
}
开发者ID:Musasthl,项目名称:gaols,代码行数:7,代码来源:CartControl.ascx.cs
示例15: subUpDel
protected void subUpDel(object sender, DataListCommandEventArgs e)
{
switch (e.CommandName)
{
case "Update":
TextBox txtTitle = (TextBox)e.Item.FindControl("txt_titleU");
TextBox txtLocation = (TextBox)e.Item.FindControl("txt_locationU");
TextBox txtDate = (TextBox)e.Item.FindControl("txt_dateU");
TextBox txtDepartment = (TextBox)e.Item.FindControl("txt_departmentU");
TextBox txtShift = (TextBox)e.Item.FindControl("txt_shiftU");
TextBox txtHours = (TextBox)e.Item.FindControl("txt_hoursU");
TextBox txtDescription = (TextBox)e.Item.FindControl("txt_descriptionU");
TextBox txtWage = (TextBox)e.Item.FindControl("txt_wageU");
HiddenField hdfID = (HiddenField)e.Item.FindControl("hdf_id");
int postID = int.Parse(hdfID.Value.ToString());
_strMessage(objLinq.commitUpdate(postID, txtTitle.Text, txtLocation.Text, txtDate.Text, txtDepartment.Text, txtShift.Text, txtHours.Text, txtDescription.Text, decimal.Parse(txtWage.Text.ToString())), "update");
_subRebind();
break;
case "Delete":
int _id = int.Parse(((HiddenField)e.Item.FindControl("hdf_id")).Value);
_strMessage(objLinq.commitDelete(_id), "delete");
_subRebind();
break;
case "Cancel":
_subRebind();
break;
}
}
开发者ID:CurtisHeaslip,项目名称:ndhproject,代码行数:28,代码来源:careersAdmin.aspx.cs
示例16: dlCities_UpdateCommand
protected void dlCities_UpdateCommand(object source, DataListCommandEventArgs e)
{
BusinessLogic.AdminBL objBusinesslogic = new BusinessLogic.AdminBL();
DataModel.AdminDM objDataModel = new DataModel.AdminDM();
TextBox txtCityId = (TextBox)e.Item.FindControl("txtCityId");
TextBox txtCityName = (TextBox)e.Item.FindControl("txtCityName");
objDataModel._id =Convert.ToInt16( dlCities.DataKeys[e.Item.ItemIndex]);
objDataModel._cityId = txtCityId.Text.Trim();
objDataModel._cityName = txtCityName.Text.Trim();
if (Convert.ToBoolean(objBusinesslogic.UpdateCity(objDataModel)))
{
dlCities.EditItemIndex = -1;
lblErrorMessage.Text = "Updated Succesfully";
lblErrorMessage.ForeColor = System.Drawing.Color.Green;
Bindcities();
}
else
{
lblErrorMessage.Text = "cannot update city";
lblErrorMessage.ForeColor = System.Drawing.Color.Green;
}
}
开发者ID:CaesaRBur,项目名称:WebProject,代码行数:25,代码来源:frmAddCity.aspx.cs
示例17: DataList1_ItemCommand
protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
{
switch (e.CommandName)
{
case "first": pds1.CurrentPageIndex = 0;
BindDataList(pds1.CurrentPageIndex, pds2.CurrentPageIndex);
break;
case "last": pds1.CurrentPageIndex = pds1.PageCount - 1;
BindDataList(pds1.CurrentPageIndex, pds2.CurrentPageIndex);
break;
case "pre": pds1.CurrentPageIndex = pds1.CurrentPageIndex - 1;
BindDataList(pds1.CurrentPageIndex, pds2.CurrentPageIndex);
break;
case "next": pds1.CurrentPageIndex = pds1.CurrentPageIndex + 1;
BindDataList(pds1.CurrentPageIndex, pds2.CurrentPageIndex);
break;
case "search":
if (e.Item.ItemType == ListItemType.Footer)
{
int pageCount = int.Parse(pds1.PageCount.ToString());
TextBox txtpage = e.Item.FindControl("txtPage") as TextBox;
int myPageNum = 0;
if (!txtpage.Text.Equals(""))
{
myPageNum = Convert.ToInt32(txtpage.Text.ToString());
if (myPageNum <= 0 || myPageNum > pageCount)
{
Response.Write("<Script>alert('请重新输入页码!')</Script>");
}
else BindDataList((myPageNum - 1), pds2.CurrentPageIndex);
}
}
break;
}
}
开发者ID:zjplus,项目名称:phoneSys,代码行数:35,代码来源:Estimate.aspx.cs
示例18: dlList_ItemCommand
protected void dlList_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "breaker")
{
BreakerModel breakerModel = new BreakerModel();
breakerModel.UserIP = e.CommandArgument.ToString();
if (BreakerManager.GetInstance().InsertBreaker(breakerModel) == -1)
{
Umc.Core.Util.Utility.JS_Alert(this, BreakerConst.MESSAGE_BREAKER_ALREADY_INSERT);
}
else
{
Umc.Core.Util.Utility.JS_Alert(this, BreakerConst.MESSAGE_BREAKER_INSERT);
}
}
else if (e.CommandName == "unbreaker")
{
if (BreakerManager.GetInstance().RemoveBreaker(e.CommandArgument.ToString()))
{
Umc.Core.Util.Utility.JS_Alert(this, BreakerConst.MESSAGE_BREAKER_REMOVE);
}
else
{
Umc.Core.Util.Utility.JS_Alert(this, BreakerConst.MESSAGE_BREAKER_CAN_NOT_REMOVE);
}
}
bind();
}
开发者ID:powerumc,项目名称:AspNet-Blog,代码行数:29,代码来源:ConnectionLogList.ascx.cs
示例19: gridManage_ItemCommand
public void gridManage_ItemCommand(object source, DataListCommandEventArgs e)
{
int id = int.Parse(e.CommandArgument.ToString());
switch (e.CommandName)
{
case "Delete":
SessionManager.Delete<TransitAccountStoryPicture>(id, SessionManager.StoryService.DeleteAccountStoryPicture);
ReportInfo("Image deleted.");
GetImagesData(source, e);
break;
case "Up":
SessionManager.StoryService.MoveAccountStoryPicture(SessionManager.Ticket, id, -1);
GetImagesData(source, e);
break;
case "Down":
SessionManager.StoryService.MoveAccountStoryPicture(SessionManager.Ticket, id, 1);
GetImagesData(source, e);
break;
case "Insert":
inputSummary.Content = inputSummary.Content +
string.Format("<P><IMG SRC=\"AccountStoryPicture.aspx?id={0}\" WIDTH=\"250\" /></P>", id);
break;
}
}
开发者ID:dblock,项目名称:sncore,代码行数:25,代码来源:AccountStoryEdit.aspx.cs
示例20: AddShopCart
/// <summary>
/// 向购物车中添加新商品
/// </summary>
/// <param name="e">
/// 获取或设置可选参数,
/// 该参数与关联的 CommandName
/// 一起被传递到 Command 事件。
/// </param>
public void AddShopCart(DataListCommandEventArgs e)
{
//if (Session["UserName"] == null)
//{
// Response.Redirect("Default.aspx");
//}
/*判断是否登录*/
ST_check_Login();
Hashtable hashCar;
if (Session["ShopCart"] == null)
{
//如果用户没有分配购物车
hashCar = new Hashtable(); //新生成一个
hashCar.Add(e.CommandArgument, 1); //添加一个商品
Session["ShopCart"] = hashCar; //分配给用户
}
else
{
//用户已经有购物车
hashCar = (Hashtable)Session["ShopCart"];//得到购物车的hash表
if (hashCar.Contains(e.CommandArgument))//购物车中已有此商品,商品数量加1
{
int count = Convert.ToInt32(hashCar[e.CommandArgument].ToString());//得到该商品的数量
hashCar[e.CommandArgument] = (count + 1);//商品数量加1
}
else
hashCar.Add(e.CommandArgument, 1);//如果没有此商品,则新添加一个项
}
}
开发者ID:kinggod,项目名称:21SourceCode,代码行数:37,代码来源:Default.aspx.cs
注:本文中的DataListCommandEventArgs类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论