Ejemplo n.º 1
0
        public ActionResult Create(CustomerTicket customerticket)
        {
            if (ModelState.IsValid)
            {
                customerticket.CreatedDate = DateTime.Now;
                db.CustomerTicket.Add(customerticket);
                db.SaveChanges();
                return RedirectToAction("Edits", "Customer", new { id = customerticket.CustomerId });
            }

            ViewBag.CustomerId = new SelectList(db.Customer, "Id", "FirstName", customerticket.CustomerId);
            return RedirectToAction("Edits", "Customer", new { id = customerticket.CustomerId });
        }
Ejemplo n.º 2
0
 public object PostTicket(TicketModel loginModel)
 {
     CustomerTicket customerticket = new CustomerTicket
     {
         CustomerId = Convert.ToInt32(loginModel.id),
         Content = loginModel.content,
         CreatedDate = DateTime.Now,
         Title = "Title"
     };
     db.CustomerTicket.Add(customerticket);
     db.SaveChanges();
     //if (LoginManager.Login(loginModel.username, loginModel.password, out errorMessage))
     //{
     //    return new { Result = true, User = LoginManager.CurrentUser.Transform() };
     //}
     //else
     //{
     return new { model = customerticket };
     // }
 }
Ejemplo n.º 3
0
 public ActionResult Edit(CustomerTicket customerticket)
 {
     if (ModelState.IsValid)
     {
         customerticket.CreatedDate = DateTime.Now;
         db.Entry(customerticket).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Edits", "Customer", new { id = customerticket.CustomerId });
     }
     ViewBag.CustomerId = new SelectList(db.Customer, "Id", "FirstName", customerticket.CustomerId);
     return RedirectToAction("Edits", "Customer", new { id = customerticket.CustomerId });
 }