public ActionResult Login(FormCollection collection) { var room = collection.Get("room"); var type = Int32.Parse(collection.Get("type")); var ticketId = Int32.Parse(collection.Get("ticketId")); var ticketOvner = collection.Get("ticketOvner"); var modelEvent = new Event { RoomName = room, EmployeeName = Session["LoginedUser"].ToString(), ClientName = ticketOvner, Date = DateTime.Now, TicketId = ticketId, Type = Convert.ToBoolean(type) }; var tmp = MappingDtos.ModelEventToEntityEvent(modelEvent); if (EventUtils.InsertEvent(tmp)) { TicketUtils.EventTriggerUpdate(ticketId); // List<Ticket> tickets = new List<Ticket>(); Ticket tick = new Ticket(); tick = MappingDtos.EntityTicketToModelTicket(TicketUtils.GetTicketById(ticketId)); /* tickets.Add(tick); * Client client = new Client(); * client = MappingDtos.EntityClientToModelClient(tmp.Card); */ return(RedirectToAction("SuccessEnter", "Employee", tick)); } else { return(RedirectToAction("EmployeeError", "Employee", new { @errorMsg = "Nem sikeres belepes" })); } }
public static DataAccessLayer.Entities.Event ModelEventToEntityEvent(Models.Event modelEvent) { DataAccessLayer.Entities.Event entityEvent = new DataAccessLayer.Entities.Event() { Card = ClientUtils.GetClientByTicketId(modelEvent.TicketId), Date = modelEvent.Date, Id = modelEvent.Id, Inserter = EmployeeUtils.GetEmployeeByName(modelEvent.EmployeeName), Room = RoomUtils.GetRoomByName(modelEvent.RoomName), Ticket = TicketUtils.GetTicketById(modelEvent.TicketId), Type = modelEvent.Type }; return(entityEvent); }