Beispiel #1
0
        public IActionResult OnGetDelete(long id)
        {
            TblEmployeeRequestEmployeeRequest TblEmployeeRequestEmployeeRequest2 = _context.TblEmployeeRequestEmployeeRequests.Find(id);

            if (TblEmployeeRequestEmployeeRequest2 != null)
            {
                _context.TblEmployeeRequestEmployeeRequests.Remove(TblEmployeeRequestEmployeeRequest2);
                _context.SaveChanges();
            }
            return(RedirectToPage("Index"));
        }
        public IActionResult OnGetDelete(long id)
        {
            string uid = HttpContext.Session.GetString("uid");

            if (uid == null)
            {
                return(RedirectToPage("../Index"));
            }
            TblEmployeeRequestEmployeeRequest TblEmployeeRequestEmployeeRequest2 = _context.TblEmployeeRequestEmployeeRequests.Find(id);

            if (TblEmployeeRequestEmployeeRequest2 != null)
            {
                _context.TblEmployeeRequestEmployeeRequests.Remove(TblEmployeeRequestEmployeeRequest2);
                _context.SaveChanges();
            }
            return(RedirectToPage("Index"));
        }
        public async Task <IActionResult> OnGetAsync(long?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            TblEmployeeRequestEmployeeRequest = await _context.TblEmployeeRequestEmployeeRequests
                                                .Include(t => t.FldEmployeeRequestJobOnet)
                                                .Include(t => t.FldEmployeeRequestJobTamin)
                                                .Include(t => t.FldEmployeeRequestJobTitleFrom)
                                                .Include(t => t.FldEmployeeRequestJobs)
                                                .Include(t => t.FldEmployeeRequestUserAccepter)
                                                .Include(t => t.FldEmployeeRequestUserApplicant)
                                                .Include(t => t.FldEmployeeRequestUserSubmitter).FirstOrDefaultAsync(m => m.FldEmployeeRequestEmployeeRequestId == id);

            if (TblEmployeeRequestEmployeeRequest == null)
            {
                return(NotFound());
            }

            ViewData["FldEmployeeRequestJobTitleFromId"]  = new SelectList(_context.TblEmployeeRequestJobTitleFroms, "TblEmployeeRequestJobTitleFromId", "TblEmployeeRequestJobTitleFromTitle");
            ViewData["FldEmployeeRequestUserApplicantId"] = new SelectList(_context.TblEmployeeRequestUsers, "FldEmployeeRequestUserId", "FldEmployeeRequestUserUsername");
            ViewData["FldEmployeeRequestUserSubmitterId"] = new SelectList(_context.TblEmployeeRequestUsers, "FldEmployeeRequestUserId", "FldEmployeeRequestUserUsername");
            ViewData["startdate"] = TblEmployeeRequestEmployeeRequest.FldEmployeeRequestEmployeeRequestStartDate.toPersianDate();
            ViewData["enddate"]   = TblEmployeeRequestEmployeeRequest.FldEmployeeRequestEmployeeRequestEndDate.toPersianDate();

            if (TblEmployeeRequestEmployeeRequest.FldEmployeeRequestJobTaminId != null)
            {
                ViewData["taminjobtitle"] = TblEmployeeRequestEmployeeRequest.FldEmployeeRequestJobTamin.FldTaminJobName;
            }

            if (TblEmployeeRequestEmployeeRequest.FldEmployeeRequestJobOnetId != null)
            {
                ViewData["onetjobtitle"] = TblEmployeeRequestEmployeeRequest.FldEmployeeRequestJobOnet.FldJobName;
            }

            if (TblEmployeeRequestEmployeeRequest.FldEmployeeRequestJobsId != null)
            {
                ViewData["jobtitle"] = TblEmployeeRequestEmployeeRequest.FldEmployeeRequestJobs.JobsName;
            }

            return(Page());
        }
        public IActionResult OnGetDeny(long id)
        {
            TblEmployeeRequestEmployeeRequest TblEmployeeRequestEmployeeRequest2 = _context.TblEmployeeRequestEmployeeRequests.Find(id);

            if (TblEmployeeRequestEmployeeRequest2 != null)
            {
                string uid = HttpContext.Session.GetString("uid");
                if (uid == null)
                {
                    return(RedirectToPage("../Index"));
                }
                TblEmployeeRequestEmployeeRequest2.FldEmployeeRequestEmployeeRequestIsAccept   = false;
                TblEmployeeRequestEmployeeRequest2.FldEmployeeRequestEmployeeRequestAcceptDate = DateTime.Now;
                TblEmployeeRequestEmployeeRequest2.FldEmployeeRequestUserAccepterId            = int.Parse(uid);
                _context.TblEmployeeRequestEmployeeRequests.Update(TblEmployeeRequestEmployeeRequest2);
                _context.SaveChanges();
            }
            return(RedirectToPage("Index"));
        }
Beispiel #5
0
        public IActionResult OnGetTransfer(long id)
        {
            string uid = HttpContext.Session.GetString("uid");

            if (uid == null)
            {
                return(RedirectToPage("../Index"));
            }
            TblEmployeeRequestEmployeeRequest TblEmployeeRequestEmployeeRequest2 = _context.TblEmployeeRequestEmployeeRequests
                                                                                   .Include(t => t.FldEmployeeRequestJobs)
                                                                                   .Include(t => t.FldEmployeeRequestJobOnet)
                                                                                   .Include(t => t.FldEmployeeRequestJobTamin)
                                                                                   .Where(a => a.FldEmployeeRequestEmployeeRequestId == id)
                                                                                   .FirstOrDefault();

            if (TblEmployeeRequestEmployeeRequest2 != null)
            {
                TblEmployeeRequestEmployeeRequest2.FldEmployeeRequestEmployeeRequestIsTransfered = true;
                TblEmployeeRequestEmployeeRequest2.FldEmployeeRequestEmployeeRequestTransferDate = DateTime.Now;
                _context.TblEmployeeRequestEmployeeRequests.Update(TblEmployeeRequestEmployeeRequest2);
                _context.SaveChanges();
            }
            return(RedirectToPage("Index"));
        }