Beispiel #1
0
        public async Task <IActionResult> Create([Bind("Id,Code,Name,KnowledgeId")] Speciality speciality)
        {
            if (ModelState.IsValid)
            {
                _context.Add(speciality);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["KnowledgeId"] = new SelectList(_context.Knowledges, "Id", "Name", speciality.KnowledgeId);                // Custom
            return(View(speciality));
        }
Beispiel #2
0
        public async Task <IActionResult> Create([Bind("Id,Name,Surename,Patronymic,Birthday,DateInput,ProtectionDate,Protection,Course,StatustypeId")] Aspirant aspirant)
        {
            if (ModelState.IsValid)
            {
                _context.Add(aspirant);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["StatustypeId"] = new SelectList(_context.Statuses, "Id", "Name");                             // Custom
            return(View(aspirant));
        }
Beispiel #3
0
        public async Task <IActionResult> Create([Bind("Id,Name,Surename,Patronymic,Birthday,DateInput,ProtectionDate,Protection,Course,StatustypeId,SpecialityId")] Aspirant aspirant)
        {
            if (ModelState.IsValid)
            {
                _context.Add(aspirant);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }                                                                                                                             // Custom
            PopulateStatusesDropDownList(aspirant.StatustypeId);
            return(View(aspirant));
        }
Beispiel #4
0
        public async Task <IActionResult> CreateAsync([Bind("Id,Number,Date,OrdertypeId,Aspirants")] Order order)
        {
            if (ModelState.IsValid)
            {
                //Order order = new Order { Number = orderVM.Number, Date=orderVM.Date, OrdertypeId=orderVM.OrdertypeId};

                // if (order.OrderType.Id == (int)OrderTypeEnum.Переведення)
                //

                _context.Add(order);
                await _context.SaveChangesAsync();
                await AddOrUpdateAssignedAspirants(order);

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

            PopulateOrdertypesDropDownList(order.OrdertypeId);
            return(View(order));
        }