Esempio n. 1
0
        public async Task <IActionResult> Edit(int id, [Bind("SellerId,SellerName,MobileNumber,Address,Email,GSTNumber,AccountNumber")] Sellers sellers)
        {
            if (id != sellers.SellerId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(sellers);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SellersExists(sellers.SellerId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AccountNumber"] = new SelectList(_context.SellerAccounts, "AccountNumber", "BankName", sellers.AccountNumber);
            return(View(sellers));
        }
Esempio n. 2
0
        public async Task CheckComplOrders()
        {
            var deleted = new List <Seller>();

            foreach (Seller seller in Sellers)
            {
                if (await seller.IsCpmplited())
                {
                    deleted.Add(seller);
                    Complited.Add(seller);
                }
            }
            foreach (Seller seller in deleted)
            {
                Sellers.Remove(seller);
            }
            if (await Buyer.IsComplited())
            {
                var complitedOrder = Buyer.PopComplited();
                if (complitedOrder != null)
                {
                    Sellers.Add(new Seller(complitedOrder, Tracker.Sett.Delta, _market.Api));
                }
            }
        }
Esempio n. 3
0
        private void HandleSold(ItemViewModel item)
        {
            if (item.IsSold)
            {
                SearchItemText = string.Empty;
                if (!Batch.Contains(item))
                {
                    Batch.Add(item);
                }
            }
            else
            {
                Batch.Remove(item);
            }


            var seller = Sellers.Where(s => s.Id == item.Seller.Id || s is AllSellerViewModel)
                         .Select(s => {
                s.Update();
                return(s);
            })
                         .ToList();

            RaisePropertyChanged(nameof(BatchValue));
        }
Esempio n. 4
0
 public void AddSellers(uint amount, double initCash, uint initStorage)
 {
     for (int i = 0; i < amount; i++)
     {
         Sellers.Add(new Seller(initCash, initStorage));
     }
 }
Esempio n. 5
0
        // POST: api/SellApi
        public SellOutViewModel Post([FromBody] SellEntryViewModel entry)
        {
            //tratar os dados e realizar calculo
            SellOutViewModel result     = new SellOutViewModel();
            double           basesalary = 0;
            double           endsalary  = 0;

            try {
                string[] values = entry.value.Split(';');
                Double.TryParse(entry.basesalary, out basesalary);
                if (basesalary > 0 && values.Length > 0)
                {
                    List <SellViewModel> sellViewModels = new List <SellViewModel>();
                    values.ToList().ForEach(f =>
                    {
                        if (!String.IsNullOrEmpty(f))
                        {
                            sellViewModels.Add(new SellViewModel()
                            {
                                price = Double.Parse(f)
                            });
                        }
                    });
                    endsalary        = Sellers.GetEndSalary(basesalary, 100, sellViewModels);
                    result.endsalary = endsalary;
                }
            }
            catch (Exception ex)
            {
                result.message = ex.Message;
            }
            return(result);
        }
Esempio n. 6
0
 public ActionResult Create([Bind(Include = "SellersId,Email,Firstname,Lastname,Address,City,State,ZipCode")] Sellers sellers)
 {
     try
     {
         if (ModelState.IsValid)
         {
             sellers.ApplicationUserId = User.Identity.GetUserId();
             string address = (sellers.Address + "+" + sellers.City + "+" + sellers.State + "+" + sellers.ZipCode);
             GeoLocationController geoLocation = new GeoLocationController();
             geoLocation.SendRequest(address);
             sellers.Lat = geoLocation.latitude;
             sellers.Lng = geoLocation.longitude;
             db.Sellers.Add(sellers);
             db.SaveChanges();
             return(RedirectToAction("Index", "Items"));
             //return RedirectToAction("Details", new { id = sellers.SellersId }); //or redirect to details of the user
         }
     }
     catch (RetryLimitExceededException /* dex */)
     {
         //Log the error (uncomment dex variable name and add a line here to write a log.
         ModelState.AddModelError("", "Unable to save changes. Try again, and if the problem persists see your system administrator.");
     }
     ViewBag.ApplicationUserId = new SelectList(db.Users, "Id", "Email", sellers.ApplicationUserId);
     return(View(sellers));
 }
        public async Task <IActionResult> Edit(int id, Sellers seller)
        {
            if (!ModelState.IsValid)
            {
                var departments = await _departmentService.FindAllAsync();

                var viewModel = new SellerFormViewModel {
                    Seller = seller, Departments = departments
                };
                return(View(viewModel));
            }
            if (id != seller.Id)
            {
                return(RedirectToAction(nameof(Error), new { message = "Id mismatch" }));
            }
            try
            {
                await _sellerService.UpdateAsync(seller);

                return(RedirectToAction(nameof(Index)));
            }
            catch (ApplicationException e)
            {
                return(RedirectToAction(nameof(Error), new { message = e.Message }));
            }
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Link")] Sellers sellers)
        {
            if (id != sellers.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(sellers);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SellersExists(sellers.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(sellers));
        }
Esempio n. 9
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            string strSellerNum    = this.txtSellerNum.Text.Trim();
            string strSellerPasswd = this.txtSellerPasswd.Text.Trim();

            if (strSellerNum == "" || strSellerNum == null)
            {
                this.labError.Text = "用户名不能为空!";
                return;
            }
            if (strSellerPasswd == "" || strSellerPasswd == null)
            {
                this.labError.Text = "密码不能为空!";
                return;
            }

            eShopDatabaseEntities eShop = new eShopDatabaseEntities();
            string passwdMd5            = pwdMD5.PasswdMD5Locker.MD5Encrypt(strSellerPasswd);

            var query = from sellers in eShop.Sellers
                        where sellers.SellerNum.Equals(strSellerNum) &&
                        sellers.SellerPasswd.Equals(passwdMd5)
                        select sellers;

            if (query.Count() > 0)
            {
                Sellers seller = query.FirstOrDefault();
                Session["Seller"] = seller;
                Response.Redirect("~/Seller/SellerManagement.aspx");
            }
            else
            {
                this.labError.Text = "用户名或密码错误!";
            }
        }
Esempio n. 10
0
        public ParallelLoopResult Process(string[] lines)
        {
            return(Parallel.ForEach(lines, (line) =>
            {
                string[] data = DataHelper.SplitData(line);
                if (data.Length >= 4)
                {
                    switch (data.First())
                    {
                    case DataType.Seller:
                        Sellers.Add(new Seller(data));
                        break;

                    case DataType.Client:
                        Clients.Add(new Client(data));
                        break;

                    case DataType.Sale:
                        Sale sale = new Sale(data);
                        sale.ProcessItems();
                        Sales.Add(sale);
                        break;

                    default:
                        break;
                    }
                }
            }));
        }
Esempio n. 11
0
        protected void btnGenerate_Click(object sender, EventArgs e)
        {
            string signName = txtSign.Text.Trim();

            if (string.IsNullOrEmpty(signName))
            {
                lbMsg.Text      = "店铺签名不能为空!";
                lbMsg.ForeColor = Color.Red;
                return;
            }
            if (signName.Length > 15)
            {
                lbMsg.Text      = "店铺签名不能超过15个字符!";
                lbMsg.ForeColor = Color.Red;
                return;
            }
            if (!string.IsNullOrEmpty(signName))
            {
                Sellers objSell = new Sellers();
                objSell.Nick         = Users.Nick;
                objSell.SignShopName = signName;
                objSell.Cellphone    = "";
                if (SellersBLL.SetShopName(objSell))
                {
                    lbMsg.Text = "修改成功!";
                    Page_Load(sender, e);
                }
            }
        }
Esempio n. 12
0
        public ActionResult DeleteConfirmed(int id)
        {
            Sellers sellers = db.Sellers.Find(id);

            db.Sellers.Remove(sellers);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 13
0
        public void loadSellers()
        {
            //this function will load the data into grid
            myDAL objDAL = new myDAL();

            Sellers.DataSource = objDAL.GetSellersList_DAL();
            Sellers.DataBind();
        }
        public void Seed()
        {
            if (_context.Department.Any() || _context.Sellers.Any() || _context.SalesRecord.Any())
            {
                return; //DB WAS BEEN SEEDED
            }

            Department d1 = new Department(1, "Computers");
            Department d2 = new Department(2, "Eletronics");
            Department d3 = new Department(3, "Fashion");
            Department d4 = new Department(4, "Books");

            Sellers s1 = new Sellers(1, "Bob Brown", "*****@*****.**", new DateTime(1998, 4, 21), 1000.0, d1);
            Sellers s2 = new Sellers(2, "Maria Green", "*****@*****.**", new DateTime(1979, 12, 31), 3500.0, d2);
            Sellers s3 = new Sellers(3, "Alex Grey", "*****@*****.**", new DateTime(1988, 1, 15), 2200.0, d1);
            Sellers s4 = new Sellers(4, "Martha Red", "*****@*****.**", new DateTime(1993, 11, 30), 3000.0, d4);
            Sellers s5 = new Sellers(5, "Donald Blue", "*****@*****.**", new DateTime(2000, 1, 9), 4000.0, d3);
            Sellers s6 = new Sellers(6, "Alex Pink", "*****@*****.**", new DateTime(1997, 3, 4), 3000.0, d2);

            SalesRecord r1  = new SalesRecord(1, new DateTime(2018, 09, 25), 11000.0, SaleStatus.Billed, s1);
            SalesRecord r2  = new SalesRecord(2, new DateTime(2018, 09, 4), 7000.0, SaleStatus.Billed, s5);
            SalesRecord r3  = new SalesRecord(3, new DateTime(2018, 09, 13), 4000.0, SaleStatus.Canceled, s4);
            SalesRecord r4  = new SalesRecord(4, new DateTime(2018, 09, 1), 8000.0, SaleStatus.Billed, s1);
            SalesRecord r5  = new SalesRecord(5, new DateTime(2018, 09, 21), 3000.0, SaleStatus.Billed, s3);
            SalesRecord r6  = new SalesRecord(6, new DateTime(2018, 09, 15), 2000.0, SaleStatus.Billed, s1);
            SalesRecord r7  = new SalesRecord(7, new DateTime(2018, 09, 28), 13000.0, SaleStatus.Billed, s2);
            SalesRecord r8  = new SalesRecord(8, new DateTime(2018, 09, 11), 4000.0, SaleStatus.Billed, s4);
            SalesRecord r9  = new SalesRecord(9, new DateTime(2018, 09, 14), 11000.0, SaleStatus.Pending, s6);
            SalesRecord r10 = new SalesRecord(10, new DateTime(2018, 09, 7), 9000.0, SaleStatus.Billed, s6);
            SalesRecord r11 = new SalesRecord(11, new DateTime(2018, 09, 13), 6000.0, SaleStatus.Billed, s2);
            SalesRecord r12 = new SalesRecord(12, new DateTime(2018, 09, 25), 7000.0, SaleStatus.Pending, s3);
            SalesRecord r13 = new SalesRecord(13, new DateTime(2018, 09, 29), 10000.0, SaleStatus.Billed, s4);
            SalesRecord r14 = new SalesRecord(14, new DateTime(2018, 09, 4), 3000.0, SaleStatus.Billed, s5);
            SalesRecord r15 = new SalesRecord(15, new DateTime(2018, 09, 12), 4000.0, SaleStatus.Billed, s1);
            SalesRecord r16 = new SalesRecord(16, new DateTime(2018, 10, 5), 2000.0, SaleStatus.Billed, s4);
            SalesRecord r17 = new SalesRecord(17, new DateTime(2018, 10, 1), 12000.0, SaleStatus.Billed, s1);
            SalesRecord r18 = new SalesRecord(18, new DateTime(2018, 10, 24), 6000.0, SaleStatus.Billed, s3);
            SalesRecord r19 = new SalesRecord(19, new DateTime(2018, 10, 22), 8000.0, SaleStatus.Billed, s5);
            SalesRecord r20 = new SalesRecord(20, new DateTime(2018, 10, 15), 8000.0, SaleStatus.Billed, s6);
            SalesRecord r21 = new SalesRecord(21, new DateTime(2018, 10, 17), 9000.0, SaleStatus.Billed, s2);
            SalesRecord r22 = new SalesRecord(22, new DateTime(2018, 10, 24), 4000.0, SaleStatus.Billed, s4);
            SalesRecord r23 = new SalesRecord(23, new DateTime(2018, 10, 19), 11000.0, SaleStatus.Canceled, s2);
            SalesRecord r24 = new SalesRecord(24, new DateTime(2018, 10, 12), 8000.0, SaleStatus.Billed, s5);
            SalesRecord r25 = new SalesRecord(25, new DateTime(2018, 10, 31), 7000.0, SaleStatus.Billed, s3);
            SalesRecord r26 = new SalesRecord(26, new DateTime(2018, 10, 6), 5000.0, SaleStatus.Billed, s4);
            SalesRecord r27 = new SalesRecord(27, new DateTime(2018, 10, 13), 9000.0, SaleStatus.Pending, s1);
            SalesRecord r28 = new SalesRecord(28, new DateTime(2018, 10, 7), 4000.0, SaleStatus.Billed, s3);
            SalesRecord r29 = new SalesRecord(29, new DateTime(2018, 10, 23), 12000.0, SaleStatus.Billed, s5);
            SalesRecord r30 = new SalesRecord(30, new DateTime(2018, 10, 12), 5000.0, SaleStatus.Billed, s2);

            _context.Department.AddRange(d1, d2, d3, d4);
            _context.Sellers.AddRange(s1, s2, s3, s4, s5, s6);
            _context.SalesRecord.AddRange(r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18, r19, r20, r21, r22, r23,
                                          r24, r25, r26, r27, r28, r29, r30);

            _context.SaveChanges();
        }
Esempio n. 15
0
        public void AddSeller(string name, int total, IProduct product)
        {
            ISellers seller = _attendants.CreateSeller(name, total, product);

            Sellers.Add(seller);
            Thread thread = new Thread(() => seller.AddProduct());

            SellerThreads.Add(thread);
        }
        /// <summary>
        /// Seed the AppDbContext with mock data
        /// </summary>
        /// <param name="context"></param>
        public static void Seed(AppDbContext context)
        {
            if (!context.Sellers.Any())
            {
                context.Sellers.AddRange(Sellers.Select(s => s.Value));
            }

            if (!context.Products.Any())
            {
                context.AddRange
                (
                    new Product {
                    Seller                  = Sellers["Paintball Planet"],
                    ProductName             = "Paintballs",
                    ProductShortDescription = "Green and Yellow Shell / Yellow Fill.",
                    ProductLongDescription  = "Marballizer Paintballs. These are the best paintballs money can buy! All paintballs are fresh and arrive on a weekly basis. All cases of paint are opened before shipment to ensure that there are no broken paintballs. Once the package has been inspected then it will be re-taped and initialed to verify that it has been checked. All cases of paint are then wrapped in a bubble wrap and placed in a box surrounded by packing paper. Sorry but there are no returns on paintballs that are shipped out. We take every precaution to get you your paint in the best condition and in the shortest time.",
                    ProductPrice            = 45.99M,
                    ProductImgUrl           = "https://cdn3.bigcommerce.com/s-9bkfd/products/400/images/834/Empire_Marballizer_Paintballs_1__97088.1398981336.500.659.jpg?c=2",
                    ProductCount            = 10,
                    IsEdible                = false
                },
                    new Product {
                    Seller                  = Sellers["Wayne Enterprises"],
                    ProductName             = "Tumbler",
                    ProductShortDescription = "Off road vehicle. Comes in black.",
                    ProductLongDescription  = "The Tumbler has a pair of machine guns mounted in the nose of the car between the front wheels. In \"Attack\" mode, the driver's seat moves to the center of the car, and the driver is repositioned to lie face-down with his head in the center section between the front wheels. This serves two main purposes: first, it provides more substantial protection with the driver shielded by multiple layers of armor plating. Second, the low-down, centralized driving position makes extreme precision maneuvers easier to perform, while lying prone reduces the risk of injury a driver faces when making these maneuvers.",
                    ProductPrice            = 250000.00M,
                    ProductImgUrl           = "http://media.comicbook.com/uploads1/2015/01/batmobile-tumbler-118336.jpg",
                    ProductCount            = 3,
                    IsEdible                = false
                },
                    new Product {
                    Seller                  = Sellers["Stark Industries"],
                    ProductName             = "Arc Reactor",
                    ProductShortDescription = "Powers a heart for over 50 lifetimes.",
                    ProductLongDescription  = "Engineered by Tony Stark himself in a cave, with scraps.",
                    ProductPrice            = 250000.00M,
                    ProductImgUrl           = "https://i0.wp.com/lanteanar-automated-transfer-1.blog/wp-content/uploads/2018/01/iron-man-arc-reactor-mk1-3d-model-max-obj-fbx-mtl-1.jpg?ssl=1",
                    ProductCount            = 1,
                    IsEdible                = false
                },
                    new Product {
                    Seller                  = Sellers["Ace Chemicals"],
                    ProductName             = "Skin Bleach",
                    ProductShortDescription = "Adverse side affects.",
                    ProductLongDescription  = "Probably not FDA approved.",
                    ProductPrice            = 10.99M,
                    ProductImgUrl           = "https://mixedtees.com/image/cache/catalog/data/Shirts/Suicide%20Squad/ACE%20Chemicals/AceChemicals-PLATE-750x750.jpg",
                    ProductCount            = 100,
                    IsEdible                = false
                }
                );
            }

            context.SaveChanges();
        }
Esempio n. 17
0
        private static void LoadDataDefault()
        {
            Customers customers = new Customers();

            customers.IdCustomer = 1;
            customers.Name       = "Victor Palomino";
            customers.BirthDate  = "09/09/1982";
            customersList.Add(customers);

            customers            = new Customers();
            customers.IdCustomer = 2;
            customers.Name       = "Noemi Beltran";
            customers.BirthDate  = "04/07/1902";
            customersList.Add(customers);

            customers            = new Customers();
            customers.IdCustomer = 3;
            customers.Name       = "Aldo Hiruma";
            customers.BirthDate  = "01/04/1952";
            customersList.Add(customers);

            Products products = new Products();

            products.IdProduct   = 1;
            products.Description = "Product A";
            products.Price       = 10;
            products.Stock       = 20;
            productsList.Add(products);

            products             = new Products();
            products.IdProduct   = 2;
            products.Description = "Product B";
            products.Price       = 20;
            products.Stock       = 40;
            productsList.Add(products);

            products             = new Products();
            products.IdProduct   = 3;
            products.Description = "Product C";
            products.Price       = 30;
            products.Stock       = 5;
            productsList.Add(products);

            products             = new Products();
            products.IdProduct   = 4;
            products.Description = "Product D";
            products.Price       = 40;
            products.Stock       = 3;
            productsList.Add(products);

            Sellers sellers = new Sellers();

            sellers.IdSeller = 1;
            sellers.Name     = "Seller A";
            sellersList.Add(sellers);
        }
Esempio n. 18
0
 public ActionResult Edit([Bind(Include = "SellersID,lastName,name")] Sellers sellers)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sellers).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(sellers));
 }
Esempio n. 19
0
        public void ReadFromFile()
        {
            //string[] lines = System.IO.File.ReadAllLines(@"C:\Users\Public\Documents\TestCases2.txt");
            string[] lines                    = System.IO.File.ReadAllLines(@"C:\Users\Public\Documents\SingleTestCase.txt");
            int      noOfTestcases            = Int32.Parse(lines[0]);
            int      lineNoForNoOfBuyerSeller = 1;

            line = $" ---No of Testcases: {noOfTestcases}--- ";
            Console.WriteLine(line);
            file.WriteLine(line);
            int testcaseNo = 1;

            while (lineNoForNoOfBuyerSeller < lines.Length)
            {
                Buyers  myBuyers  = new Buyers();
                Sellers mySellers = new Sellers();
                line = $"{testcaseNo++}) TestCase ------ ";
                Console.WriteLine(line);
                file.WriteLine(line);
                String[] parsing     = lines[lineNoForNoOfBuyerSeller].Split(' ');
                int      noOfBuyers  = Int32.Parse(parsing[0]);
                int      noOfSellers = Int32.Parse(parsing[1]);
                for (int i = lineNoForNoOfBuyerSeller + 1; i <= lineNoForNoOfBuyerSeller + noOfBuyers; i++)
                {
                    String[]       buyerParsing = lines[i].Split(' ');
                    NewPartyWithId myNewParty   = new NewPartyWithId(Int32.Parse(buyerParsing[0]), Int32.Parse(buyerParsing[1]), Int32.Parse(buyerParsing[2]), buyerParsing[3]);
                    myBuyers.addBuyers(myNewParty);
                }
                for (int j = lineNoForNoOfBuyerSeller + noOfBuyers + 1; j <= lineNoForNoOfBuyerSeller + noOfBuyers + noOfSellers; j++)
                {
                    String[]       sellerParsing = lines[j].Split(' ');
                    NewPartyWithId myNewParty    = new NewPartyWithId(Int32.Parse(sellerParsing[0]), Int32.Parse(sellerParsing[1]), Int32.Parse(sellerParsing[2]), sellerParsing[3]);
                    mySellers.addSellers(myNewParty);
                }
                Buyers  myCopyBuyers  = new Buyers();
                Sellers myCopySellers = new Sellers();
                myCopyBuyers.setBuyers(mySellers.getCopySellers());
                myCopySellers.setSellers(myBuyers.getCopyBuyers());
                line = " Before Processing ";
                Console.WriteLine(line);
                file.WriteLine(line);
                printList(myBuyers, mySellers, true);
                line = " After Processing ";
                Console.WriteLine(line);
                file.WriteLine(line);
                solve(myBuyers, mySellers);
                printList(myBuyers, mySellers, true);
                line = " --- Reverse Result ---";
                Console.WriteLine(line);
                file.WriteLine(line);
                solve(myCopyBuyers, myCopySellers);
                printList(myBuyers, mySellers, true);
                lineNoForNoOfBuyerSeller += noOfBuyers + noOfSellers + 1;
            }
        }
        public async Task <IActionResult> Create([Bind("Id,Name,Link")] Sellers sellers)
        {
            if (ModelState.IsValid)
            {
                _context.Add(sellers);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(sellers));
        }
Esempio n. 21
0
 public ActionResult Edit([Bind(Include = "SellersId,Firstname,Lastname,Address,City,State,ZipCode")] Sellers sellers)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sellers).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Details", new { id = sellers.SellersId }));
     }
     ViewBag.ApplicationUserId = new SelectList(db.Users, "Id", "Email", sellers.ApplicationUserId);
     return(View(sellers));
 }
