예제 #1
0
        public ActionResult Upload33(HttpPostedFileBase file)
        {
            Resume res = new Resume();


            if (file.ContentLength > 0)
            {
                string filename = Path.GetFileName(file.FileName);
                string filepath = Path.Combine(Server.MapPath("~/CVFILE"), filename);
                file.SaveAs(filepath);

                res.CvFileText = filepath;
                res.CvFileName = filename;
                int a = Convert.ToInt32(Session["SeekerId"]);
                var b = new JOB_PORTAL_3Entities();
                b.Database.ExecuteSqlCommand("Update Jobseeker set ResumeFileName='" + filename + "' where JobSeekerId=" + a + "");
                db.SaveChanges();
                //return RedirectToAction("Index");
                //resume.CvFileText = filepath;
            }
            JOB_PORTAL_3Entities db1 = new JOB_PORTAL_3Entities();



            res.JobSeekerId      = Convert.ToInt32(Session["SeekerId"]);
            res.ResumeUploadDate = System.DateTime.Now;
            res.CvFile           = Encoding.UTF8.GetBytes(res.CvFileText);
            db.Resumes.Add(res);
            db.SaveChanges();
            return(RedirectToAction("AfterLogin", "JobSeekers"));
        }
예제 #2
0
        public ActionResult ContactSubmit(string a, string b, string c, string d)
        {
            JOB_PORTAL_3Entities DD = new JOB_PORTAL_3Entities();
            ContactU             cc = new ContactU();

            cc.FullName = a;
            cc.Email    = b;
            cc.Phone    = c;
            cc.Message  = d;
            DD.ContactUs.Add(cc);
            DD.SaveChanges();
            return(RedirectToAction("Index1"));
        }
예제 #3
0
 public ActionResult Insert(Job account)
 {
     if (ModelState.IsValid)
     {
         using (JOB_PORTAL_3Entities db = new JOB_PORTAL_3Entities())
         {
             db.Jobs.Add(account);
             db.SaveChanges();
         }
         ModelState.Clear();
         ViewBag.EmployerRegistrationMessage = account.JobName + " successfully registered";
     }
     return(View());
 }
예제 #4
0
 public ActionResult ProPicInsert(HttpPostedFileBase file)
 {
     if (file.ContentLength > 0)
     {
         string filename = Path.GetFileName(file.FileName);
         string filepath = Path.Combine(Server.MapPath("~/PROFILEPICTURE"), filename);
         file.SaveAs(filepath);
         int a = Convert.ToInt32(Session["SeekerId"]);
         var b = new JOB_PORTAL_3Entities();
         b.Database.ExecuteSqlCommand("Update Jobseeker set ProfilePictureName='" + filename + "' where JobSeekerId=" + a + "");
         db.SaveChanges();
         //return RedirectToAction("Index");
         //resume.CvFileText = filepath;
     }
     return(RedirectToAction("AfterLogin"));
 }
예제 #5
0
        public ActionResult SeekerLogin(JobSeeker user)
        {
            var loginSuccess = false;

            using (JOB_PORTAL_3Entities db = new JOB_PORTAL_3Entities())
            {
                try
                {
                    var usr = db.JobSeekers.Single(u => u.JobSeekerUsername == user.JobSeekerUsername && u.JobSeekerPassword == user.JobSeekerPassword);
                    if (usr != null)
                    {
                        Session["SeekerId"] = usr.JobSeekerId.ToString();

                        /* Session["EmployerId1"] = usr.EmployerId;
                         * ViewBag.id = usr.EmployerId;
                         *
                         * Convert.ToInt32(Session["EmployerId1"]);*/

                        loginSuccess = true;
                        if (usr.ProfilePictureName != null)
                        {
                            Session["SeekerPic"] = usr.ProfilePictureName.ToString();
                        }

                        Session["SeekerUsername"] = usr.JobSeekerUsername.ToString();
                        return(RedirectToAction("AfterLogin", "JobSeekers"));
                    }
                }
                catch (InvalidOperationException e)
                {
                }
            }

            if (loginSuccess == false)
            {
                //ModelState.AddModelError("", " username or password is wrong");
                Session["EmployerLoginFail1"] = "username or password is wrong";
                return(RedirectToAction("SeekerLogin", "JobSeekers"));
            }

            return(View());
        }