本文整理汇总了C#中Ticket.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# Ticket.GetType方法的具体用法?C# Ticket.GetType怎么用?C# Ticket.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ticket
的用法示例。
在下文中一共展示了Ticket.GetType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RadGrid1_ItemDataBound
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
if (e.Item is GridCommandItem)
{
ImageButton imgb = (ImageButton)e.Item.FindControl("New");
imgb.Visible = per.Create;
if (pat != null)
imgb.OnClientClick = "NewTicketRecordInTab();";
}
if (e.Item is GridDataItem)
{
ImageButton imgb = null;
string name = "";
string command = "";
GridDataItem gdi;
string id = "";
ArrayList selectedItems;
// assign javascript function to select button
imgb = (ImageButton)e.Item.FindControl("Select");
gdi = (GridDataItem)e.Item;
// payed?
if (Session["selectedItems"] == null)
{
selectedItems = new ArrayList();
}
else
{
selectedItems = (ArrayList)Session["selectedItems"];
}
id = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex][e.Item.OwnerTableView.DataKeyNames[0]].ToString();
if (selectedItems.Contains(id))
{
//e.Item.Selected = true;
gdi.BackColor = Color.LightGreen;
//gdi["Policy.Insurance.Name"].BackColor = Color.LightGreen;
}
else
{
gdi.BackColor = new Color();
//e.Item.Selected = false;
}
//}
//if (e.Item is GridDataItem)
//{
//ImageButton imgb = null;
//string name = "";
//string command = "";
//GridDataItem gdi;
//int id = 0;
//id = (int)e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex][e.Item.OwnerTableView.DataKeyNames[0]];
//// assign javascript function to select button
//imgb = (ImageButton)e.Item.FindControl("Select");
//gdi = (GridDataItem)e.Item;
//// payed?
// backgroud color for primary types
//if (gdi["Checked"].Text == "True")
//{
// //gdi["Policy.Insurance.Name"].BackColor = Color.LightGreen;
// gdi["Policy.Insurance.Name"].BackColor = Color.LightGreen;
//}
name = String.Format("{0} ({1}: {2})",
gdi["Policy.Customer.FullName"].Text,
gdi["Description"].Text,
gdi["Amount"].Text);
command = String.Format("return Selection('{0}','{1}','{2}','{3}','{4}');",
id.ToString(),
gdi["Amount"].Text.Replace("€", ""),
name,
null,
"Ticket");
imgb.OnClientClick = command;
if (type != "S")
imgb.Visible = false; // not called from another form
// assign javascript function to edit button
imgb = (ImageButton)e.Item.FindControl("Edit");
//if (pat == null)
// command = String.Format("return EditTicketRecord({0});", id);
//else
// command = String.Format("return EditTicketRecordInTab({0});", id);
tck = CntAriCli.GetTicket(int.Parse(id), ctx);
if (tck.GetType() == typeof(AnestheticTicket))
{
command = String.Format("EditAnestheticTicketRecord({0})", id); // general ticket grid
}
else
{
command = String.Format("EditTicketRecord({0})", id); // general ticket grid
}
imgb.OnClientClick = command;
// assigning javascript functions to delete button
imgb = (ImageButton)e.Item.FindControl("Delete");
//.........这里部分代码省略.........
示例2: RadGrid1_ItemCommand
protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
{
string command = "";
// weonly process commands with a datasource (our image buttons)
if (e.CommandSource == null)
return;
string typeOfControl = e.CommandSource.GetType().ToString();
if (typeOfControl.Equals("System.Web.UI.WebControls.ImageButton"))
{
int id = 0;
ImageButton imgb = (ImageButton)e.CommandSource;
if (imgb.ID != "New" && imgb.ID != "Exit" && imgb.ID != "NewAnesthetic")
id = (int)e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex][e.Item.OwnerTableView.DataKeyNames[0]];
switch (imgb.ID)
{
case "Select":
break;
case "Edit":
// new tratement (now there's more that one ticket's kind)
tck = CntAriCli.GetTicket(id, ctx);
if (tck.GetType() == typeof(AnestheticTicket))
{
if (cus == null)
{
if (asn == null)
command = String.Format("EditAnestheticTicketRecord({0})", id); // general ticket grid
else
// asn have only anesthetic tickets
command = String.Format("EditAnestheticTicketRecordServiceNote({0},{1})"
, asn.AnestheticServiceNoteId
, id);
}
else
command = String.Format("EditAnestheticTicketRecordInTab({0})", id); // inside tabstrip
}
else
{
// normal ticket
if (cus == null)
{
if (sn == null)
command = String.Format("EditTicketRecord({0})", id); // general ticket grid
else
command = String.Format("EditTicketRecordServiceNote({0},{1})"
, sn.ServiceNoteId
, id);
}
else
command = String.Format("EditTicketRecordInTab({0})", id); // inside tabstrip
}
RadAjaxManager1.ResponseScripts.Add(command);
break;
case "Delete":
Session["DeleteId"] = id;
string message = Resources.GeneralResource.DeleteRecordQuestion;
GridDataItem gdi = (GridDataItem)e.Item;
message = String.Format("{0}<br/>{1}: {2}", message, gdi["Description"].Text, gdi["Amount"].Text);
command = String.Format("ariDialog('{0}','{1}','prompt',null,0,0)"
, Resources.GeneralResource.Question
, message);
RadAjaxManager1.ResponseScripts.Add(command);
break;
}
}
}