Exemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("Id,StatusTypeDescription")] StatusTypes statusTypes)
        {
            if (ModelState.IsValid)
            {
                _context.Add(statusTypes);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(statusTypes));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("Id,TeamDescription,TeamEmailAddress")] Teams teams)
        {
            if (ModelState.IsValid)
            {
                _context.Add(teams);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(teams));
        }
        public async Task <IActionResult> Create([Bind("Id,MemberUserid,MemberFirstName,MemberLastName,MemberFullName,MemberEmail,MemberPhone")] Members members)
        {
            if (ModelState.IsValid)
            {
                _context.Add(members);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(members));
        }
Exemplo n.º 4
0
        public async Task <IActionResult> Create([Bind("Id,Subject,StartTime,EndTime,Location,Notes,MsgId,MsgSequence,SenderEmail,RecipientEmail")] Appointments appointments)
        {
            if (ModelState.IsValid)
            {
                _context.Add(appointments);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(appointments));
        }
        public async Task <IActionResult> Create([Bind("Id,FileSystemUpload,Adactive,EmailConfirmation,ModifiedBy,Modified,AppAdmin,BackAdmin,Ldapconn,Ldappath,ManageHremail,ManageHremailPass,Smtphost,Smtpport,EnableSsl")] ApplicConfs applicConfs)
        {
            if (ModelState.IsValid)
            {
                _context.Add(applicConfs);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(applicConfs));
        }
        public async Task <IActionResult> Create([Bind("Id,SAmaccountName,DisplayName,Mail,Title,TelephoneNumber,GivenName,Sn,Company,WwWhomePage,Mobile,Cn,Appusername")] Adinformations adinformations)
        {
            if (ModelState.IsValid)
            {
                _context.Add(adinformations);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(adinformations));
        }
