Example #1
0
        public ActionResult CreateE([Bind(Include = "Id,Name_Expo,Adres,Description,ExpoStartData,ExpoEndData")] Expo expo)
        {
            if (ModelState.IsValid)
            {
                HttpPostedFileBase file = Request.Files["plikZObrazkiem"];
                if (file != null && file.ContentLength > 0)
                {
                    expo.Photo = System.Guid.NewGuid().ToString() + ".jpg";
                    file.SaveAs(HttpContext.Server.MapPath("~/Images/Expo/") + expo.Photo);
                }
                HttpPostedFileBase file1 = Request.Files["layouts"];
                if (file1 != null && file1.ContentLength > 0)
                {
                    expo.pdflayout = System.Guid.NewGuid().ToString() + ".png";
                    file1.SaveAs(HttpContext.Server.MapPath("~/Images/Expo/pdf/") + expo.pdflayout);
                }
                HttpPostedFileBase file9 = Request.Files["Map"];
                if (file9 != null && file9.ContentLength > 0)
                {
                    expo.MapPhoto = System.Guid.NewGuid().ToString() + ".jpg";
                    file9.SaveAs(HttpContext.Server.MapPath("~/Images/Expo/") + expo.MapPhoto);
                }
                UpdateModel(expo);
                db.Expos.Add(expo);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(expo));
        }
Example #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            Expo expo = db.Expos.Find(id);

            db.Expos.Remove(expo);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #3
0
        public ActionResult DeleteConfirmed(int id)
        {
            Invite invite = db.Invites.Find(id);
            Expo   ex     = db.Expos.Where(p => p.Invites.Any(s => s.Id == invite.Id)).First();

            db.Invites.Remove(invite);
            db.SaveChanges();
            return(RedirectToAction("InviteE", "Invites", new { @id = ex.Id }));
        }
Example #4
0
        public ActionResult canceled(int id)
        {
            Invite i  = db.Invites.Find(id);
            Expo   ex = db.Expos.Where(p => p.Invites.Any(s => s.Id == i.Id)).First();

            i.Status = status.canceled;
            UpdateModel(i);
            db.SaveChanges();
            return(RedirectToAction("InviteE", "Invites", new { id = ex.Id }));
        }
Example #5
0
 public static void InsertUExpo(Expo e)
 {
     using (var conn = new SQLite.SQLiteConnection(Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "database.sqlite")))
     {
         conn.CreateTable <Expo>();
         conn.Insert(e);
         conn.Commit();
         conn.Close();
     }
 }
Example #6
0
        public ActionResult InviteC()
        {
            List <Invite> list = db.Invites.Where(p => p.Email == User.Identity.Name).ToList();

            foreach (var item in list)
            {
                Expo ex = db.Expos.Where(p => p.Invites.Any(s => s.Id == item.Id)).First();
                item.Expo = ex;
            }
            return(View(list));
        }
 public ActionResult Make(Expo expo)
 {
     if (ModelState.IsValid)
     {
         return(RedirectToAction("Index", "Handel_list", expo));
     }
     else
     {
         return(View(expo));
     }
 }
Example #8
0
 public ActionResult Edit([Bind(Include = "Id,EmployeeId")] Expo expo)
 {
     if (ModelState.IsValid)
     {
         db.Entry(expo).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.EmployeeId = new SelectList(db.Employees, "Id", "UserId", expo.EmployeeId);
     return(View(expo));
 }
Example #9
0
        public ActionResult Create([Bind(Include = "Id,EmployeeId")] Expo expo)
        {
            if (ModelState.IsValid)
            {
                db.Expos.Add(expo);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.EmployeeId = new SelectList(db.Employees, "Id", "UserId", expo.EmployeeId);
            return(View(expo));
        }
Example #10
0
        public ActionResult Create([Bind(Include = "Id,StartDate,EndDate,Name,Description,Place")] Event events, int expoid)
        {
            if (ModelState.IsValid)
            {
                Expo ex = db.Expos.Find(expoid);
                db.Events.Add(events);
                db.SaveChanges();
                ex.Events.Add(events);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(events));
        }
Example #11
0
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Expo expo = db.Expos.Find(id);

            if (expo == null)
            {
                return(HttpNotFound());
            }
            return(View(expo));
        }
Example #12
0
        // GET: Expoes/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Expo expo = db.Expos.Find(id);

            if (expo == null)
            {
                return(HttpNotFound());
            }
            return(RedirectToAction("Details", "Availabilities", new { id = id }));
        }
