Exemplo n.º 1
0
        public async Task <ActionResult> Create([Bind(Include = "Id,Name")] AspNetRole aspNetRole)
        {
            if (ModelState.IsValid)
            {
                db.AspNetRoles.Add(aspNetRole);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(aspNetRole));
        }
Exemplo n.º 2
0
        public async Task <ActionResult> Create([Bind(Include = "ID,Name,Description,InLabWorkingDays,Price,Notes,IsAvailable,IsDigital,PriceEach")] Product product)
        {
            if (ModelState.IsValid)
            {
                db.Products.Add(product);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(product));
        }
Exemplo n.º 3
0
        public async Task <ActionResult> Create([Bind(Include = "ID,Name,Address,City,State,PostalCode,Phone,IsAvailable,licenseNumber")] Client client)
        {
            if (ModelState.IsValid)
            {
                db.Clients.Add(client);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(client));
        }
Exemplo n.º 4
0
        public async Task <ActionResult> Create([Bind(Include = "ID,IdOrder,Teeth,BuccalMargin,LingualMargin,BuccalTissue,Compression,AbutmentsParallel,Note,IdProduct,Contact,Oclussion,Material,Shade,DesignRequirements,ModelServices,ArticulatorType,ModelImplantConnection")] DetailOrder detailOrder)
        {
            if (ModelState.IsValid)
            {
                db.DetailOrders.Add(detailOrder);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            ViewBag.IdOrder = new SelectList(db.Orders, "ID", "Name", detailOrder.IdOrder);
            return(View(detailOrder));
        }
Exemplo n.º 5
0
        public async Task <ActionResult> Create([Bind(Include = "ID,Name,Price,DateDelivery,Location,Score,DateCreation,IdClient,PatientName,PatientLastName,Coupon,Gender,Age")] Order order)
        {
            if (ModelState.IsValid)
            {
                db.Orders.Add(order);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            ViewBag.IdClient = new SelectList(db.Clients, "ID", "Name", order.IdClient);
            return(View(order));
        }
Exemplo n.º 6
0
        public async Task <ActionResult> Create([Bind(Include = "Id,Email,EmailConfirmed,PasswordHash,SecurityStamp,PhoneNumber,PhoneNumberConfirmed,TwoFactorEnabled,LockoutEndDateUtc,LockoutEnabled,AccessFailedCount,UserName,idClient")] AspNetUser aspNetUser)
        {
            if (ModelState.IsValid)
            {
                db.AspNetUsers.Add(aspNetUser);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            ViewBag.idClient = new SelectList(db.Clients, "ID", "Name", aspNetUser.idClient);
            return(View(aspNetUser));
        }
Exemplo n.º 7
0
        public async Task <ActionResult> Create([Bind(Include = "UserId,RoleId")] AspNetUserRole aspNetUserRole)
        {
            if (ModelState.IsValid)
            {
                db.AspNetUserRoles.Add(aspNetUserRole);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            ViewBag.UserId = new SelectList(db.AspNetUsers, "Id", "Email", aspNetUserRole.UserId);
            return(View(aspNetUserRole));
        }