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));
        }
Exemple #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            MyShop myShop = db.MyShops.Find(id);

            db.MyShops.Remove(myShop);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #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
Exemple #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));
 }
        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));
        }
Exemple #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));
        }
Exemple #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);
 }
Exemple #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));
        }
Exemple #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));
        }