Example #13
0
        // GET: Expoes/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Expo expo = db.Expos.Find(id);

            if (expo == null)
            {
                return(HttpNotFound());
            }
            ViewBag.EmployeeId = new SelectList(db.Employees, "Id", "UserId", expo.EmployeeId);
            return(View(expo));
        }
Example #14
0
        public ActionResult send(int id)
        {
            Expo   ex = db.Expos.Find(id);
            Invite i  = new Invite()
            {
                Email  = User.Identity.Name,
                Expo   = ex,
                Status = status.send
            };

            i = db.Invites.Add(i);
            ex.Invites.Add(i);
            UpdateModel(ex);
            db.SaveChanges();
            return(RedirectToAction("Index", "Expoes", new {  }));
        }
Example #15
0
        public ActionResult Create([Bind(Include = "Id,Email,Status")] Invite invite, long Expo)
        {
            if (ModelState.IsValid)
            {
                invite.Status = status.invite;
                Expo ex = db.Expos.Find(Expo);
                invite.Expo = ex;
                Invite i = db.Invites.Add(invite);
                db.SaveChanges();
                ex.Invites.Add(i);
                db.Entry(invite).State = EntityState.Modified;
                db.Entry(ex).State     = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("InviteE", "Invites", new { @id = ex.Id }));
            }

            return(View(invite));
        }
Example #16
0
    /// <summary>
    /// Calculate a Ease OutIn from a pourcent
    /// </summary>
    /// <param name="linearStep">Pourcent on the ease</param>
    /// <param name="type">Easing Type</param>
    public static float EaseOutIn(float linearStep, EasingType type)
    {
        switch (type)
        {
        case EasingType.Step:
            return(Mathf.Round(linearStep));

        default:
        case EasingType.Linear:
            return(linearStep);

        case EasingType.Sine:
            return(Sine.EaseOutIn(linearStep));

        case EasingType.Quadratic:
            return(Power.EaseOutIn(linearStep, 2));

        case EasingType.Cubic:
            return(Power.EaseOutIn(linearStep, 3));

        case EasingType.Quartic:
            return(Power.EaseOutIn(linearStep, 4));

        case EasingType.Quintic:
            return(Power.EaseOutIn(linearStep, 5));

        case EasingType.Elastic:
            return(Elastic.EaseOutIn(linearStep));

        case EasingType.Bounce:
            return(Bounce.EaseOutIn(linearStep));

        case EasingType.Back:
            return(Back.EaseOutIn(linearStep));

        case EasingType.Expo:
            return(Expo.EaseOutIn(linearStep));

        case EasingType.Circ:
            return(Circ.EaseOutIn(linearStep));
        }
    }
Example #17
0
        public ActionResult approveT(int id)
        {
            Invite i = db.Invites.Find(id);

            i.Status = status.approved;
            Expo ex = db.Expos.Where(p => p.Invites.Any(s => s.Id == i.Id)).First();

            i.Expo = ex;
            bool exC = db.Companies.Any(p => p.Email == i.Email);

            if (exC == true)
            {
                var Usr = db.Companies.Single(p => p.Email == i.Email);
                ex.Company.Add(Usr);
                Usr.Expo.Add(ex);
                db.Entry(Usr).State = EntityState.Modified;
                db.Entry(ex).State  = EntityState.Modified;
            }
            db.SaveChanges();
            return(RedirectToAction("InviteC", "Invites", new { }));
        }
