Exemplo n.º 1
0
        public async Task <IActionResult> OnPostRejectAsync(int ID)
        {
            tApplicant applicant = await _context.tApplicant.SingleOrDefaultAsync(a => a.applicant_id == ID);

            _context.Attach(applicant).State = EntityState.Modified;
            applicant.status = "Rejected";
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index"));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> OnPostRejectAsync(int ID)
        {
            tBatch batch = await _context.tBatch.SingleOrDefaultAsync(b => b.batch_id == ID);

            batchTemp = batch;
            _context.Attach(batch).State = EntityState.Modified;
            batch.approval_status        = "Rejected";
            batch.approved_date          = DateTime.Now.ToString("dd MMM yyyy HH:mm");
            batch.approved_by            = "System";
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index"));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Attach(tUser).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!tUserExists(tUser.user_id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index"));
        }
Exemplo n.º 4
0
        public async Task <IActionResult> OnPostAsync(int ID)
        {
            tAnswer.create_by   = answer.create_by;
            tAnswer.create_date = answer.create_date;
            tAnswer.edit_by     = "System";
            tAnswer.edit_date   = DateTime.Now;
            tAnswer.question_id = answer.question_id;
            if (!ModelState.IsValid)
            {
                return(Page());
            }
            _context.Attach(tAnswer).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!tAnswerExists(tAnswer.answer_id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("/Questions"));
        }
Exemplo n.º 5
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Attach(tType).State = EntityState.Modified;

            try
            {
                tType.create_by   = type.create_by;
                tType.create_date = type.create_date;
                tType.edit_by     = "System";
                tType.edit_date   = DateTime.Now;
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!tTypeExists(tType.type_name))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index"));
        }
Exemplo n.º 6
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Attach(tQuestion).State = EntityState.Modified;
            tQuestion.edit_by         = "System";
            tQuestion.edit_date       = DateTime.Now;
            tQuestion.create_by       = oldQuestion.create_by;
            tQuestion.create_date     = oldQuestion.create_date;
            tQuestion.approval_status = "Approved";
            tQuestion.approved_by     = "System";
            tQuestion.approved_date   = DateTime.Now;
            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!tQuestionExists(tQuestion.question_id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index"));
        }
Exemplo n.º 7
0
        public async Task <IActionResult> OnPostAsync(int?id, int?app)
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }
            applicantProgram.applicant_id           = ap.applicant_id;
            applicantProgram.program_id             = ap.program_id;
            applicantProgram.batch_id               = ap.batch_id;
            _context.Attach(applicantProgram).State = EntityState.Modified;
            await _context.SaveChangesAsync();

            return(Redirect("./Details?id=" + id + "&app=" + app));
        }