public void AddTicket(Tickets t) { TaskFile tf = new TaskFile(); EnhancementFile ef = new EnhancementFile(); int i = new[] { tf.GetMaxTaskID(), ef.GetMaxEnhID(), GetMaxTicketID() }.Max() + 1; StreamWriter sw = new StreamWriter(filePath, append: true); sw.WriteLine($"\n{i},{t.summary},{t.status},{t.priority},{t.submitter},{t.assigned},{t.watchrgoup},{t.severity}"); Ticket.Add(t); sw.Close(); //try //{ // //first generate movie id // t.recordID = Ticket.Max(m => m.recordID) + 1; // StreamWriter sw = new StreamWriter(filePath); // sw.WriteLine($"\n{t.recordID},{t.summary},{t.status},{t.priority},{t.submitter},{t.assigned},{t.watchrgoup},{t.severity}"); // sw.Close(); // Ticket.Add(t); // logger.Info("Ticket id {Id} added", t.recordID); //}t.recordID, t.summary, t.status, t.priority, t.submitter, t.assigned, t.watchrgoup, t.severity); //catch (Exception ex) //{ // logger.Error(ex.Message); //} }
public override void Execute() { int id = LimitedIntDialog.Instance().Read("Código", 1000); int units = LimitedIntDialog.Instance().Read("Unidades", 1000); Ticket.Add(new SaleLine(id, units)); }
public override void Execute() { int max = Ticket.Lines(); int line = LimitedIntDialog.Instance().Read("Línea? ", max); Ticket.Add(new RepetitionLine(line)); }
/// <summary> /// This is the last call in the end-of-day report /// </summary> public static void SetOrderIdOffset() { Ticket ticket = Ticket.Add(TicketType.EndOfDayDummyTicket, 0, 0, 0, 0); int offsetId = Ticket.GetHighestTicketId(ticket.PrimaryKey.Year); Ticket.Delete(ticket.PrimaryKey); SettingManager.SetStoreSetting("DailyIdOffset", offsetId); }
/// <summary> /// Add a new entry to the Ticket table /// </summary> public static Ticket Add(TicketType type, int partyId, int seatingId, int employeeId, int customerId) { Ticket newTicket = Ticket.Add(type, partyId, seatingId, employeeId, customerId); Tickets.Add(newTicket.PrimaryKey, newTicket); return(newTicket); }
private static Ticket CsvLine2Ticket(string line) { var list = new Ticket(); var nmbs = line.Split(","); foreach (var nmb in nmbs) { list.Add(int.Parse(nmb)); } return(list); }
/// <summary> /// Read the ticket info, and return the ticket /// values ordered by the rules. /// </summary> /// <param name="path">The input path.</param> /// <returns>The ordered ticket.</returns> public Ticket GetExample2(String path) { var ticketInfo = ReadTicketInfo(path); var rulesForColumn = GetRulesForColumns(ticketInfo); var orderedTicket = new Ticket(); for (int i = 0; i < ticketInfo.Rules.Count; ++i) { var column = rulesForColumn.IndexOf(i); orderedTicket.Add(ticketInfo.Tickets[0][column]); } return(orderedTicket); }
private void AddTicket() { Milestone[] milestones = Project.GetMilestones(mContext); if (milestones.Length == 0) { MessageBox.Show( Resources.String_PleaseAddAMilestoneBeforeAddingATicket, Resources.String_Error, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, FormUtil.GetMessageBoxOptions(this)); tabControl.SelectedTab = milestonesTabPage; return; } using (var form = new TicketDetailsForm(mContext, FormUtil.GetFontContext(), FormUtil.GetFormatter(), Project, null)) { if (form.ShowDialog() != DialogResult.OK) { return; } Ticket ticket = form.RetrieveTicket(); // Add. ticket.Add(mContext); // Flush. mContext.Flush(); // Create ticket history entry. TicketHistory ticketHistory = ticket.NewHistory(Resources.String_TicketCreated); ticketHistory.Add(mContext); // Show tickets. ShowTickets(); FormUtil.SelectNew(ticketsListView, ticket); UpdateButtonsEnabledProperty(); ticketsListView.Focus(); UpdateTicket(true); } }
public ActionResult New(string subject, string message, string periority) { ViewBag.Title = "ارسال تیکت جدید"; Ticket tk = new Ticket(); try { tk.CreateDate = DateTime.Now; tk.CustomerId = long.Parse(Session["customer_id"].ToString()); tk.Priority = int.Parse(periority); tk.Status = 1; tk.StatusDate = DateTime.Now; tk.Subject = subject; tk.Add(); TicketContent tkc = new TicketContent(); tkc.Content = message; tkc.CustomerId = long.Parse(Session["customer_id"].ToString()); tkc.RegisterDate = DateTime.Now; tkc.TicketId = tk.Id; tkc.Add(); return(RedirectToAction("Index", "Ticket")); } catch (Exception ex) { ErrorLog log = new ErrorLog(); log.Description = ex.Message; if (ex.InnerException != null) { log.Description += ";" + ex.Message; } log.ErrorDate = DateTime.Now; log.Add(); } return(View(tk)); }