Exemplo n.º 1
0
        public async Task <IActionResult> Edit(Guid id, [Bind("Id,Iduser,Idfactorstate,Idbankstate,Isactive,Datecreate,Datechangestate,Idproductaddress,Authority,Idproductpaytype")] Factor1 factor1)
        {
            if (id != factor1.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(factor1);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!Factor1Exists(factor1.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Idbankstate"]      = new SelectList(_context.Bankstates, "Id", "Id", factor1.Idbankstate);
            ViewData["Idfactorstate"]    = new SelectList(_context.Factorstates, "Id", "Id", factor1.Idfactorstate);
            ViewData["Idproductaddress"] = new SelectList(_context.Productaddresses, "Id", "Id", factor1.Idproductaddress);
            ViewData["Idproductpaytype"] = new SelectList(_context.Productpaytypes, "Id", "Id", factor1.Idproductpaytype);
            //ViewData["Iduser"] = new SelectList(_context.AspNetUsers, "Id", "Id", factor1.Iduser);
            return(View(factor1));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Edit(Guid id, [Bind("Id,Iduser,Idfactorstate,Idstatebank,Isactive,Datecreate,Datechangestate,Addressreceiver")] Factor1 factor1)
        {
            if (id != factor1.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(factor1);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!Factor1Exists(factor1.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(Redirect("/Admin/Factor1/Index"));
            }
            ViewData["Idfactorstate"] = new SelectList(_context.Factorstates, "Id", "Id", factor1.Idfactorstate);
            //ViewData["Iduser"] = new SelectList(_context.AspNetUsers, "Id", "Id", factor1.Iduser);
            return(View(factor1));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Upfactorstate(
            Factor1 factor1)
        {
            var selects = await _context.Factors1.FindAsync(factor1.Id);

            selects.Idfactorstate = factor1.Idfactorstate;
            _context.Factors1.Update(selects);
            await _context.SaveChangesAsync();

            ViewData["Idfactorstate"] = new SelectList(_context.Factorstates, "Id", "Name");
            return(Redirect("/Admin/Factor1/Details/" + factor1.Id));
            //return View("Details", factor1.Id);
        }
Exemplo n.º 4
0
        public async Task <IActionResult> Create([Bind("Id,Iduser,Idfactorstate,Idstatebank,Isactive,Datecreate,Datechangestate,Addressreceiver")] Factor1 factor1)
        {
            if (ModelState.IsValid)
            {
                factor1.Id = Guid.NewGuid();
                _context.Add(factor1);
                await _context.SaveChangesAsync();

                return(Redirect("/Admin/Factor1/Index"));
            }
            ViewData["Idfactorstate"] = new SelectList(_context.Factorstates, "Id", "Name", factor1.Idfactorstate);
            //ViewData["Iduser"] = new SelectList(_context.AspNetUsers, "Id", "Id", factor1.Iduser);
            return(View(factor1));
        }
Exemplo n.º 5
0
        public async Task <IActionResult> Create([Bind("Id,Iduser,Idfactorstate,Idbankstate,Isactive,Datecreate,Datechangestate,Idproductaddress,Authority,Idproductpaytype")] Factor1 factor1)
        {
            if (ModelState.IsValid)
            {
                factor1.Id = Guid.NewGuid();
                _context.Add(factor1);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Idbankstate"]      = new SelectList(_context.Bankstates, "Id", "Id", factor1.Idbankstate);
            ViewData["Idfactorstate"]    = new SelectList(_context.Factorstates, "Id", "Id", factor1.Idfactorstate);
            ViewData["Idproductaddress"] = new SelectList(_context.Productaddresses, "Id", "Id", factor1.Idproductaddress);
            ViewData["Idproductpaytype"] = new SelectList(_context.Productpaytypes, "Id", "Id", factor1.Idproductpaytype);
            //ViewData["Iduser"] = new SelectList(_context.AspNetUsers, "Id", "Id", factor1.Iduser);
            return(View(factor1));
        }