Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            waiting waiting = db.waitings.Find(id);

            db.waitings.Remove(waiting);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
        // GET: waitings/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            waiting waiting = db.waitings.Find(id);

            if (waiting == null)
            {
                return(HttpNotFound());
            }
            return(View(waiting));
        }
Пример #3
0
 public ActionResult Edit([Bind(Include = "waiting_id,customer_id,platform_id,language_id,genre_id,condiiton_id,status_id,title,price")] waiting waiting)
 {
     if (ModelState.IsValid)
     {
         db.Entry(waiting).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.condiiton_id = new SelectList(db.conditions, "condition_id", "condition1", waiting.condiiton_id);
     ViewBag.customer_id  = new SelectList(db.customers, "customer_id", "AspNetUsers_id", waiting.customer_id);
     ViewBag.genre_id     = new SelectList(db.genres, "genre_id", "genre1", waiting.genre_id);
     ViewBag.language_id  = new SelectList(db.languages, "language_id", "language1", waiting.language_id);
     ViewBag.platform_id  = new SelectList(db.platforms, "platform_id", "platform1", waiting.platform_id);
     ViewBag.status_id    = new SelectList(db.status, "status_id", "status1", waiting.status_id);
     return(View(waiting));
 }
 private void buttonStart_Click(object sender, EventArgs e)
 {
     Task.Run(() =>
     {
         if (InvokeRequired)     // Line #1
         {
             this.Invoke(new MethodInvoker(() => button1.Text = "Proccessing"));
         }
         else
         {
             button1.Text = "Proccessing";
         }
     });
     waitForm = new waiting();
     timer1.Start();
     waitForm.ShowDialog();
 }
Пример #5
0
        // GET: waitings/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            waiting waiting = db.waitings.Find(id);

            if (waiting == null)
            {
                return(HttpNotFound());
            }
            ViewBag.condiiton_id = new SelectList(db.conditions, "condition_id", "condition1", waiting.condiiton_id);
            ViewBag.customer_id  = new SelectList(db.customers, "customer_id", "AspNetUsers_id", waiting.customer_id);
            ViewBag.genre_id     = new SelectList(db.genres, "genre_id", "genre1", waiting.genre_id);
            ViewBag.language_id  = new SelectList(db.languages, "language_id", "language1", waiting.language_id);
            ViewBag.platform_id  = new SelectList(db.platforms, "platform_id", "platform1", waiting.platform_id);
            ViewBag.status_id    = new SelectList(db.status, "status_id", "status1", waiting.status_id);
            return(View(waiting));
        }
Пример #6
0
        public ActionResult AddProduct([Bind(Include = "waiting_id,customer_id,platform_id,language_id,genre_id,condiiton_id,title,price")] waiting waiting)
        {
            if (ModelState.IsValid)
            {
                string          aspnetuserID = User.Identity.GetUserId();
                List <customer> custList     = db.customers.Where(x => x.AspNetUsers_id == aspnetuserID).ToList();

                if (custList.Count() > 0)
                {
                    waiting.status_id = 1;
                    int cust = custList.First().customer_id;
                    waiting.customer_id = cust;
                }
                db.waitings.Add(waiting);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.condiiton_id = new SelectList(db.conditions, "condition_id", "condition1", waiting.condiiton_id);
            ViewBag.genre_id     = new SelectList(db.genres, "genre_id", "genre1", waiting.genre_id);
            ViewBag.language_id  = new SelectList(db.languages, "language_id", "language1", waiting.language_id);
            ViewBag.platform_id  = new SelectList(db.platforms, "platform_id", "platform1", waiting.platform_id);
            return(View(waiting));
        }