Ejemplo n.º 1
0
 public Ticket checkTicket(Ticket p_ti)
 {
     var result = (from t in dc.Tickets
                   where t.Code == p_ti.Code
                   select t).Single();
     return (Ticket)result;
 }
Ejemplo n.º 2
0
        public ActionResult Create(FormCollection f)
        {
            string fname = f["firstname"];
            string lname = f["lastname"];
            string twitname = f["twittername"];

            TicketModel ticketModel = new TicketModel();
            User u = new User();
            u.Firstname = fname;
            u.Lastname = lname;
            u.Twitterpic = twitname;
            int userID = ticketModel.insertUser(u);

            //generate random int
            Random random = new Random();
            var i =  random.Next(1000, 10000);
            string code = twitname.Substring(0, 2) + i.ToString();

            Ticket t = new Ticket();
            t.FK_Status = 1;
            t.FK_User = userID;
            t.Code = code;
            ticketModel.insertTicket(t);

            ViewBag.status = "posted";
            ViewBag.ticket = code;
            return View();
            //skills per user model aanroepen

            //wegschrijven in skills per user
        }
Ejemplo n.º 3
0
        public bool changeTicketStatus(Ticket p_ti)
        {
            var ticket = (from t in dc.Tickets
                         where t.Code == p_ti.Code
                         select t).Single();

            // Execute the query, and change the column values
            ticket.FK_Status = 2;

            // Submit the changes to the database.
            try
            {
                dc.SubmitChanges();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                return false;
            }

            return true;
        }
Ejemplo n.º 4
0
 // INSERT
 public void insertTicket(Ticket p_ti)
 {
     dc.Tickets.InsertOnSubmit(p_ti);
     dc.SubmitChanges();
 }
 partial void DeleteTicket(Ticket instance);
 partial void UpdateTicket(Ticket instance);
 partial void InsertTicket(Ticket instance);
		private void detach_Tickets(Ticket entity)
		{
			this.SendPropertyChanging();
			entity.User = null;
		}
		private void attach_Tickets(Ticket entity)
		{
			this.SendPropertyChanging();
			entity.User = this;
		}