public ActionResult Create([Bind(Include = "EmpCVID,CvName,CvContent,EmpProfileID")] EmpCV empCV, HttpPostedFileBase upload)
        {
            if (ModelState.IsValid)
            {
                if (upload != null && upload.ContentLength > 0)
                {
                    if (empCV.CvName == null)
                    {
                        empCV.CvName = System.IO.Path.GetFileName(upload.FileName);
                        byte[] data = new byte[upload.ContentLength];
                        upload.InputStream.Read(data, 0, upload.ContentLength);
                        empCV.CvContent = data;
                    }
                    else
                    {
                        byte[] data = new byte[upload.ContentLength];
                        upload.InputStream.Read(data, 0, upload.ContentLength);
                        empCV.CvContent = data;
                    }
                }

                db.EmpCVs.Add(empCV);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.EmpProfileID = new SelectList(db.EmpProfiles, "EmpProfileID", "UserID", empCV.EmpProfileID);
            return(View(empCV));
        }
Exemple #2
0
 public ActionResult Create([Bind(Include = "CompanyProfileID,UserID,PersonName,PersonContact,Category,Address,City,OfficeContact,GroupOfCompany,OwnerName,HRHead,CompanyWebsite,NoOfOffices,Fax,OperatingSince,NoOfEmployees,OwnershipType")] CompanyProfile companyProfile)
 {
     if (ModelState.IsValid)
     {
         db.CompanyProfiles.Add(companyProfile);
         db.SaveChanges();
         return(RedirectToAction("Index", "CompanyDashboard"));
     }
     return(View(companyProfile));
 }
 public ActionResult Create([Bind(Include = "EmpProfileID,FirstName,LastName,Gender,DOB,University,City,Nationality,CNIC,Contact,Address,UserID")] EmpProfile empProfile)
 {
     if (ModelState.IsValid)
     {
         db.EmpProfiles.Add(empProfile);
         db.SaveChanges();
         return(RedirectToAction("Index", "Dashboard"));
     }
     return(View(empProfile));
 }
        public ActionResult Create([Bind(Include = "EmpSkillID,SkillTitle,Category,Usage,EmpProfileID")] EmpSkill empSkill)
        {
            if (ModelState.IsValid)
            {
                db.EmpSkills.Add(empSkill);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.EmpProfileID = new SelectList(db.EmpProfiles, "EmpProfileID", "FirstName", empSkill.EmpProfileID);
            return(View(empSkill));
        }
Exemple #5
0
        public ActionResult Create([Bind(Include = "EmpProfileID,SchoolName,SchoolYearPassing,SchoolDegree,CollegeName,CollegeYearPassing,CollegeDegree,UniverstyName,DepartmentName,UniverstyYearPassing,GPA,Description")] Qualification qualification)
        {
            if (ModelState.IsValid)
            {
                db.Qualifications.Add(qualification);
                db.SaveChanges();
                return(RedirectToAction("Index", "Dashboard"));
            }

            ViewBag.EmpProfileID = new SelectList(db.EmpProfiles, "EmpProfileID", "UserID", qualification.EmpProfileID);
            return(View(qualification));
        }
        public ActionResult Create([Bind(Include = "EmpWorkExperienceID,ExperienceType,JobTitle,Category,Company,StartDate,EndDate,Current,Salary,EmpProfileID")] EmpWorkExperience empWorkExperience)
        {
            if (ModelState.IsValid)
            {
                db.EmpWorkExperiences.Add(empWorkExperience);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.EmpProfileID = new SelectList(db.EmpProfiles, "EmpProfileID", "FirstName", empWorkExperience.EmpProfileID);
            return(View(empWorkExperience));
        }
        public ActionResult Create([Bind(Include = "CompanyJobPostID,Industry,FunctionArea,TotalPosition,JobType,JobLocation,Gender,Age,MinimumEducation,DegreeTitle,CareerLevel,ApplyBy,JobPostingDate,JobDescription,CompanyProfileID")] CompanyJobPost companyJobPost)
        {
            if (ModelState.IsValid)
            {
                db.CompanyJobPosts.Add(companyJobPost);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            string CurrentUser          = User.Identity.GetUserId();
            int    CurrentUserProfileID = db.CompanyProfiles.Where(r => r.UserID == CurrentUser).First().CompanyProfileID;

            ViewBag.CompanyProfileID = CurrentUserProfileID;

            // ViewBag.CompanyProfileID = new SelectList(db.CompanyProfiles, "CompanyProfileID", "UserID", companyJobPost.CompanyProfileID);
            return(View(companyJobPost));
        }
        public ActionResult Create([Bind(Include = "EmpProfileID,PhotoName,PhotoContent")] ProfilePhoto profilePhoto, HttpPostedFileBase upload)
        {
            if (ModelState.IsValid)
            {
                if (upload != null && upload.ContentLength > 0)
                {
                    profilePhoto.PhotoName = System.IO.Path.GetFileName(upload.FileName);
                    byte[] data = new byte[upload.ContentLength];
                    upload.InputStream.Read(data, 0, upload.ContentLength);

                    profilePhoto.PhotoContent = data;
                }
                db.ProfilePhotos.Add(profilePhoto);
                db.SaveChanges();
                return(RedirectToAction("Index", "Dashboard"));
            }
            return(PartialView(profilePhoto));
        }
        public ActionResult Create([Bind(Include = "CompanyJobPostID,EmpProfileID")] JobApplication jobApplication)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    db.JobApplications.Add(jobApplication);
                    db.SaveChanges();
                    return(RedirectToAction("Index", "Dashboard"));
                }
            }
            catch (Exception ex)
            {
                return(View("DuplicateJobApplication", new HandleErrorInfo(ex, "EmployeeInfo", "Create")));
            }
            ViewBag.CompanyJobPostID = jobApplication.CompanyJobPostID;
            ViewBag.EmpProfileID     = jobApplication.EmpProfileID;

            return(View(jobApplication));
        }