本文整理汇总了C#中Ticket类的典型用法代码示例。如果您正苦于以下问题:C# Ticket类的具体用法?C# Ticket怎么用?C# Ticket使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Ticket类属于命名空间,在下文中一共展示了Ticket类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: TBestellenVM
//Constructor
public TBestellenVM()
{
Holders = Ticket.GetTicketHolders();
TicketTypes = TicketType.GetTicketTypes();
VerkochteTickets = Ticket.GetAmountSoldTickets();
TicketHolder = new Ticket();
}
开发者ID:Neirijnck,项目名称:FestivalProject,代码行数:8,代码来源:TBestellenVM.cs
示例2: UpdateOldTicket
public Ticket UpdateOldTicket(Ticket t)
{
t = Update(t);
entity.SaveChanges();
return t;
}
开发者ID:Kallaen,项目名称:CentexTick,代码行数:7,代码来源:BLLOldTicket.cs
示例3: BuildTestData
private static void BuildTestData()
{
using (var data = new HssTicketingContext())
{
var user = new User() { FirstName = "Nicolai", LastName = "Naglestad", UserName = "nickern", AccessLevel = 1, Password = "123456789" };
data.Users.Add(user);
var user2 = new User() { FirstName = "Ola", LastName = "Nordman", UserName = "test", AccessLevel = 2, Password = "test123" };
data.Users.Add(user2);
var happening = new Happening() { HappeningName = "Neon Party", Location = "Remmen", MaxParticipants = 100};
data.Happenings.Add(happening);
var happening2 = new Happening() { HappeningName = "Test Party", Location = "Fredrikstad", MaxParticipants = 50};
data.Happenings.Add(happening2);
var ticket = new Ticket() { Happening = happening, UniqueId = "123456789", Scanned = true, TimeScanned = new DateTime(2015, 11, 12, 15, 25, 00) };
data.Tickets.Add(ticket);
var ticket2 = new Ticket() { Happening = happening2, UniqueId = "987654321", Scanned = true, TimeScanned = new DateTime(2015, 11, 12, 17, 25, 00) };
data.Tickets.Add(ticket2);
var ticket3 = new Ticket() { Happening = happening, UniqueId = "147258369" };
data.Tickets.Add(ticket3);
var ticket4 = new Ticket() { Happening = happening2, UniqueId = "963852741" };
data.Tickets.Add(ticket4);
data.SaveChanges();
}
}
开发者ID:nickern,项目名称:HSS-Ticketing-.Net,代码行数:27,代码来源:Program.cs
示例4: TicketCloseSendMail
private void TicketCloseSendMail(Category EntCategory, Ticket lastTicket)
{
StringBuilder sbBody = new StringBuilder();
sbBody.AppendLine("<p>");
sbBody.AppendLine("<IMG src=\"Logo.png\"><br/>");
sbBody.AppendFormat("<strong>Ticket No: {0}</strong>", lastTicket.IdTicket);
sbBody.AppendLine("<br/>");
sbBody.AppendFormat("<strong>Cerradp por: {0} el {1:d} </strong>", lastTicket.AssignedTo.UserCompleteName, lastTicket.ClosedOn);
sbBody.AppendLine("<br/>");
sbBody.AppendLine("<strong>Descripción:</strong>");
sbBody.AppendFormat("<i>{0}</i>", lastTicket.Description);
sbBody.AppendLine("<br/>");
sbBody.AppendLine("<strong>Descripción de Cierre:</strong>");
sbBody.AppendFormat("<i>{0}</i>", lastTicket.CloseDescription);
sbBody.AppendLine("<br/>");
sbBody.AppendLine("</p>");
string slImagePath = Server.MapPath(@"~/App_Themes/Default/Images/Logo.png");
MailMessage mail = new MailMessage("[email protected]", EntCategory.DefaultMail);
mail.Attachments.Add(new Attachment(slImagePath));
if (EntCategory.AlternativeMail != "")
mail.To.Add(EntCategory.AlternativeMail);
mail.Subject = "Ticket Cerrado";
mail.Body = sbBody.ToString();
CoreLibrary.CommonUtils.EmailOperations.SendEmail(mail);
}
开发者ID:devxsid69,项目名称:SSky,代码行数:26,代码来源:Close.ascx.cs
示例5: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
//参数判断与处理(考虑用框架处理)
string paramTicketId = Request["Id"];
if (!string.IsNullOrEmpty(paramTicketId))
{
if (int.TryParse(paramTicketId, out ticketId))
{
CurrentTicket = bllTicket.GetTicket(ticketId);
IsNew = false;
}
else
{
ErrHandler.Redirect(ErrType.ParamIllegal);
}
}
if (!IsPostBack)
{
if (!IsNew)
{
LoadForm();
}
}
}
开发者ID:phiree,项目名称:testttt,代码行数:26,代码来源:TicketEdit2.aspx.cs
示例6: Get
/// <summary>
/// Retrieve the details of the Ticket
/// </summary>
/// <param name="ticket"></param>
/// <returns>List of Ticket</returns>
public static List<TicketContenu> Get(Ticket ticket)
{
List<TicketContenu> listTicketContenu = new List<TicketContenu>();
using(SqlConnection db = DbConnexion.connect())
{
string sql = "SELECT NumArticle, QteArticle FROM Ticket_Contenu tc WHERE tc.NumTicket = @NumTicket";
using (SqlCommand req = new SqlCommand(sql, db))
{
req.Parameters.Add(new SqlParameter("NumTicket", ticket.Num));
SqlDataReader row = req.ExecuteReader();
while (row.Read())
{
TicketContenu ticketContenu = new TicketContenu();
ticketContenu.Ticket = ticket;
ticketContenu.Article = ArticleDAO.Get(int.Parse(row["NumArticle"].ToString()));
ticketContenu.Quantite = float.Parse(row["QteArticle"].ToString());
listTicketContenu.Add(ticketContenu);
}
}
}
return listTicketContenu;
}
开发者ID:shambarick,项目名称:Carbouffe,代码行数:32,代码来源:TicketContenuDAO.cs
示例7: Write
public static void Write(XmlWriter writer, Ticket pt)
{
var declarations = NamespaceDeclarations(pt);
writer.WriteStartDocument();
var prefix = declarations.LookupPrefix(Psf.PrintTicket.NamespaceName);
writer.WriteStartElement(prefix, Psf.PrintTicket.LocalName, Psf.PrintTicket.NamespaceName);
writer.WriteAttributeString("version", "1");
foreach (var decl in declarations)
{
writer.WriteAttributeString("xmlns", decl.Prefix, null, decl.Uri.NamespaceName);
}
foreach (var f in pt.Features())
{
Write(writer, f);
}
foreach (var p in pt.Properties())
{
Write(writer, p);
}
foreach (var p in pt.Parameters())
{
Write(writer, p);
}
writer.WriteEndElement();
writer.Flush();
}
开发者ID:kei10in,项目名称:KipSharp,代码行数:32,代码来源:PrintSchemaWriter.cs
示例8: CanCreateUpdateAndDeleteTicketAsync
public void CanCreateUpdateAndDeleteTicketAsync()
{
var ticket = new Ticket()
{
Subject = "my printer is on fire",
Comment = new Comment() { Body = "HELP" },
Priority = TicketPriorities.Urgent
};
ticket.CustomFields = new List<CustomField>()
{
new CustomField()
{
Id = Settings.CustomFieldId,
Value = "Doing fine!"
}
};
var res = api.Tickets.CreateTicketAsync(ticket).Result.Ticket;
Assert.NotNull(res);
Assert.Greater(res.Id.Value, 0);
res.Status = TicketStatus.Solved;
res.AssigneeId = Settings.UserId;
res.CollaboratorEmails = new List<string>() { Settings.ColloboratorEmail };
var body = "got it thanks";
var updateResponse = api.Tickets.UpdateTicketAsync(res, new Comment() { Body = body, Public = true });
Assert.NotNull(updateResponse.Result);
Assert.AreEqual(updateResponse.Result.Audit.Events.First().Body, body);
Assert.True(api.Tickets.DeleteAsync(res.Id.Value).Result);
}
开发者ID:HarounDemor,项目名称:ZendeskApi_v2,代码行数:35,代码来源:TicketTests.cs
示例9: OnSave
private void OnSave(object sender, RoutedEventArgs e)
{
var h = new Hashtable();
var title = m_title.Text;
if (string.IsNullOrEmpty(title))
{
MessageBox.Show("Title must not be empty");
return;
}
var t = new Ticket(App.Base, h)
{
TicketName = Ticket.CreateTicketName(title),
Title = title,
Opened = DateTime.Now,
Assigned = m_assigned.Text,
State=m_status.Text,
};
// add comment if any
if (!string.IsNullOrEmpty(m_comment.Text))
t.Comments.Add(new Comment(m_comment.Text));
// add tags if any
if (!string.IsNullOrEmpty(m_tags.Text))
t.Tags.AddRange(m_tags.Text.Split(','));
t.SaveNew();
//if (TicketSaved != null)
TicketSaved();
//this.Close();
//this.Owner.Focus();
}
开发者ID:henon,项目名称:TicGit.net,代码行数:29,代码来源:NewTicket.xaml.cs
示例10: AddTicket
/// <summary>
/// Добавляет билет в запрос к сервису авторизации доступа.
/// </summary>
/// <param name="article">
/// Код товара-билета.
/// </param>
/// <param name="periodOfValidity">
/// Срок действия билета в днях.
/// </param>
/// <param name="ticketBarcode">
/// Штрихкод билета.
/// </param>
public void AddTicket(string article, int periodOfValidity, string ticketBarcode)
{
if (periodOfValidity < 1)
{
// если срок действия не задан, то по умолчанию он равен одному дню
periodOfValidity = 1;
}
var ticketValidFrom = DateTime.Now;
var ticket = new Ticket
{
TicketTypeInnerId = int.Parse(article),
AcessCode = ticketBarcode,
DTStart = ticketValidFrom,
DTEnd = ticketValidFrom
.AddDays(periodOfValidity - 1)
.Date
.AddDays(1)
.AddTicks(-1),
Details = new TicketDetails
{
DTPurchased = ticketValidFrom,
SerialNumber = ticketBarcode
}
};
tickets.Add(ticket);
}
开发者ID:Dennis-Petrov,项目名称:Cash,代码行数:40,代码来源:TmsClient.cs
示例11: PutTicket
public IHttpActionResult PutTicket(string id, Ticket ticket)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
if (id != ticket.UniqueId)
{
return BadRequest();
}
db.Entry(ticket).State = EntityState.Modified;
try
{
db.SaveChanges();
}
catch (DbUpdateConcurrencyException)
{
if (!TicketExists(id))
{
return NotFound();
}
else
{
throw;
}
}
return StatusCode(HttpStatusCode.NoContent);
}
开发者ID:nickern,项目名称:HSS-Ticketing-.Net,代码行数:32,代码来源:TicketsController.cs
示例12: PostTicket
public IHttpActionResult PostTicket(Ticket ticket)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
var happening = db.Happenings.FirstOrDefault(h => h.HappeningId == ticket.Happening.HappeningId);
ticket.Happening = happening;
db.Tickets.Add(ticket);
try
{
db.SaveChanges();
}
catch (DbUpdateException)
{
if (TicketExists(ticket.UniqueId))
{
return Conflict();
}
else
{
throw;
}
}
return CreatedAtRoute("DefaultApi", new { id = ticket.UniqueId }, ticket);
}
开发者ID:nickern,项目名称:HSS-Ticketing-.Net,代码行数:29,代码来源:TicketsController.cs
示例13: Get
/// <summary>
/// Retrieve the Ticket by the num
/// </summary>
/// <param name="caisse"></param>
/// <returns>Ticket</returns>
public static Ticket Get(int num)
{
Ticket ticket = new Ticket();
using (SqlConnection db = DbConnexion.connect())
{
string sql = "SELECT * FROM Ticket t WHERE t.NumTicket = @NumTicket";
using (SqlCommand req = new SqlCommand(sql, db))
{
req.Parameters.Add(new SqlParameter("NumTicket", num));
SqlDataReader row = req.ExecuteReader();
if (row.Read())
{
ticket.Num = num;
ticket.DateHeure = row.GetDateTime(row.GetOrdinal("DateHeureTicket"));
ticket.TypeReglement = row["TypeReglement"].ToString();
ticket.Contenu = TicketContenuDAO.Get(ticket);
ticket.Caisse = CaisseDAO.Get(int.Parse(row["NumCaisse"].ToString()));
}
}
}
return ticket;
}
开发者ID:shambarick,项目名称:Carbouffe,代码行数:32,代码来源:TicketDAO.cs
示例14: GetTestCases
public static IEnumerable GetTestCases()
{
var drawnTicket = new Ticket
{
Numbers = new List<int> { 44, 45, 46, 47, 48, 49 }, Additional = 17, Super = 9
};
var classEightTicket = new Ticket { Numbers = new List<int> { 4, 5, 6, 47, 48, 49 }, Super = 0 };
yield return new TestCaseData(drawnTicket, classEightTicket).Returns(WinningClasses.VIII);
var classSevenTicket = new Ticket { Numbers = new List<int> { 17, 5, 6, 47, 48, 49 }, Super = 0 };
yield return new TestCaseData(drawnTicket, classSevenTicket).Returns(WinningClasses.VII);
var classSixTicket = new Ticket { Numbers = new List<int> { 4, 5, 46, 47, 48, 49 }, Super = 0 };
yield return new TestCaseData(drawnTicket, classSixTicket).Returns(WinningClasses.VI);
var classFiveTicket = new Ticket { Numbers = new List<int> { 17, 5, 46, 47, 48, 49 }, Super = 0 };
yield return new TestCaseData(drawnTicket, classFiveTicket).Returns(WinningClasses.V);
var classFourTicket = new Ticket { Numbers = new List<int> { 4, 45, 46, 47, 48, 49 }, Super = 0 };
yield return new TestCaseData(drawnTicket, classFourTicket).Returns(WinningClasses.IV);
var classThreeTicket = new Ticket { Numbers = new List<int> { 17, 45, 46, 47, 48, 49 }, Super = 0 };
yield return new TestCaseData(drawnTicket, classThreeTicket).Returns(WinningClasses.III);
var classTwoTicket = new Ticket { Numbers = new List<int> { 44, 45, 46, 47, 48, 49 }, Super = 0 };
yield return new TestCaseData(drawnTicket, classTwoTicket).Returns(WinningClasses.II);
var classOneTicket = new Ticket { Numbers = new List<int> { 44, 45, 46, 47, 48, 49 }, Super = 9 };
yield return new TestCaseData(drawnTicket, classOneTicket).Returns(WinningClasses.I);
}
开发者ID:HerrLoesch,项目名称:Katas,代码行数:31,代码来源:LottoKata.cs
示例15: AddAttachment
public Attachment AddAttachment(int ticketId, string fileName, byte[] data, string comment = null)
{
var text = comment ?? string.Format("Attachment: {0}", fileName);
var uploadResponse = UploadFile<UploadWrapper>(
string.Format("uploads.json?filename={0}", fileName), null,
new Dictionary<string, byte[]> { { fileName, data } });
if (uploadResponse.StatusCode != HttpStatusCode.Created || uploadResponse.Data == null ||
uploadResponse.Data.Upload == null || string.IsNullOrEmpty(uploadResponse.Data.Upload.Token) ||
!uploadResponse.Data.Upload.Attachments.Any())
{
return null;
}
var uploadToken = uploadResponse.Data.Upload.Token;
var ticket = new Ticket
{
Id = ticketId,
Comment = new TicketComment
{
Body = text,
Uploads = new[] { uploadToken }
}
};
return UpdateTicket(ticket) != null ? uploadResponse.Data.Upload.Attachments.First() : null;
}
开发者ID:justinconnell,项目名称:remi,代码行数:27,代码来源:ZendeskRequest.cs
示例16: GetAllTickets
/*Пробуем вытягивать тикеты по-простому
public List<Ticket> GetAllTickets()
{
List<Ticket> list = new List<Ticket>();
var resData = ticketAllAdapters.GetData();
foreach (var data in resData)
{
list.Add(new Ticket(data.tticket_id, data.ticket_name, data.tprice_id, data.);
}
return list;
}*/
//Фильтруем красиво
public List<Ticket> GetSearchedTickets(Ticket searchedTicket)
{
string filter = "";
String price = "";
if (searchedTicket.Price != 0)
filter += "Parent(FK_Ticket_Price).price_name ='" + searchedTicket.Price.ToString() + "' AND ";
filter += "Parent(FK_Ticket_Type).ttype_name Like '%" + searchedTicket.Type + "%' AND " +
"Parent(FK_Ticket_Rate).rrate_name Like '%" + searchedTicket.Rate + "%'";
DataRow[] searchedTickets = this.ticketsDataSet.Ticket.Select(filter);
if (searchedTickets == null)
return null;
List<Ticket> tickets = new List<Ticket>();
foreach (DataRow tmpSearchedTicket in searchedTickets)
{
tickets.Add(
new Ticket(Int32.Parse(tmpSearchedTicket["tticket_id"].ToString()),
tmpSearchedTicket["ticket_name"].ToString(),
Convert.ToInt32(tmpSearchedTicket.GetParentRow("FK_Ticket_Price")["price_name"]),
tmpSearchedTicket.GetParentRow("FK_Ticket_Rate")["rrate_name"].ToString(),
tmpSearchedTicket.GetParentRow("FK_Ticket_Type")["ttype_name"].ToString()));
}
return tickets;
}
开发者ID:AndreyKis,项目名称:TicketsOrderLinqSQL,代码行数:42,代码来源:AccessToTicketsDB(Ticket).cs
示例17: InserirTickets
public void InserirTickets()
{
TicketsDiaria = new List<Ticket>();
TicketsViagem = new List<Ticket>();
foreach (Cidade item in Cidades)
{
var diaria = new Ticket(Tipos[0], item);
var taxi = new Ticket(Tipos[1], item);
var refeicao = new Ticket(Tipos[2], item);
var passagem = new Ticket(Tipos[3], item);
TicketsDiaria.Add(diaria);
TicketsDiaria.Add(taxi);
TicketsDiaria.Add(taxi);
TicketsDiaria.Add(refeicao);
TicketsDiaria.Add(refeicao);
TicketsViagem.Add(passagem);
TicketsViagem.Add(passagem);
TicketsViagem.Add(taxi);
TicketsViagem.Add(taxi);
TicketsViagem.Add(taxi);
TicketsViagem.Add(taxi);
}
}
开发者ID:Workker,项目名称:Orcamento2014,代码行数:26,代码来源:OrcamentoDeViagemTest.cs
示例18: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
string paramScenicId = Request["ScenicId"];
string paramTicketId = Request["ticketId"];
if (!int.TryParse(paramScenicId, out scenicId))
{
BLL.ErrHandler.Redirect(BLL.ErrType.ParamIllegal);
}
Scenic = bllScenic.GetScenicById(scenicId);
int.TryParse(paramTicketId, out ticketId);
isNew = ticketId <= 0;
if (isNew)
{
CurrentTicket = new TicketNormal();
}
else
{
CurrentTicket = bllTicket.GetTicket(ticketId);
}
if (!IsPostBack)
{
BindTickets();
LoadForm();
}
}
开发者ID:phiree,项目名称:testttt,代码行数:30,代码来源:EditTicket.aspx.cs
示例19: PopulatePropertyBagForTicket
private void PopulatePropertyBagForTicket(Ticket ticket)
{
PropertyBag["ticket"] = ticket;
PropertyBag["projects"] = Project.FindAllOrderedByName();
PropertyBag["users"] = User.FindAll();
PropertyBag["types"] = Enum.GetNames(typeof(TicketType));
}
开发者ID:andypike,项目名称:Talks,代码行数:7,代码来源:TicketsController.cs
示例20: Post
// POST api/logout
public HttpResponseMessage Post(Ticket bilet)
{
if (!this.ModelState.IsValid)
{
//tutaj wywala ogolny blad gdy otrzymal zle dane
throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.BadRequest));
}
loginAnswer reply = new loginAnswer { ok = 0, tocken = null };
if (Zapytania.dodajBilet(bilet.name, bilet.price, bilet.date) == true)
{
reply.tocken = "ok";
reply.ok = 0;
}
else
{
reply.tocken = "bad";
reply.ok = 1;
}
HttpResponseMessage response = this.Request.CreateResponse(HttpStatusCode.Created, reply);
return response;
}
开发者ID:Nowaczek,项目名称:AndroidJump,代码行数:26,代码来源:AddTicketKindController.cs
注:本文中的Ticket类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论