Exemple #1
0
        public async Task <ActionResult> Create([Bind(Include = "Id,Email,EmailConfirmed,PasswordHash,SecurityStamp,PhoneNumber,PhoneNumberConfirmed,TwoFactorEnabled,LockoutEndDateUtc,LockoutEnabled,AccessFailedCount,UserName")] user user)
        {
            if (ModelState.IsValid)
            {
                db.users.Add(user);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(user));
        }
        public async Task <ActionResult> Create([Bind(Include = "company_id,name,address,phone_number,contact_person_name,contact_person_phone,registration_date,logo")] company company)
        {
            if (ModelState.IsValid)
            {
                db.companies.Add(company);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(company));
        }
Exemple #3
0
        public async Task <ActionResult> Create([Bind(Include = "Id,Name")] role role)
        {
            if (ModelState.IsValid)
            {
                db.roles.Add(role);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(role));
        }
        public async Task <ActionResult> Create([Bind(Include = "category_id,name,visual_name,title,image,precedence")] category category)
        {
            if (ModelState.IsValid)
            {
                db.categories.Add(category);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(category));
        }
        public async Task <ActionResult> Create([Bind(Include = "voucher_id,image,valid_start_date,valid_end_date,description,active,last_updated")] voucher voucher)
        {
            if (ModelState.IsValid)
            {
                db.vouchers.Add(voucher);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(voucher));
        }
        public async Task <ActionResult> Create([Bind(Include = "admin_person_id,identity_user_id,first_name,last_name,email,phone_number,active,last_update")] admin_persons admin_persons)
        {
            if (ModelState.IsValid)
            {
                db.admin_persons.Add(admin_persons);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            ViewBag.identity_user_id = new SelectList(db.users, "Id", "Email", admin_persons.identity_user_id);
            return(View(admin_persons));
        }
Exemple #7
0
        public async Task <ActionResult> Create([Bind(Include = "product_id,product_uid,category_id,image,title,precedence,description,popup,initial_price,discount,price,shipping,final_price")] product product)
        {
            if (ModelState.IsValid)
            {
                db.products.Add(product);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            ViewBag.category_id = new SelectList(db.categories, "category_id", "name", product.category_id);
            ViewBag.product_id  = new SelectList(db.products_in_orders, "id", "id", product.product_id);
            return(View(product));
        }
        public async Task <ActionResult> Create([Bind(Include = "worker_id,identity_user_id,company_id,worker_number,id_number,first_name,last_name,email,phone_number,active,last_update")] worker worker)
        {
            if (ModelState.IsValid)
            {
                db.workers.Add(worker);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            ViewBag.company_id       = new SelectList(db.companies, "company_id", "name", worker.company_id);
            ViewBag.identity_user_id = new SelectList(db.users, "Id", "Email", worker.identity_user_id);
            return(View(worker));
        }
        public async Task <ActionResult> Create([Bind(Include = "order_id,order_uid,worker_id,order_item_type_id,credit_card_auth_id,charge_amount,order_date,comments")] order order)
        {
            if (ModelState.IsValid)
            {
                db.orders.Add(order);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            //ViewBag.order_item_type_id = new SelectList(db.order_item_types, "id", "name", order.order_item_type_id);
            ViewBag.worker_id = new SelectList(db.workers, "worker_id", "identity_user_id", order.worker_id);
            return(View(order));
        }