Esempio n. 1
0
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.

        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            SupportTickets.CreatedDate = DateTime.Now;
            SupportTickets.UpdatedDate = null;
            SupportTickets.Status      = "Pending";
            SupportTickets.pathFile    = ProcessUploadedFile();

            _context.SupportTickets.Add(SupportTickets);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Response"));
        }
Esempio n. 2
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            SupportTickets = await _context.SupportTickets.FindAsync(id);

            if (SupportTickets != null)
            {
                _context.SupportTickets.Remove(SupportTickets);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
Esempio n. 3
0
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.

        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            SupportTickets.UpdatedDate = DateTime.Now;


            SupportTickets.Assigned = Request.Form["AssignedData"].ToString();
            SupportTickets.Status   = Request.Form["StatusData"].ToString();


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


            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!SupportTicketsExists(SupportTickets.Id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }


            return(RedirectToPage("./Index"));
        }