本文整理汇总了C#中System.Web.UI.WebControls.ListViewCommandEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ListViewCommandEventArgs类的具体用法?C# ListViewCommandEventArgs怎么用?C# ListViewCommandEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ListViewCommandEventArgs类属于System.Web.UI.WebControls命名空间,在下文中一共展示了ListViewCommandEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GhostCastSessionList_ItemCommand
private void GhostCastSessionList_ItemCommand(object sender, ListViewCommandEventArgs e)
{
Agent.GhostCastManagerClient gcmc = new Agent.GhostCastManagerClient();
switch (e.CommandName)
{
case "Clients":
{
GridView list = (GridView)e.Item.FindControl("ConnectedClientsGridView");
list.Visible = true;
break;
}
case "Send":
{
Status.Text = gcmc.SendGhostCastSession(Convert.ToInt32(e.CommandArgument));
this.ViewState["ClientListVisible"] = null;
break;
}
case "Close":
{
Status.Text = gcmc.CloseGhostCastSession(Convert.ToInt32(e.CommandArgument));
RefreshSessions(false);
this.ViewState["ClientListVisible"] = null;
break;
}
}
}
示例2: lvItems_ItemCommand
protected void lvItems_ItemCommand(object sender, ListViewCommandEventArgs e)
{
Literal ltItemID = (Literal)e.Item.FindControl("ltItemID");
TextBox txtQty = (TextBox)e.Item.FindControl("txtQty");
double price = GetPrice(ltItemID.Text);
bool existingItem = IsExisting(ltItemID.Text);
if (e.CommandName == "additem")
{
con.Open();
SqlCommand com = new SqlCommand();
com.Connection = con;
if (existingItem)
{
com.CommandText = "UPDATE OrderDetails SET Quantity= Quantity + @Quantity " +
"WHERE OrderID=0 AND [email protected] AND [email protected]";
}
else
{
com.CommandText = "INSERT INTO OrderDetails VALUES (@OrderID, @UserID, @ItemID, " +
"@Quantity, @Remarks, @Status)";
}
com.Parameters.AddWithValue("@OrderID", 0);
com.Parameters.AddWithValue("@ItemID", ltItemID.Text);
com.Parameters.AddWithValue("@UserID", Session["userid"].ToString());
com.Parameters.AddWithValue("@Quantity", txtQty.Text);
com.Parameters.AddWithValue("@Remarks", DBNull.Value);
com.Parameters.AddWithValue("@Status", "In Cart");
com.ExecuteNonQuery();
con.Close();
Response.Redirect(Request.Url.AbsoluteUri);
}
}
示例3: ListView1_ItemCommand
//一般登入
protected void ListView1_ItemCommand(object sender, ListViewCommandEventArgs e)
{
if (e.CommandName == "login")
{
string[] commandArgs = e.CommandArgument.ToString().Split(new char[] { ',' });
NTPCLibrary.User user = LoginUser;
List<Department> departments = new List<Department>()
{
new Department()
{
ID = commandArgs[0],
Name = commandArgs[1],
Groups = new List<string>()
{
commandArgs[2]
}
}
};
user.Departments = departments;
//設user cookie
Util.SetCookie<NTPCLibrary.User>(Util.OPENID_SELECT_USER_COOKIE, user);
//清除role cookie
//Util.CleanCookie(Util.OPENID_ROLE_COOKIE);
Util.SetCookie(Util.OPENID_ROLE_COOKIE, "0");
//重導
Response.Redirect(rd);
}
}
示例4: lvCursos_ItemCommand
protected void lvCursos_ItemCommand(object sender, ListViewCommandEventArgs e)
{
var idCurso = Int32.Parse((String)e.CommandArgument);
var curso = _CursoService.GetCurso(idCurso);
var empleado = _EmpleadoService.GetEmpleado(curso.EmpleadoId);
var inscripcion = Cache.Get("inscripcion") as Inscripcion;
var existe = inscripcion.Cursos.Any(d => d.Id.Equals(idCurso));
if (!existe)
{
lblMensajeCurso.Text = "";
lblMensajeCurso.Visible = false;
lblDetalles.Text = "Detalles";
lblDetalles.Visible = true;
curso.Empleado = empleado;
inscripcion.Cursos.Add(curso);
/*recalculo los totales despues de agregar*/
CalcularTotales(inscripcion);
lvDetallesCursos.DataSource = inscripcion.Cursos;
lvDetallesCursos.DataBind();
Cache.Insert("inscripcion", inscripcion);
}
else
{
lblMensajeCurso.Text = "Ese curso ya ha sido agregado";
lblMensajeCurso.Visible = true;
}
}
示例5: ListView1_ItemCommand
protected void ListView1_ItemCommand(object sender, ListViewCommandEventArgs e)
{
if (e.CommandName == "Cancel")
{
Response.Redirect("~/Client/clientaccount.aspx");
}
}
示例6: ListViewShowThreePolls_ItemCommand
protected void ListViewShowThreePolls_ItemCommand(object sender, ListViewCommandEventArgs e)
{
ListViewItem lvi = e.Item;
Button btn = (Button)lvi.FindControl("VoteButton");
var commandArg = btn.CommandArgument.ToString();
int pollID = int.Parse(commandArg);
if (e.CommandName == "Vote")
{
RadioButtonList rbl = (RadioButtonList)lvi.FindControl("RadioButtonListShowingAnswers");
var answerIDStr = rbl.SelectedValue;
if (answerIDStr != "")
{
int answerID = int.Parse(answerIDStr);
PollsDAL.VoteForPoll(answerID);
Response.Redirect("Voting.aspx?pollId=" + pollID);
}
}
else if (e.CommandName == "Reset")
{
Response.Redirect("Voting.aspx?reset=true&pollId=" + pollID);
}
else if (e.CommandName == "Delete")
{
PollsDAL.DeletePoll(pollID);
Response.Redirect("Polls.aspx");
}
}
示例7: lvMsgList_OnItemCommand
protected void lvMsgList_OnItemCommand(object sender, ListViewCommandEventArgs e)
{
switch (e.CommandName)
{
case "EditMsg":
int nextMsg = e.Item.DataItemIndex;
SaveProfMsg(int.Parse(hfCurMsg.Value));
LoadProfMsg(nextMsg);
break;
case "DelMsg":
int curMsgIndex = int.Parse(hfCurMsg.Value);
SaveProfMsg(curMsgIndex);
DelProfMsg(e.Item.DataItemIndex);
LoadProfMsg(0);
break;
case "AddMsg":
if (profMsg.Count < 8)
{
SaveProfMsg(int.Parse(hfCurMsg.Value));
profMsg.Add(new WxMsg());
LoadProfMsg(profMsg.Count - 1);
}
else
{
warnMsg.Text = "最多只能同时发8条图文消息!";
}
break;
case "SendMsg":
SaveProfMsg(int.Parse(hfCurMsg.Value));
BindProfMsg();
SendProfMsg();
break;
}
}
示例8: lstSepet_ItemCommand
protected void lstSepet_ItemCommand(object sender, ListViewCommandEventArgs e)
{
if (e.CommandName == "UrunCikar")
{
}
}
示例9: ListView1_ItemCommand
protected void ListView1_ItemCommand(object sender, ListViewCommandEventArgs e)
{
try
{
if (e.CommandName == "ExpressInterest")
{
if (Session["UserId"] != null)
{
ListViewDataItem Edit = (ListViewDataItem)e.Item;
//lblreceiverId.Text = Convert.ToString(ListViewCommentsDetails.DataKeys[Edit.DisplayIndex].Value.ToString());
// PanelExpressInterest.Visible = true;
// ModalPopupInterest.Show();
}
else
{
Response.Redirect("Default.aspx");
}
}
}
catch
{
}
}
示例10: ComprasListView_ItemCommand
protected void ComprasListView_ItemCommand(object sender, ListViewCommandEventArgs e)
{
if (Session["Usuario"] == null)
{
Server.Transfer("ReservaNoRegistrado.aspx");
}
else
{
ventas.Matricula = e.CommandArgument.ToString();
ventas.ObtenerDatosVehiculos();
ventas.Reservado = 1;
ventas.EditarVentas();
ComprasMultiView.ActiveViewIndex = 0;
Session["MailSubject"] = "Reserva de compra de: " + Session["email"].ToString();
Session["MailBody"] = "Nombre y apellidos: " + Session["nombre"].ToString() + " " + Session["apellidos"].ToString()
+ "\n\n Este cliente ha realizado una reserva del coche: \n Matrícula: " + ventas.Matricula + "\n Modelo: " + ventas.Marca + " " + ventas.Modelo
+ "\n KM: " + ventas.KM.ToString() + "\n Precio: " + ventas.PrecioVenta + "\n Garantía: " + ventas.Garantia;
Session["MailUser"] = Session["email"].ToString();
Session["MailUserSubject"] = "La reserva se ha realizado con éxito.";
Session["MailUserBody"] = "Has realizado una reserva del coche: \n Matrícula: " + ventas.Matricula + "\n Modelo: " + ventas.Marca + " " + ventas.Modelo
+ "\n KM: " + ventas.KM.ToString() + "\n Precio: " + ventas.PrecioVenta + "\n Garantía: " + ventas.Garantia
+ "\n\n Tiene reservado este coche durante 3 días. Pase por nuestras oficinas para tomar todos los datos necesarios y completar la compra.";
Session["MailUrl"] = HttpContext.Current.Request.Url.ToString();
Response.Redirect("EnviarMail.aspx");
}
}
示例11: showFullStatement
protected void showFullStatement(object sender, ListViewCommandEventArgs e)
{
string[] emailList;
nEmailHandler emailer = new nEmailHandler();
//grab full list of emails
ISession session = DatabaseEntities.NHibernateHelper.CreateSessionFactory().OpenSession();
List<DatabaseEntities.User> userList = DatabaseEntities.User.GetAllUsers(session);
string[] data = e.CommandArgument.ToString().Split(new char[] { '%' });
if (String.Equals(e.CommandName, "remove"))
{
dbLogic.updateEligible(data[0], "0");
LabelFeedback.Text = "User successfully removed from the current ballot. Email sent to ALL users alerting them of this action.";
emailer.sendRemoveFromBallot(userList, GetName(Convert.ToInt32(data[1])));
}
else if (String.Equals(e.CommandName, "add"))
{
dbLogic.updateEligible(data[0], "1");
LabelFeedback.Text = "User successfully placed back on the current ballot. Email sent to ALL users alerting them of this action.";
emailer.sendReAddToBallot(userList, GetName(Convert.ToInt32(data[1])));
}
dbLogic.selectInfoForApprovalTable();
DataSet emailSet = dbLogic.getResults();
ListViewApproval.DataSource = emailSet;
ListViewApproval.DataBind();
loadApprovalInfo();
}
示例12: sendReply
protected void sendReply(ListViewCommandEventArgs e)
{
Label email = (Label)e.Item.FindControl("lbl_emailV");
TextBox message = (TextBox)e.Item.FindControl("txt_msgR");
TextBox subject = (TextBox)e.Item.FindControl("txt_subR");
objSendMail.sendEMail(email.Text, "<div><a href='www.brdhchumber.com'><img src='www.brdhchumber.com/images/mailHeader.jpg' /></a><br /><br/>" + message.Text, "(Blind River District Health Centre) " + subject.Text, true);
}
示例13: subupdel
protected void subupdel(object sender, ListViewCommandEventArgs e)
{
switch (e.CommandName)
{
case "Update":
TextBox txtfname = (TextBox)e.Item.FindControl("txtfnameU");
TextBox txtlname = (TextBox)e.Item.FindControl("txtlnameU");
DropDownList ddlvolType = (DropDownList)e.Item.FindControl("ddlvoltypeU");
TextBox txtemail = (TextBox)e.Item.FindControl("txtemailU");
TextBox txtcontact = (TextBox)e.Item.FindControl("txtcontactU");
HiddenField hdfID = (HiddenField)e.Item.FindControl("hdf_id");
int volId = int.Parse(hdfID.Value.ToString());
_strMessage(objvolunteer.commitUpdate(volId, txtfname.Text, txtlname.Text, txtemail.Text, txtcontact.Text), "update");
_subRebind();
break;
case "Delete":
int vol_Id = int.Parse(((HiddenField)e.Item.FindControl("hdf_idD")).Value);
_strMessage(objvolunteer.commitDelete(vol_Id), "delete");
_subRebind();
break;
case "Cancel":
_subRebind();
break;
}
}
示例14: ListView_OnItemCommand
protected void ListView_OnItemCommand(object sender, ListViewCommandEventArgs e)
{
// Button name control
if (String.Equals(e.CommandName, "AddButton"))
{
// take button argument and split
string toplam = (string) e.CommandArgument;
string[] top = toplam.Split('/');
double price = Convert.ToDouble(top[0]);
string id = top[1];
// take textbox text
TextBox t = ((TextBox)e.Item.FindControl("TextBox1"));
string number = t.Text;
string quantity = top[2];
// calculate total cost
double totalcost = price * Convert.ToDouble(number);
Label name = ((Label)e.Item.FindControl("nameLabel"));
Session["name"] = name.Text;
// all arguments send with session
Session["number"] += number + "%";
Session["totalcost"] = Convert.ToDouble(Session["totalcost"]) + totalcost;
Session["id"] += id + "%" ;
Session["quantity"] += quantity + "%";
}
}
示例15: lvw_partsItemCommand
protected void lvw_partsItemCommand(object sender, ListViewCommandEventArgs e)
{
try
{
string[] arg = new string[2];
arg = e.CommandArgument.ToString().Split(';');
int id = Convert.ToInt32(arg[0]);
int quantity = Convert.ToInt32(arg[1]);
if (quantity > 0)
{
ShoppingCart.GetInstance().AddItem(id, quantity);
Session["databaseName"] = "Parts";
Response.Redirect("ViewCart.aspx");
}
else
{
lblResult.Text = "That Item is Currently Sold Out!";
}
}
catch(Exception)
{
lblResult.Text = "Couldn't Add Item to Cart!";
}
}