예제 #1
0
        public async Task <IActionResult> Edit(string id, [Bind("StreetAddress,Area,Thana,PostCode,District,Country,Phone,Website,Facebook,Email,ContactPerson,ContactPersonPhone,About,LogoURL,Remarks,ExpireDate,DeliveryCharge,RecieptName,ChalanName")] MyShop myShop)
        {
            if (id != myShop.StreetAddress)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(myShop);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MyShopExists(myShop.StreetAddress))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(myShop));
        }
예제 #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            MyShop myShop = db.MyShops.Find(id);

            db.MyShops.Remove(myShop);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #3
0
        /*
         * ========================================================================================
         * Shop ---> Where the Hero can spend his/her gold to buy weapons/armor
         * ========================================================================================
         */
        public void Shop()
        {
            Console.Clear();

            MyShop.OpenShopAndTakeUserOrder();


            Console.Title = $"Main Menu";
        }// End of the Shop Method
예제 #4
0
 public ActionResult Edit([Bind(Include = "ID,Description,Floor")] MyShop myShop)
 {
     if (ModelState.IsValid)
     {
         db.Entry(myShop).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Floor = new SelectList(db.Floors, "ID", "Description", myShop.Floor);
     return(View(myShop));
 }
예제 #5
0
        public async Task <IActionResult> Create([Bind("StreetAddress,Area,Thana,PostCode,District,Country,Phone,Website,Facebook,Email,ContactPerson,ContactPersonPhone,About,LogoURL,Remarks,ExpireDate,DeliveryCharge,RecieptName,ChalanName")] MyShop myShop)
        {
            if (ModelState.IsValid)
            {
                _context.Add(myShop);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(myShop));
        }
예제 #6
0
        public ActionResult Create([Bind(Include = "ID,Description,Floor")] MyShop myShop)
        {
            if (ModelState.IsValid)
            {
                db.MyShops.Add(myShop);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.Floor = new SelectList(db.Floors, "ID", "Description", myShop.Floor);
            return(View(myShop));
        }
예제 #7
0
 internal void AddShop()
 {
     MyBl.AddShop(MyShop);
     MyShop.UpdateLists();
     shopAreaUC   = new ShopAreaUC(MyShop.Id);
     profileBarUC = new ProfileBarUC(MyShop);
     ((MainWindow)System.Windows.Application.Current.MainWindow).mainVM.UpdateShop(MyShop);
     ((MainWindow)System.Windows.Application.Current.MainWindow).content_grid.Children.Clear();
     ((MainWindow)System.Windows.Application.Current.MainWindow).inner_grid.Children.Clear();
     ((MainWindow)System.Windows.Application.Current.MainWindow).content_grid.Children.Add(shopAreaUC);
     ((MainWindow)System.Windows.Application.Current.MainWindow).profile_grid.Children.Add(profileBarUC);
 }
예제 #8
0
        // GET: MyShops/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MyShop myShop = db.MyShops.Find(id);

            if (myShop == null)
            {
                return(HttpNotFound());
            }
            return(View(myShop));
        }
예제 #9
0
        // GET: MyShops/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MyShop myShop = db.MyShops.Find(id);

            if (myShop == null)
            {
                return(HttpNotFound());
            }
            ViewBag.Floor = new SelectList(db.Floors, "ID", "Description", myShop.Floor);
            return(View(myShop));
        }