Esempio n. 1
0
        public static GetEntryGateDataReply Send(int entityID, EntryGate entryGate)
        {
            var msg = pool.New();

            msg.Init(entityID, entryGate);
            MessageManager.GetInstance().Send(msg);
            return(msg);
        }
        public ActionResult DeleteConfirmed(int id)
        {
            EntryGate entryGate = db.EntryGate.Find(id);

            db.EntryGate.Remove(entryGate);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "Id,IsActive,IdAttraction")] EntryGate entryGate)
 {
     if (ModelState.IsValid)
     {
         db.Entry(entryGate).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.IdAttraction = new SelectList(db.Attraction, "Id", "Name", entryGate.IdAttraction);
     return(View(entryGate));
 }
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            EntryGate entryGate = db.EntryGate.Find(id);

            if (entryGate == null)
            {
                return(HttpNotFound());
            }
            return(View(entryGate));
        }
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            EntryGate entryGate = db.EntryGate.Find(id);

            if (entryGate == null)
            {
                return(HttpNotFound());
            }
            ViewBag.IdAttraction = new SelectList(db.Attraction, "Id", "Name", entryGate.IdAttraction);
            return(View(entryGate));
        }
Esempio n. 6
0
        private static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Application.ThreadException += applicationThreadException;
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            AppDomain.CurrentDomain.UnhandledException += currentDomainUnhandledException;

            try
            {
                Application.Run(EntryGate.DecideForm());
            }
            catch (Exception x)
            {
                HandleException(x);
            }
        }
Esempio n. 7
0
        protected override async Task <ICommandResult> Handle(CreateNewEntryGateCommand command)
        {
            var entryGate = _entryGateRepository.GetByName(command.NewEntryGatename);

            if (entryGate == null)
            {
                var EntryGate = new EntryGate();
                var details   = new EntryGate
                {
                    AltId             = new Guid(),
                    Name              = command.NewEntryGatename,
                    StreetInformation = "",
                    IsEnabled         = true,
                    ModifiedBy        = command.ModifiedBy,
                    CreatedUtc        = DateTime.UtcNow,
                };
                EntryGate = _entryGateRepository.Save(details);
                return(new CreateNewEntryGateCommandResult
                {
                    IsExisting = false,
                    AltId = EntryGate.AltId.ToString(),
                    Id = EntryGate.Id,
                    Success = true
                });
            }
            else
            {
                return(new CreateNewEntryGateCommandResult
                {
                    IsExisting = true,
                    AltId = entryGate.AltId.ToString(),
                    Id = entryGate.Id,
                    Success = false
                });
            }
        }
Esempio n. 8
0
 public void Init(int entityID, EntryGate entryGate)
 {
     this.entityID  = entityID;
     this.entryGate = entryGate;
 }