Example #1
0
        public void ChangeTicket(string nam, TicketList list)
        {
            Ticket a = null;

            foreach (Ticket t in list.Items)
            {
                if (t.name == nam)
                {
                    a        = t;
                    oldstate = a.mystate;
                    break;
                }
            }
            if (a != null)
            {
                DialogResult dr = Open(a.name, a.assign, a.description, a.created);
                if (dr == DialogResult.OK)
                {
                    list.Items.Remove(a);
                    list.Items.Add(new Ticket(name, des, oldstate, assign, cr));
                }
                if (dr == DialogResult.No)
                {
                    list.Items.Remove(a);
                }
            }
        }
Example #2
0
        void Loading()
        {
            StreamReader sr   = new StreamReader(File.OpenRead(Path.Combine(Application.StartupPath, ".tm")));
            string       Read = sr.ReadToEnd().Replace(Environment.NewLine, String.Empty);;

            sr.Close();
            tickets = FromXML(Read);
        }
Example #3
0
 public string ToXML(TicketList obj)
 {
     using (StringWriter stringWriter = new StringWriter(new StringBuilder()))
     {
         XmlSerializer xmlSerializer = new XmlSerializer(typeof(TicketList));
         xmlSerializer.Serialize(stringWriter, obj);
         return(stringWriter.ToString());
     }
 }