Example #18
0
 public ActionResult Edit(Expo expo)
 {
     if (ModelState.IsValid)
     {
         l_expos.RemoveAt(position);
         if (l_expos.Count == 0)
         {
             l_expos.Add(expo);
             return(View("Index", l_expos));
         }
         else
         {
             l_expos.Insert(position, expo);
             return(View(l_expos));
         }
     }
     else
     {
         return(View(expo));
     }
 }
Example #19
0
        public ActionResult Details(int id)
        {
            Expo view_expo = l_expos.Find(x => x.Expo_ID == id);

            return(View(view_expo));
        }
Example #20
0
        static async Task MainAsync(string[] args)
        {
            // Ensure we have the input file
            if (!File.Exists(PushTokenFilename))
            {
                Console.WriteLine("Please create a push-tokens.txt containing the tokens you'd like to test with.");
                Console.WriteLine("Place one token on each line of the file.");
                Console.WriteLine();
                Console.WriteLine("Hit a key to quit");
                Console.ReadKey();
                return;
            }

            // Setup Expo
            var Expo = new Expo()
            {
                SendBatchSize       = 2, // Default is 100, not recommended to change, only doing so here for testing purposes
                GetReceiptBatchSize = 2, // Default is 300, not recommended to change, only doing so here for testing purposes
            };

            Expo.SendCallback            += Expo_SendCallback;
            Expo.SendErrorCallback       += Expo_SendErrorCallback;
            Expo.GetReceiptCallback      += Expo_GetReceiptCallback;
            Expo.GetReceiptErrorCallback += Expo_GetReceiptErrorCallback;

            // Read the tokens from the input file and loop through them, sending each a message
            try {
                string[] PushTokens = File.ReadAllLines(PushTokenFilename);
                foreach (string PushToken in PushTokens)
                {
                    Console.WriteLine($"Handling {PushToken}...");
                    await Expo.SendAsync(new Message()
                    {
                        body  = DateTime.Now.ToString(),
                        title = "Hello from EvidenceAlerts",
                        to    = PushToken,
                    });
                }
            } finally {
                // Always call FlushSendAsync at the end to ensure any queued messages are delivered
                await Expo.FlushSendAsync();
            }

            // Pause until user is ready to check receipts
            Console.WriteLine();
            Console.WriteLine("Send completed, wait a bit and hit a key to check the receipts");
            Console.ReadKey();

            // Loop through the tickets, checking the receipt for each one
            try {
                foreach (var Ticket in _Tickets)
                {
                    if (string.IsNullOrWhiteSpace((string)Ticket.id))
                    {
                        Console.WriteLine($"Message to {Ticket.notification.to} failed...");
                        Console.WriteLine($"  Status: {Ticket.status}");
                        Console.WriteLine($"  Message: {Ticket.errorMessage}");
                    }
                    else
                    {
                        Console.WriteLine($"Checking {Ticket.id}...");
                        await Expo.GetReceiptAsync(Ticket);
                    }
                }
            } finally {
                // Always call FlushGetReceiptAsync at the end to ensure any queued requests are delivered
                await Expo.FlushGetReceiptAsync();
            }

            // Pause until user is ready to check receipts
            Console.WriteLine();
            Console.WriteLine("Check completed, hit a key to try again with the single function call");
            Console.ReadKey();

            // Alternatively, you can check a bunch of tickets at once -- no need to flush at the end
            await Expo.GetReceiptsAsync(_Tickets);

            // Pause at end
            Console.WriteLine();
            Console.WriteLine("Hit a key to quit");
            Console.ReadKey();
        }
Example #21
0
 // GET: Handel_list
 public ActionResult Index(Expo expo)
 {
     l_expos.Add(expo);
     return(View(l_expos));
 }
Example #22
0
 public override double Ease(double t, double b, double c, double d)
 {
     return(Expo.EaseInOut(t, b, c, d));
 }