Exemplo n.º 7
0
        public async Task <IActionResult> Create([Bind("Id,StepDescription,StepNumber,LastUpdated,Active,RequestType")] RequestTypeSteps requestTypeSteps)
        {
            if (ModelState.IsValid)
            {
                _context.Add(requestTypeSteps);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["RequestType"] = new SelectList(_context.RequestTypes, "Id", "RequestTypeDescription", requestTypeSteps.RequestType);
            return(View(requestTypeSteps));
        }
        public async Task <IActionResult> Create([Bind("Id,RequestTypeDescription,LastUpdated,Active,Team")] RequestTypes requestTypes)
        {
            if (ModelState.IsValid)
            {
                _context.Add(requestTypes);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Team"] = new SelectList(_context.Teams, "Id", "TeamDescription", requestTypes.Team);
            return(View(requestTypes));
        }
        public async Task <IActionResult> Create([Bind("Id,StatusDescription,LastUpdated,Active,StatusType")] StatusSets statusSets)
        {
            if (ModelState.IsValid)
            {
                _context.Add(statusSets);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["StatusType"] = new SelectList(_context.StatusTypes, "Id", "StatusTypeDescription", statusSets.StatusType);
            return(View(statusSets));
        }
        public async Task <IActionResult> Create([Bind("Id,FileName,Extension,ServiceRequestId")] FileDetails fileDetails)
        {
            if (ModelState.IsValid)
            {
                fileDetails.Id = Guid.NewGuid();
                _context.Add(fileDetails);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ServiceRequestId"] = new SelectList(_context.ServiceRequests, "Id", "RequestDescription", fileDetails.ServiceRequestId);
            return(View(fileDetails));
        }
        public async Task <IActionResult> Create([Bind("Id,LastUpdated,RequestTypeStep,ServiceRequest")] StepHistories stepHistories)
        {
            if (ModelState.IsValid)
            {
                _context.Add(stepHistories);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["RequestTypeStep"] = new SelectList(_context.RequestTypeSteps, "Id", "StepDescription", stepHistories.RequestTypeStep);
            ViewData["ServiceRequest"]  = new SelectList(_context.ServiceRequests, "Id", "RequestDescription", stepHistories.ServiceRequest);
            return(View(stepHistories));
        }
        public async Task <IActionResult> Create([Bind("Id,AssignedBy,DateAssigned,ServiceRequest,Team")] TeamAssignmentHistories teamAssignmentHistories)
        {
            if (ModelState.IsValid)
            {
                _context.Add(teamAssignmentHistories);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ServiceRequest"] = new SelectList(_context.ServiceRequests, "Id", "RequestDescription", teamAssignmentHistories.ServiceRequest);
            ViewData["Team"]           = new SelectList(_context.Teams, "Id", "TeamDescription", teamAssignmentHistories.Team);
            return(View(teamAssignmentHistories));
        }
Exemplo n.º 13
0
        public async Task <IActionResult> Create([Bind("Id,AssignedTo,AssignedBy,DateAssigned,ServiceRequest")] IndividualAssignmentHistories individualAssignmentHistories)
        {
            if (ModelState.IsValid)
            {
                _context.Add(individualAssignmentHistories);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AssignedTo"]     = new SelectList(_context.Members, "Id", "MemberEmail", individualAssignmentHistories.AssignedTo);
            ViewData["ServiceRequest"] = new SelectList(_context.ServiceRequests, "Id", "RequestDescription", individualAssignmentHistories.ServiceRequest);
            return(View(individualAssignmentHistories));
        }
Exemplo n.º 14
0
        public async Task <IActionResult> Create([Bind("Id,Member,Team")] TeamMembers teamMembers)
        {
            if (ModelState.IsValid)
            {
                _context.Add(teamMembers);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Member"] = new SelectList(_context.Members, "Id", "MemberEmail", teamMembers.Member);
            ViewData["Team"]   = new SelectList(_context.Teams, "Id", "TeamDescription", teamMembers.Team);
            return(View(teamMembers));
        }
        public async Task <IActionResult> Create([Bind("Id,NoteDescription,LastUpdated,WrittenBy,ServiceRequest")] ServiceRequestNotes serviceRequestNotes)
        {
            if (ModelState.IsValid)
            {
                _context.Add(serviceRequestNotes);

                serviceRequestNotes.LastUpdated = DateTime.Now;
                serviceRequestNotes.WrittenBy   = User.Identity.Name;


                await _context.SaveChangesAsync();

                //return RedirectToAction(nameof(Index));
                string returncontroller = TempData["rc"] as string;
                return(RedirectToAction("Index", returncontroller));
            }
            ViewData["ServiceRequest"] = new SelectList(_context.ServiceRequests, "Id", "RequestDescription", serviceRequestNotes.ServiceRequest);
            return(View(serviceRequestNotes));
        }
        public async Task <IActionResult> Create([Bind("Id,RequestHeading,RequestDescription,RequestorId,RequestorFirstName,RequestorLastName,RequestorPhone,RequestorEmail,DateTimeSubmitted,DateTimeStarted,DateTimeCompleted,Priority,RequestType,RequestTypeStep,Member,Status,Team")] ServiceRequests serviceRequests, ICollection <IFormFile> files)
        {
            if (ModelState.IsValid)
            {
                string homePhone;
                string givenName;
                string surname;
                string email;

                Boolean ADconf = _context.ApplicConfs.Select(s => s.Adactive).FirstOrDefault();

                if (ADconf)
                {
                    GetADinfo(out givenName, out surname, out homePhone, out email);
                    ViewBag.RequestorFirstName = givenName;
                    ViewBag.RequestorLastName  = surname;
                    ViewBag.RequestorPhone     = homePhone;
                    ViewBag.RequestorEmail     = email;
                }



                _context.ServiceRequests.Include(i => i.IndividualAssignmentHistories).Include(i => i.TeamAssignmentHistories).Include(i => i.FileDetails);
                _context.ServiceRequests.Add(serviceRequests);
                serviceRequests.DateTimeSubmitted = DateTime.Now;
                serviceRequests.Status            = 1;
                serviceRequests.RequestorId       = User.Identity.Name;

                //================================================================================
                //Create a history record for team assignment

                serviceRequests.TeamAssignmentHistories.Add(new TeamAssignmentHistories()
                {
                    DateAssigned   = DateTime.Now,
                    AssignedBy     = User.Identity.Name,
                    ServiceRequest = serviceRequests.Id,
                    Team           = serviceRequests.Team
                });
                //================================================================================

                //================================================================================
                //Create history record for individual assignment
                serviceRequests.IndividualAssignmentHistories.Add(new IndividualAssignmentHistories()
                {
                    DateAssigned = DateTime.Now,
                    AssignedBy   = User.Identity.Name,
                    //AssignedTo = "A3HR.Lyndon",
                    AssignedTo     = serviceRequests.Member.Value,
                    ServiceRequest = serviceRequests.Id
                });
                //================================================================================

                //Create request step history record===============================================
                serviceRequests.StepHistories.Add(new StepHistories()
                {
                    LastUpdated     = DateTime.Now,
                    RequestTypeStep = serviceRequests.RequestTypeStep.Value,
                    ServiceRequest  = serviceRequests.Id
                });

                //=================================================================================



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

                //Check and see if in application configuration email confirmation is set on========
                Boolean emailconf = _context.ApplicConfs.Select(s => s.EmailConfirmation).FirstOrDefault();

                if (emailconf)
                {
                    SendStatusConfirmation(1, serviceRequests.RequestorEmail);
                }


                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Member"]          = new SelectList(_context.Members, "Id", "MemberEmail", serviceRequests.Member);
            ViewData["Priority"]        = new SelectList(_context.Priorities, "Id", "PriorityDescription", serviceRequests.Priority);
            ViewData["RequestType"]     = new SelectList(_context.RequestTypes, "Id", "RequestTypeDescription", serviceRequests.RequestType);
            ViewData["RequestTypeStep"] = new SelectList(_context.RequestTypeSteps, "Id", "StepDescription", serviceRequests.RequestTypeStep);
            ViewData["Status"]          = new SelectList(_context.StatusSets, "Id", "StatusDescription", serviceRequests.Status);
            ViewData["Team"]            = new SelectList(_context.Teams, "Id", "TeamDescription", serviceRequests.Team);
            return(View(serviceRequests));
        }