本文整理汇总了C#中DataListCommandEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# DataListCommandEventArgs类的具体用法?C# DataListCommandEventArgs怎么用?C# DataListCommandEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataListCommandEventArgs类属于命名空间,在下文中一共展示了DataListCommandEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: dlCategory_ItemCommand
protected void dlCategory_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "select")
{
Response.Redirect("goodsList.aspx?id=" + e.CommandArgument);
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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页面中
}
}
示例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);
}
}
}
}
示例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() + "");
}
示例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");
}
}
示例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();
}
示例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();
}
示例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>");
}
}
示例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 + "");
}
示例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>();
}
示例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();
}
示例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;
}
}