Esempio n. 1
0
        // GET: Recruitment/Edit/5
        public async Task <ActionResult> Edit(int id)
        {
            if (TempData["error"] != null)
            {
                ViewBag.error = TempData["error"];
            }
            if (TempData["status"] != null)
            {
                ViewBag.status = TempData["status"];
            }


            RecruitmentService recruiterService = new RecruitmentService();

            var recruitment          = recruiterService.GetRecruiterWithId(id);
            RecruitmentViewModel rvm = new RecruitmentViewModel();

            rvm.RecruitmentId         = recruitment.RecruitmentId;
            rvm.Email                 = recruitment.Email;
            rvm.RecruiterId           = recruitment.RecruiterId;
            rvm.RecruiterName         = User.Identity.Name;
            rvm.PhoneNumber           = recruitment.PhoneNumber;
            rvm.FirstName             = recruitment.FirstName;
            rvm.LastName              = recruitment.LastName;
            rvm.LookupEmployementType = recruitment.LookupEmployementType;
            rvm.AvailableDate         = recruitment.AvailableDate;
            rvm.Notes                 = recruitment.Notes;
            rvm.CurrentLocation       = recruitment.CurrentLocation;
            rvm.C2CCompanyName        = recruitment.C2CCompanyName;
            rvm.C2CContactNumber      = recruitment.C2CContactNumber;
            rvm.C2CContactPerson      = recruitment.C2CContactPerson;
            rvm.C2CEmail              = recruitment.C2CEmail;
            rvm.LookupVisaStatus      = recruitment.LookupVisaStatus;
            rvm.PrimarySkillSet       = recruitment.PrimarySkillSet;
            rvm.SecondarySkillSet     = recruitment.SecondarySkillSet;
            rvm.CreatedDate           = recruitment.CreatedDate;
            rvm.CreatedUserId         = recruitment.CreatedUserId;
            rvm.VisaStatusList        = GetLookUpDropDownList("VisaStatus", null);
            rvm.EmployementTypeList   = GetLookUpDropDownList("EmployementType", null);
            rvm.CandidateStatusList   = GetLookUpDropDownList("CandidateStatus", null);
            rvm.RFileList             = recruiterService.GetRecruitFilesWithId(id);

            rvm.RecruitmentClientList = recruiterService.GetRecruitmentClientWithId(id);
            return(View(rvm));
        }
Esempio n. 2
0
        public ActionResult SoftDelete(int id)
        {
            try
            {
                RecruitmentService recruitmentservice = new RecruitmentService();
                Recruitment        employeerecord     = recruitmentservice.GetRecruiterWithId(id);

                employeerecord.IsActive  = false;
                employeerecord.IsDeleted = true;
                recruitmentservice.SoftDeleteRecruitment(employeerecord);
                TempData["status"] = "Employee Record successfully deleted";
                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                TempData["error"] = "Something went wrong while deleting Employee Record";
                return(View());
            }
        }