Esempio n. 22
0
        public ActionResult Create([Bind(Include = "SellersID,lastName,name")] Sellers sellers)
        {
            if (ModelState.IsValid)
            {
                db.Sellers.Add(sellers);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(sellers));
        }
Esempio n. 23
0
 public void LoadSellers()
 {
     //this function will load the data into grid
     if (Session["user"] != null)
     {
         String curremail = Session["user"].ToString();
         myDAL  objDAL    = new myDAL();
         Sellers.DataSource = objDAL.SellerProfile_DAL(curremail);
         Sellers.DataBind();
     }
 }
Esempio n. 24
0
        public async Task <IActionResult> Create([Bind("SellerId,SellerName,MobileNumber,Address,Email,GSTNumber,AccountNumber")] Sellers sellers)
        {
            if (ModelState.IsValid)
            {
                _context.Add(sellers);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AccountNumber"] = new SelectList(_context.SellerAccounts, "AccountNumber", "BankName", sellers.AccountNumber);
            return(View(sellers));
        }
Esempio n. 25
0
 public void GetNewSellers(int count)
 {
     for (int i = 0; i < count; i++)
     {
         var seller = new Seller()
         {
             SellerId = Sellers.Count + 1,
             Name     = GetRandomText()
         };
         Sellers.Add(seller);
     }
 }
Esempio n. 26
0
        private void UpdateSellers()
        {
            Console.WriteLine("{0} updating sellers and saving", DateTime.Now.Ticks);
            Sellers.Select(s =>
            {
                s.Update();
                return(s);
            }).ToList();

            //TODO nur wenn validation ok ist, abspeichern
            //_dataService.Save();
        }
Esempio n. 27
0
        //To View Sellers Profile
        public ActionResult SellerDetails(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Sellers sellers = db.Sellers.Find(id);

            if (sellers == null)
            {
                return(HttpNotFound());
            }
            return(View(sellers));
        }
Esempio n. 28
0
        public ShopComputerModel()
        {
            var sellers = Generator.GetNewSeller(20);

            Generator.GetNewProduct(1000);
            foreach (var seller in sellers)
            {
                Sellers.Enqueue(seller);
            }
            for (int i = 0; i < 3; i++)
            {
                CashDesks.Add(new CashDesk(CashDesks.Count, Sellers.Dequeue()));
            }
        }
        public async Task <IActionResult> OnGetAsync(long?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Sellers = await _context.Sellers.FirstOrDefaultAsync(m => m.ID == id);

            if (Sellers == null)
            {
                return(NotFound());
            }
            return(Page());
        }
        public async Task <IActionResult> Create(Sellers seller)
        {
            if (!ModelState.IsValid)
            {
                var departments = await _departmentService.FindAllAsync();

                var viewModel = new SellerFormViewModel {
                    Seller = seller, Departments = departments
                };
                return(View(viewModel));
            }
            await _sellerService.InsertAsync(seller);

            return(RedirectToAction(nameof(Index)));
        }