Exemple #1
0
    protected void BindDropDowns()
    {
        PRMS controller = new PRMS();

        PostingDropDown.DataSource     = controller.GetAllJobPostings();
        PostingDropDown.DataTextField  = "Description";
        PostingDropDown.DataValueField = "JobPostingID";
        PostingDropDown.Items.Insert(0, new ListItem("Select Job Posting...", "0"));
        PostingDropDown.DataBind();

        Profession.DataSource     = controller.GetProfessions();
        Profession.DataTextField  = "Description";
        Profession.DataValueField = "ProfessionID";
        Profession.Items.Insert(0, new ListItem("Select Profession...", "0"));
        Profession.DataBind();

        Skillset.DataSource     = controller.GetSkillsets();
        Skillset.DataTextField  = "Description";
        Skillset.DataValueField = "SkillsetID";
        Skillset.Items.Insert(0, new ListItem("Select Skillset...", "0"));
        Skillset.DataBind();

        Region.DataSource     = controller.GetRegions();
        Region.DataTextField  = "Description";
        Region.DataValueField = "RegionID";
        Region.Items.Insert(0, new ListItem("Select Region...", "0"));
        Region.DataBind();
    }
Exemple #2
0
    protected void ChangeEmail_Click(object sender, EventArgs e)
    {
        try
        {
            PRMS Controller = new PRMS();
            if(Controller.ChangeEmail(CurrentUserID, EmailTextBox.Text))
            {
                EmailConfirmation.Text = "Your email has been successfully changed. Please login again with your new email.";
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Your email has been updated. Please login again with your new email.')", true);
                FormsAuthentication.SignOut();
                FormsAuthentication.RedirectToLoginPage();
            }
            else
            {
                EmailConfirmation.Text = "That email is registered under a different user.";
            }
        }
        catch (Exception)
        {

            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert(‘Error occurred with updating email. Please contact customer support for assistance if this issue persists.’)", true);

        }

    }
Exemple #3
0
    protected void Login_Click(object sender, EventArgs e)
    {
        try
        {
            User ReturnUser = new User();
            ReturnUser.UserEmail    = UserEmail.Text;
            ReturnUser.UserPassword = UserPass.Text;

            PRMS con = new PRMS();

            if (con.GetUser(ReturnUser))
            {
                //Createthe authentication ticket
                string UserRole = con.GetRoles(ReturnUser);
                FormsAuthenticationTicket authTicket = new FormsAuthenticationTicket(1, UserEmail.Text, DateTime.Now, DateTime.Now.AddMinutes(60), false, UserRole);
                //Encrypt the ticket
                string encryptedTicket = FormsAuthentication.Encrypt(authTicket);
                //Create a cookie and add the encrypted ticket to the cookie as data
                HttpCookie authCookie = new HttpCookie(FormsAuthentication.FormsCookieName, encryptedTicket);
                //Add the cookie to the cookies collection
                Response.Cookies.Add(authCookie);
                //FormsAuthentication.RedirectFromLoginPage(UserEmail.Text, Persist.Checked);
                Response.Redirect(FormsAuthentication.GetRedirectUrl(UserEmail.Text, false));
            }
            else
            {
                //Msg.Text = "Invalid credentials. Please try again.";
            }
        }
        catch (Exception)
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert(‘Error occurred with logging into the account. Please contact customer support for assistance if this issue persists.’)", true);
        }
    }
Exemple #4
0
    protected void AddProfessionButton_Click(object sender, EventArgs e)
    {
        try
        {
            bool confirmation = false;
            PRMS controller   = new PRMS();

            confirmation = controller.AddProfession(Profession.Text);

            if (confirmation)
            {
                Confirmation.Text = "Profession added successfully.";
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Profession was added successfully.')", true);
            }
            else
            {
                Confirmation.Text = "Error has occurred.";
            }
            Profession.Text = "";
        }
        catch (Exception)
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert(‘Error occurred with adding a profession. Please contact customer support for assistance if this issue persists.’)", true);
        }
    }
Exemple #5
0
    protected void Submit_Click(object sender, EventArgs e)
    {
        try
        {
            PRMS controller = new PRMS();


            List <int> skillsList;
            skillsList = (List <int>)Session["skills"];

            JobPosting newPosting = new JobPosting();

            newPosting.Description   = JobPostingDescription.Text;
            newPosting.CompanyName   = CompanyName.Text;
            newPosting.RegionID      = int.Parse(Region.Text);
            newPosting.ProfessionID  = int.Parse(Profession.Text);
            newPosting.Date          = DateTime.Parse(Date.Text);
            newPosting.EmployerPhone = CompanyPhone.Text;

            int newJobID;
            newJobID = controller.AddJobPosting(newPosting);

            foreach (int skill in skillsList)
            {
                controller.AddJobSkillSets(newJobID, skill);
            }
            ClearForm();
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Job posting added successfully.')", true);
        }
        catch (Exception ex)
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Error occurred while with adding a job posting. Please contact customer support for assistance if this issue persists.')", true);
        }
    }
Exemple #6
0
    protected void Reg_Click(object sender, EventArgs e)
    {
        try
        {
            User NewUser = new User();
            NewUser.UserEmail    = UserEmail.Text;
            NewUser.UserPassword = UserPass.Text;
            NewUser.FirstName    = FirstNameBox.Text;
            NewUser.LastName     = LastNameBox.Text;

            PRMS Control = new PRMS();

            if (Control.AddUser(NewUser))
            {
                Confirmation.Text = "User account created. ";
                Login.Visible     = true;
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Account registered successfully.')", true);
            }
            else
            {
                Confirmation.Text = "Failed to register user";
            }
        }
        catch (Exception)
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Error occurred while with registering account. Please contact customer support for assistance if this issue persists.')", true);
            throw;
        }
    }
Exemple #7
0
    protected void AssignButton_Click(object sender, EventArgs e, int userID, string date)
    {
        try
        {
            bool confirmation = false;

            if (date == "")
            {
                Response.Write("<script language='javascript'>window.alert('You must select a date for the interview.');</script>");
            }
            else
            {
                int  jobPostingID = Convert.ToInt32(Request["JobPostingID"]);
                PRMS controller   = new PRMS();
                confirmation = controller.AssignCandidateToJobPosting(userID, jobPostingID, date);

                if (confirmation)
                {
                    Response.Redirect(Request.RawUrl);
                }
                else
                {
                }
            }
        }
        catch (Exception)
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert(‘Error occurred with assigning candidate. Please contact customer support for assistance if this issue persists.’)", true);
        }
    }
Exemple #8
0
    private void PopulateJobPostingTable(int jobID)
    {
        PRMS RequestDirector;

        RequestDirector = new PRMS();

        JobPosting jobPosting;

        jobPosting = RequestDirector.GetJobPosting(jobID);
        JobPostingDescription.Text = jobPosting.Description;
        CompanyName.Text           = jobPosting.CompanyName;
        CompanyPhone.Text          = jobPosting.EmployerPhone;
        Date.Text = jobPosting.Date.ToString("yyyy-MM-dd");
        //Someting for skillsets
        Session.Clear();
        skillsetsLabel.Text = "";
        foreach (Skillset skill in jobPosting.Skillsets)
        {
            AddSkill_Click(skill.SkillsetID, skill.Description);
        }


        Profession.SelectedValue = jobPosting.ProfessionID.ToString();
        Region.SelectedValue     = jobPosting.RegionID.ToString();
    }
Exemple #9
0
    protected void BindDropDowns()
    {
        Profession.Items.Clear();
        PRMS controller = new PRMS();

        Profession.DataSource     = controller.GetProfessions();
        Profession.DataTextField  = "Description";
        Profession.DataValueField = "ProfessionID";
        Profession.Items.Insert(0, new ListItem("Select Profession...", "0"));
        Profession.DataBind();
    }
Exemple #10
0
    protected void BindDropDowns()
    {
        Skillset.Items.Clear();
        PRMS controller = new PRMS();

        Skillset.DataSource     = controller.GetSkillsets();
        Skillset.DataTextField  = "Description";
        Skillset.DataValueField = "SkillsetID";
        Skillset.Items.Insert(0, new ListItem("Select Skillset...", "0"));
        Skillset.DataBind();
    }
Exemple #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            User CurrentUser = new User();
            CustomPrincipal cp = HttpContext.Current.User as CustomPrincipal;
            PRMS UserController = new PRMS();
            CurrentUser = UserController.ViewProfile(cp.Identity.Name);
            CurrentUserID = CurrentUser.UserID;
            CurrentUserCoverLetter = CurrentUser.CoverLetter;
            CurrentUserResume = CurrentUser.Resume;
            string strPath = Server.MapPath("~");
            string path = strPath + "\\Files\\" + CurrentUser.UserID + "\\CoverLetter\\" + CurrentUser.CoverLetter;
            if (!File.Exists(path))
            {
                ViewCoverLetter.Enabled = false;
            }
            string path2 = strPath + "\\Files\\" + CurrentUser.UserID + "\\Resume\\" + CurrentUser.Resume;
            if (!File.Exists(path2))
            {
                ViewResume.Enabled = false;
            }


            if (!IsPostBack)
            {
                FirstName.Text = CurrentUser.FirstName;
                LastName.Text = CurrentUser.LastName;
                Phone.Text = CurrentUser.Phone;
                EmailTextBox.Text = CurrentUser.UserEmail;
                if (CurrentUser.ActiveInactive)
                {
                    Active.Checked = true;
                }
                else
                {
                    Active.Checked = false;
                }

                BindDropDowns();
                PopulateSkillsTable();
                PopulateProfessionTable();
                PopulateRegionTable();

                Session["FileUpload1"] = null;
            }
        }
        catch (Exception ex)
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert(‘Error occurred while obtaining data. Please contact customer support for assistance if this issue persists.’)", true);
        }

    }
Exemple #12
0
    protected void ChangeResume_Click(object sender, EventArgs e)
    {
        try
        {
            if (ResumeUpload.HasFile)
            {

                string fileExtension = Path.GetExtension(ResumeUpload.PostedFile.FileName);

                if (fileExtension == ".pdf" || fileExtension == ".docx")
                {
                    Directory.CreateDirectory(Server.MapPath("~/Files/" + CurrentUserID + "/Resume/"));

                    DirectoryInfo directory = new DirectoryInfo(Server.MapPath("~/Files/" + CurrentUserID + "/Resume/"));
                    foreach (FileInfo file in directory.GetFiles())
                    {
                        file.Delete();
                    }
                    foreach (DirectoryInfo di in directory.GetDirectories())
                    {
                        di.Delete(true);
                    }

                    ResumeUpload.SaveAs(Server.MapPath("~/Files/" + CurrentUserID + "/" + "Resume/" + ResumeUpload.FileName));
                    PRMS Controller = new PRMS();
                    if (Controller.UpdateResume(CurrentUserID, ResumeUpload.FileName))
                    {
                        ResumeMsg.Text = "Your resume has been updated.";
                        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Resume has been updated')", true);
                    }
                    else
                    {
                        ResumeMsg.Text = "Your resume could not be udpated.";
                    }
                    ResumeMsg.Text = "Your resume has been updated.";
                }
                else
                {
                    ResumeMsg.Text = "Only .pdf and .docx resume files are accepted.";
                }
            }
            else
            {
                ResumeMsg.Text = "Please select a file to upload.";
            }
        }
        catch (Exception)
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert(‘Error occurred with updating the resume. Please contact customer support for assistance if this issue persists.’)", true);
        }

    }
Exemple #13
0
 protected void StatusListSelectedIndexChanged(Object sender, EventArgs e, string StatusChange, int UserID, int JobPostingID, string DateChange, string DateCheck, DropDownList RevertList, String RevertValue)
 {
     if (DateChange == DateCheck)
     {
         Response.Write("<script language='javascript'>window.alert('You must select a new date for the status change.');</script>");
         RevertList.SelectedValue = RevertValue;
     }
     else
     {
         PRMS Controller = new PRMS();
         Controller.ChangeStatus(UserID, JobPostingID, StatusChange, DateChange);
     }
 }
Exemple #14
0
    private void PopulateRegionTable()
    {
        PRMS RequestDirector;
        RequestDirector = new PRMS();

        List<Region> Regions = RequestDirector.GetUserRegions(CurrentUserID);

        regionsLabel.Text = "";
        foreach (Region r in Regions)
        {
            AddRegion_Click(r.RegionID, r.Description);
        }

    }
Exemple #15
0
    private void PopulateProfessionTable()
    {
        PRMS RequestDirector;
        RequestDirector = new PRMS();

        List<Profession> Professions = RequestDirector.GetUserProfessions(CurrentUserID);

        professionsLabel.Text = "";
        foreach (Profession p in Professions)
        {
            AddProfession_Click(p.ProfessionID, p.Description);
        }

    }
Exemple #16
0
    private void PopulateSkillsTable()
    {
        PRMS RequestDirector;
        RequestDirector = new PRMS();

        List<Skillset> Skills = RequestDirector.GetUserSkills(CurrentUserID);
        

        skillsetsLabel.Text = "";
        foreach (Skillset s in Skills)
        {
            AddSkill_Click(s.SkillsetID, s.Description);
        }

    }
Exemple #17
0
    protected void Delete_Click(object sender, EventArgs e)
    {
        PRMS controller = new PRMS();
        bool Success;

        Success = controller.DeleteProfession(Profession.SelectedValue);
        if (Success)
        {
            ClearForm();
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Profession Deleted')", true);
        }
        else
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Profession not Deleted')", true);
        }
    }
Exemple #18
0
    protected void Delete_Click(object sender, EventArgs e)
    {
        PRMS controller = new PRMS();
        bool Success;

        Success = controller.DeleteJobPosting(PostingDropDown.SelectedValue);
        if (Success)
        {
            ClearForm();
            //ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Job Posting Deleted')", true);
            ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Job Posting Deleted');window.location ='ViewJobPosting.aspx';", true);
            //Response.Redirect("ViewJobPosting.aspx");
        }
        else
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Job Posting not Deleted')", true);
        }
    }
Exemple #19
0
    protected void Page_Load(object sender, EventArgs e)
    {
        PRMS controller = new PRMS();
        // Get all job postings
        List<JobPosting> jobPostingsList = new List<JobPosting>();
        jobPostingsList = controller.GetAllJobPostings();

        // Table Headings
        TableHeaderRow tableHRow = new TableHeaderRow();
        List<String> headerList = new List<String>()
        {
            "Company Name", "Job Description"
        };

        foreach (string header in headerList)
        {
            TableHeaderCell tableHCell = new TableHeaderCell();
            tableHCell.Text = header;

            tableHRow.Cells.Add(tableHCell);
        }

        JobPostingsTable.Rows.Add(tableHRow);

        // Table Rows
        TableRow aNewRow;
        int index = 0;

        foreach (var item in jobPostingsList)
        {
            aNewRow = new TableRow();

            TableCell aNewCell = new TableCell();
            aNewCell.Text = item.CompanyName;
            aNewRow.Cells.Add(aNewCell);

            aNewCell = new TableCell();
            aNewCell.Text = item.Description;
            aNewRow.Cells.Add(aNewCell);

            JobPostingsTable.Rows.Add(aNewRow);
            index++;
        }
    }
Exemple #20
0
    protected void ProfessionUpdateButton1_Click(object sender, EventArgs e)
    {
        try
        {
            bool confirmation = false;
            PRMS controller   = new PRMS();
            int  professionID = Convert.ToInt32(Profession.Text);
            confirmation = controller.UpdateProfession(UpdateDescription.Text, professionID);

            if (confirmation)
            {
                ClearForm();
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Profession was updated successfully.')", true);
            }
        }
        catch (Exception ex)
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert(‘Error occurred with updating profession. Please contact customer support for assistance if this issue persists.’)", true);
        }
    }
        public HeiflowModel()
        {
            Name           = "HEIFLOW";
            Description    = "HEIFLOW model version 1.0.0";
            this.Icon      = Resources.RasterImageAnalysisPanSharpen16;
            this.LargeIcon = Resources.RasterImageAnalysisPanSharpen32;
            _IsDirty       = false;

            _MasterPackage             = new MasterPackage(MasterPackageName);
            _MasterPackage.Owner       = this;
            _ExtensionManPackage       = new ExtensionManPackage();
            _ExtensionManPackage.Owner = this;

            _PRMS       = new PRMS();
            _PRMS.Owner = this;
            Children.Add(_PRMS.Name, _PRMS);

            _Modflow       = new Modflow();
            _Modflow.Owner = this;
            Children.Add(_Modflow.Name, _Modflow);
        }
Exemple #22
0
    protected void Submit_Click(object sender, EventArgs e)
    {
        try
        {
            User UpdateCandidate = new User();
            UpdateCandidate.UserID = CurrentUserID;
            UpdateCandidate.FirstName = FirstName.Text;
            UpdateCandidate.LastName = LastName.Text;
            UpdateCandidate.Phone = Phone.Text;
            if (Active.Checked)
            {
                UpdateCandidate.ActiveInactive = true;
            }
            else
            {
                UpdateCandidate.ActiveInactive = false;
            }


            PRMS controller = new PRMS();
            if (controller.UpdateProfile(UpdateCandidate))
            {
                UpdatedLabel.Text = "Your information has been updated";
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Your profile was updated successfully.')", true);
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert(‘Error occurred with updating your profile. Please contact customer support for assistance if this issue persists.’)", true);
                UpdatedLabel.Text = "Sorry we could not update your information at this time.";
            }
        }
        catch (Exception)
        {

            throw;
        }
    }
Exemple #23
0
    protected void EditCategories_Click(object sender, EventArgs e)
    {
        try
        {
            PRMS controller = new PRMS();
            controller.DeleteUserCategories(CurrentUserID);

            #region add professions
            List<int> professions = (List<int>)Session["professions"];
            foreach (int profession in professions)
            {
                controller.AddUserProfessions(CurrentUserID, profession);
            }

            #endregion

            #region add skills
            List<int> skills = (List<int>)Session["skills"];
            foreach (int skill in skills)
            {
                controller.AddUserSkills(CurrentUserID, skill);
            }

            #endregion
            #region add regions
            List<int> regions = (List<int>)Session["regions"];
            foreach (int region in regions)
            {
                controller.AddUserRegions(CurrentUserID, region);
            }
            #endregion
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Categories have been updated successfully.')", true);
        }
        catch {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert(‘Error occurred with udpating categories. Please contact customer support for assistance if this issue persists.’)", true);
        }
    }
Exemple #24
0
    protected void SkillSetAddButton1_Click(object sender, EventArgs e)
    {
        try
        {
            bool confirmation = false;
            PRMS controller   = new PRMS();

            confirmation = controller.AddSkillSet(Skillset.Text);

            if (confirmation)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Skillset was added successfully.')", true);
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Skillset was not added.')", true);
            }
        }
        catch (Exception)
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert(‘Error occurred with adding a skillset. Please contact customer support for assistance if this issue persists.’)", true);
            throw;
        }
    }
Exemple #25
0
 protected void ChangePassword_Click(object sender, EventArgs e)
 {
     try
     {
         User NewUser = new User();
         NewUser.UserID = CurrentUserID;
         NewUser.UserEmail = EmailTextBox.Text;
         PRMS UserController = new PRMS();
         if (UserController.ChangePassword(NewUser, OldPassword.Text, NewPassword.Text))
         {
             PasswordConfirmation.Text = "Your password has been updated.";
             ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Password has updated successfully')", true);
         }
         else
         {
             PasswordConfirmation.Text = "Your old password is incorrect.";
         }
         ClientScript.RegisterStartupScript(this.GetType(), "Popup", "$('#ChangePasswordModal').modal('show')", true);
     }
     catch (Exception)
     {
         ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert(‘Error occurred with changing password. Please contact customer support for assistance if this issue persists.’)", true);
     }
 }
Exemple #26
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            PRMS controller = new PRMS();
            // Get all job postings
            List <JobPosting> jobPostingsList = new List <JobPosting>();
            jobPostingsList = controller.GetAllJobPostings();

            // Table Headings
            TableHeaderRow tableHRow  = new TableHeaderRow();
            List <String>  headerList = new List <String>()
            {
                "JobPostingID", "CompanyName", "Description", "Assigned Candidates", "Modify"
            };

            foreach (string header in headerList)
            {
                TableHeaderCell tableHCell = new TableHeaderCell();
                tableHCell.Text = header;

                tableHRow.Cells.Add(tableHCell);
            }

            JobPostingsTable.Rows.Add(tableHRow);

            // Table Rows
            TableRow aNewRow;
            int      index = 0;

            foreach (var item in jobPostingsList)
            {
                aNewRow = new TableRow();

                TableCell aNewCell = new TableCell();
                aNewCell.Text = item.JobPostingID.ToString();
                aNewRow.Cells.Add(aNewCell);

                aNewCell      = new TableCell();
                aNewCell.Text = item.CompanyName;
                aNewRow.Cells.Add(aNewCell);

                aNewCell      = new TableCell();
                aNewCell.Text = item.Description;
                aNewRow.Cells.Add(aNewCell);

                aNewCell = new TableCell();
                Button viewButton = new Button();
                viewButton.ID       = "ViewButton" + index;
                viewButton.Text     = "View";
                viewButton.CssClass = "btn btn-dark";
                viewButton.Click   += new EventHandler((obj, eArgs) => ViewButton_Click(obj, eArgs, item.JobPostingID, item.CompanyName, item.Description));
                aNewCell.Controls.Add(viewButton);
                aNewRow.Cells.Add(aNewCell);

                aNewCell = new TableCell();
                Button UpdateButton = new Button();
                UpdateButton.ID       = "Update" + index;
                UpdateButton.Text     = "Update";
                UpdateButton.CssClass = "btn btn-dark";
                UpdateButton.Click   += new EventHandler((obj, eArgs) => UpdateButton_Click(obj, eArgs, item.JobPostingID));
                aNewCell.Controls.Add(UpdateButton);
                aNewRow.Cells.Add(aNewCell);

                JobPostingsTable.Rows.Add(aNewRow);
                index++;
            }
        }
        catch (Exception ex)
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert(‘Error occurred while viewing job posting. Please contact customer support for assistance if this issue persists.’)", true);
        }
    }
Exemple #27
0
    protected void Submit_Click(object sender, EventArgs e)
    {
        try
        {
            List <int> list;
            bool       dropdownsChecked = true;
            list = (List <int>)Session["professions"];
            if (list == null)
            {
                dropdownsChecked = false;
            }
            list = (List <int>)Session["skills"];
            if (list == null)
            {
                dropdownsChecked = false;
            }
            list = (List <int>)Session["regions"];
            if (list == null)
            {
                dropdownsChecked = false;
            }

            if (dropdownsChecked)
            {
                bool success      = false;
                User newCandidate = new User();
                newCandidate.UserEmail    = EmailTextBox.Text;
                newCandidate.FirstName    = FirstName.Text;
                newCandidate.LastName     = LastName.Text;
                newCandidate.Phone        = Phone.Text;
                newCandidate.Resume       = (ResumeUpload.PostedFile.FileName == "") ? null : ResumeUpload.PostedFile.FileName;
                newCandidate.CoverLetter  = (CoverLetterUpload.PostedFile.FileName == "") ? null : CoverLetterUpload.PostedFile.FileName;
                newCandidate.UserPassword = Password.Text;

                PRMS controller = new PRMS();



                #region add user
                success = controller.AddAccount(newCandidate);

                if (success)
                {
                    int userID;
                    userID = controller.GetUserIDByEmail(EmailTextBox.Text);

                    if (ResumeUpload.HasFile)
                    {
                        string fileExtension = Path.GetExtension(ResumeUpload.PostedFile.FileName);

                        if (fileExtension == ".pdf" || fileExtension == ".docx")
                        {
                            Directory.CreateDirectory(Server.MapPath("~/Files/" + userID + "/Resume/"));

                            DirectoryInfo directory = new DirectoryInfo(Server.MapPath("~/Files/" + userID + "/Resume/"));
                            foreach (FileInfo file in directory.GetFiles())
                            {
                                file.Delete();
                            }
                            foreach (DirectoryInfo di in directory.GetDirectories())
                            {
                                di.Delete(true);
                            }

                            ResumeUpload.SaveAs(Server.MapPath("~/Files/" + userID + "/" + "Resume/" + ResumeUpload.FileName));
                        }
                        else
                        {
                            Msg.Text = "Only .pdf and .docx resume files are accepted.";
                        }
                    }
                    if (CoverLetterUpload.HasFile)
                    {
                        string fileExtension = Path.GetExtension(CoverLetterUpload.PostedFile.FileName);

                        if (fileExtension == ".pdf" || fileExtension == ".docx")
                        {
                            Directory.CreateDirectory(Server.MapPath("~/Files/" + userID + "/CoverLetter/"));

                            DirectoryInfo directory = new DirectoryInfo(Server.MapPath("~/Files/" + userID + "/CoverLetter/"));
                            foreach (FileInfo file in directory.GetFiles())
                            {
                                file.Delete();
                            }
                            foreach (DirectoryInfo di in directory.GetDirectories())
                            {
                                di.Delete(true);
                            }

                            CoverLetterUpload.SaveAs(Server.MapPath("~/Files/" + userID + "/" + "CoverLetter/" + CoverLetterUpload.FileName));
                        }
                        else
                        {
                            Msg.Text = "Only .pdf and .docx cover letter files are accepted.";
                        }
                    }
                    #region add professions
                    int newUserID;
                    newUserID = controller.GetUserIDByEmail(EmailTextBox.Text);

                    List <int> professions = (List <int>)Session["professions"];
                    foreach (int profession in professions)
                    {
                        controller.AddUserProfessions(newUserID, profession);
                    }

                    #endregion

                    #region add skills
                    List <int> skills = (List <int>)Session["skills"];
                    foreach (int skill in skills)
                    {
                        controller.AddUserSkills(newUserID, skill);
                    }

                    #endregion
                    #region add regions
                    List <int> regions = (List <int>)Session["regions"];
                    foreach (int region in regions)
                    {
                        controller.AddUserRegions(newUserID, region);
                    }
                    #endregion
                    #region send email
                    using (SmtpClient smtpClient = new SmtpClient())
                    {
                        string email     = EmailTextBox.Text;
                        string firstName = FirstName.Text;

                        MailAddress from    = new MailAddress("*****@*****.**");
                        MailAddress to      = new MailAddress(email);
                        MailMessage message = new MailMessage(from, to);

                        message.Subject = "Placemejob Account Registration";

                        string note = "Dear " + firstName + ",<br /><br />";
                        note += "Thank you for your application on Placemejob. We shall check your profile with relevant openings and get back to you.";

                        message.Body         = note;
                        message.BodyEncoding = System.Text.Encoding.UTF8;
                        message.IsBodyHtml   = true;

                        SmtpClient client = new SmtpClient("smtp.gmail.com", 25);
                        client.UseDefaultCredentials = false;
                        client.EnableSsl             = true;
                        client.Credentials           = new NetworkCredential("*****@*****.**", "mejob986");

                        try
                        {
                            client.Send(message);
                        }
                        catch
                        {
                            Results.Text = "Error occurred with sending email.";
                        }
                    }
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('You have successfully registered an account.');window.location ='RegisterAccount.aspx';", true);
                    #endregion
                }
                else //if(success)
                {
                    Results.Text = "An error has occurred with your account registration. Please try again. If this issue persists, please contact customer support for assistance.";
                }
                #endregion
            }
            else //if(dropdownsChecked)
            {
                Results.Text = "You must select at least one profession, skill, and region preference.";
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert(‘Must have at least one profession, skill, and region added.’)", true);
            }
        }
        catch (Exception ex)
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert(''Error occurred with registering account. Please contact customer support for assistance if this issue persists.'')", true);
            Results.Text = ex.ToString();
        }
    }
Exemple #28
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            int         jobPostingID  = Convert.ToInt32(Request["JobPostingID"]);
            PRMS        controller    = new PRMS();
            List <User> candidateList = new List <User>();
            candidateList = controller.GetAssignedCandidates(jobPostingID);

            HeaderLabel.Text = "Assigned Candidates for - " + Request["Name"];
            SmallLabel.Text  = Request["Description"];
            // Table Headings
            TableHeaderRow tableHRow  = new TableHeaderRow();
            List <String>  headerList = new List <String>()
            {
                "First Name", "Last Name", "Email", "Phone", "Cover Letter", "Resume", "Status Date", "Status"
            };

            foreach (string header in headerList)
            {
                TableHeaderCell tableHCell = new TableHeaderCell();
                tableHCell.Text = header;

                tableHRow.Cells.Add(tableHCell);
            }

            QualifiedCandidate.Rows.Add(tableHRow);

            // Table Rows
            TableRow aNewRow;
            int      index = 0;



            foreach (var item in candidateList)
            {
                aNewRow = new TableRow();

                TableCell aNewCell = new TableCell();
                aNewCell.Text = item.FirstName;
                aNewRow.Cells.Add(aNewCell);

                aNewCell      = new TableCell();
                aNewCell.Text = item.LastName;
                aNewRow.Cells.Add(aNewCell);

                aNewCell      = new TableCell();
                aNewCell.Text = item.UserEmail;
                aNewRow.Cells.Add(aNewCell);

                aNewCell      = new TableCell();
                aNewCell.Text = item.Phone;
                aNewRow.Cells.Add(aNewCell);


                aNewCell = new TableCell();
                Button viewCoverLetterButton = new Button();
                viewCoverLetterButton.ID       = "ViewCoverLetterButton" + index;
                viewCoverLetterButton.Text     = "View";
                viewCoverLetterButton.CssClass = "btn btn-dark";
                viewCoverLetterButton.Click   += new EventHandler((obj, eArgs) => ViewCoverLetterButton_Click(obj, eArgs, item.UserID, item.CoverLetter));
                string strPath = Server.MapPath("~");
                string path    = strPath + "\\Files\\" + item.UserID + "\\CoverLetter\\" + item.CoverLetter;
                if (!File.Exists(path))
                {
                    viewCoverLetterButton.Enabled = false;
                }
                aNewCell.Controls.Add(viewCoverLetterButton);
                aNewRow.Cells.Add(aNewCell);

                aNewCell = new TableCell();
                Button viewResumeButton = new Button();
                viewResumeButton.ID       = "ViewResumeButton" + index;
                viewResumeButton.Text     = "View";
                viewResumeButton.CssClass = "btn btn-dark";
                viewResumeButton.Click   += new EventHandler((obj, eArgs) => ViewResumeButton_Click(obj, eArgs, item.UserID, item.Resume));
                string path2 = strPath + "\\Files\\" + item.UserID + "\\Resume\\" + item.Resume;
                if (!File.Exists(path2))
                {
                    viewResumeButton.Enabled = false;
                }
                aNewCell.Controls.Add(viewResumeButton);
                aNewRow.Cells.Add(aNewCell);

                aNewCell = new TableCell();
                TextBox DateBox = new TextBox();
                DateBox.TextMode = TextBoxMode.Date;
                DateBox.CssClass = "form-control";
                DateBox.Text     = item.StatusDate;
                aNewCell.Controls.Add(DateBox);
                aNewRow.Cells.Add(aNewCell);

                aNewCell = new TableCell();
                DropDownList StatusList = new DropDownList();
                StatusList.ID = "StatusList" + index;
                StatusList.EnableViewState = true;
                StatusList.AutoPostBack    = true;
                StatusList.CssClass        = "form-control";

                List <String> JobStatus = new List <String>()
                {
                    "Interviewing", "Joined", "On-Hold", "Rejected", "Selected"
                };
                StatusList.Items.Insert(0, new ListItem("Interviewing", "Interviewing"));
                StatusList.Items.Insert(1, new ListItem("Joined", "Joined"));
                StatusList.Items.Insert(2, new ListItem("On-Hold", "On-Hold"));
                StatusList.Items.Insert(3, new ListItem("Rejected", "Rejected"));
                StatusList.Items.Insert(4, new ListItem("Selected", "Selected"));
                StatusList.SelectedValue = item.JobStatus;

                StatusList.SelectedIndexChanged += new EventHandler((obj, eArgs) => StatusListSelectedIndexChanged(obj, eArgs, StatusList.SelectedItem.Text, item.UserID, jobPostingID, DateBox.Text, item.StatusDate, StatusList, item.JobStatus));

                aNewCell.Controls.Add(StatusList);

                aNewRow.Cells.Add(aNewCell);

                QualifiedCandidate.Rows.Add(aNewRow);
                index++;
            }
        }
        catch (Exception ex)
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert(‘Error occurred while trying to obtain data. Please contact customer support for assistance if this issue persists.’)", true);
        }
    }
Exemple #29
0
        public ActionResult Index(LoginModel lm)
        {
            string returnUrl = "";

            if (TempData["returnUrl"] != null)
            {
                returnUrl = TempData["returnUrl"].ToString();
                if (returnUrl.ToLower().Contains("logout"))
                {
                    returnUrl = "Home";
                }
            }
            else
            {
                returnUrl = lm.ReturnUrl;
            }

            if (!ModelState.IsValid)
            {
                ModelState.AddModelError("", "Username and Password is required.");
                lm.ReturnUrl = returnUrl;
                return(View(lm));
            }

            lm.Username = lm.Username.ToUpper().Trim();

            Accounts accnts = new Accounts();

            Accounts.Account accnt = accnts.SelectUserByUsername(lm.Username);

            if (accnt.Username == null)
            {
                ModelState.AddModelError("", "Username does not exist.");
                lm.ReturnUrl = returnUrl;
                return(View(lm));
            }

            string hashing = PRMS.GetMD5Hash(lm.Password);

            if (PRMS.GetMD5Hash(lm.Password) != accnt.Password)
            {
                ModelState.AddModelError("", "Password is incorrect.");
                return(View(lm));
            }
            else
            {
                JavaScriptSerializer serializer = new JavaScriptSerializer();
                string data = serializer.Serialize(accnt);
                FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, lm.Username, DateTime.Now, DateTime.Now.AddHours(8), true, data, FormsAuthentication.FormsCookiePath);
                string           encriptedTicket = FormsAuthentication.Encrypt(ticket);
                HttpCookie       ticketCookie    = new HttpCookie(FormsAuthentication.FormsCookieName, encriptedTicket);
                Accounts.Account x = serializer.Deserialize <Accounts.Account>(data);
                Response.Cookies.Add(ticketCookie);

                Parameters.UserID       = accnt.ID;
                Parameters.UserName     = accnt.Name;
                Parameters.UsedUsername = accnt.Username;
                Parameters.Password     = accnt.Password;
                Parameters.Department   = accnt.DepartmentID;
                Parameters.Role         = accnt.RoleID;
                return(RedirectToAction("Index", "Home"));
            }
        }
Exemple #30
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            int         jobPostingID  = Convert.ToInt32(Request["JobPostingID"]);
            PRMS        controller    = new PRMS();
            List <User> candidateList = new List <User>();
            candidateList = controller.GetQualifiedCandidates(jobPostingID);

            HeaderLabel.Text = "Candidates Matching - " + Request["Name"];
            SmallLabel.Text  = Request["Description"];
            // Table Headings
            TableHeaderRow tableHRow  = new TableHeaderRow();
            List <String>  headerList = new List <String>()
            {
                "First Name", "Last Name", "Email", "Phone", "Cover Letter", "Resume", "Interview Date", "Action"
            };

            foreach (string header in headerList)
            {
                TableHeaderCell tableHCell = new TableHeaderCell();
                tableHCell.Text = header;

                tableHRow.Cells.Add(tableHCell);
            }

            QualifiedCandidate.Rows.Add(tableHRow);

            // Table Rows
            TableRow aNewRow;
            int      index = 0;

            foreach (var item in candidateList)
            {
                aNewRow = new TableRow();

                TableCell aNewCell = new TableCell();
                aNewCell.Text = item.FirstName;
                aNewRow.Cells.Add(aNewCell);

                aNewCell      = new TableCell();
                aNewCell.Text = item.LastName;
                aNewRow.Cells.Add(aNewCell);

                aNewCell      = new TableCell();
                aNewCell.Text = item.UserEmail;
                aNewRow.Cells.Add(aNewCell);

                aNewCell      = new TableCell();
                aNewCell.Text = item.Phone;
                aNewRow.Cells.Add(aNewCell);

                aNewCell = new TableCell();
                Button viewCoverLetterButton = new Button();
                viewCoverLetterButton.ID       = "ViewCoverLetterButton" + index;
                viewCoverLetterButton.Text     = "View";
                viewCoverLetterButton.CssClass = "btn btn-dark";
                viewCoverLetterButton.Click   += new EventHandler((obj, eArgs) => ViewCoverLetterButton_Click(obj, eArgs, item.UserID, item.CoverLetter));
                string strPath = Server.MapPath("~");
                string path    = strPath + "\\Files\\" + item.UserID + "\\CoverLetter\\" + item.CoverLetter;
                if (!File.Exists(path))
                {
                    viewCoverLetterButton.Enabled = false;
                }
                aNewCell.Controls.Add(viewCoverLetterButton);
                aNewRow.Cells.Add(aNewCell);

                aNewCell = new TableCell();
                Button viewResumeButton = new Button();
                viewResumeButton.ID       = "ViewResumeButton" + index;
                viewResumeButton.Text     = "View";
                viewResumeButton.CssClass = "btn btn-dark";
                viewResumeButton.Click   += new EventHandler((obj, eArgs) => ViewResumeButton_Click(obj, eArgs, item.UserID, item.Resume));
                string path2 = strPath + "\\Files\\" + item.UserID + "\\Resume\\" + item.Resume;
                if (!File.Exists(path2))
                {
                    viewResumeButton.Enabled = false;
                }
                aNewCell.Controls.Add(viewResumeButton);
                aNewRow.Cells.Add(aNewCell);

                aNewCell = new TableCell();
                TextBox DateBox = new TextBox();
                DateBox.TextMode = TextBoxMode.Date;
                DateBox.CssClass = "form-control";
                aNewCell.Controls.Add(DateBox);
                aNewRow.Cells.Add(aNewCell);

                aNewCell = new TableCell();
                Button assignButton = new Button();
                assignButton.ID       = "AssignButton" + index;
                assignButton.Text     = "Confirm Interview";
                assignButton.CssClass = "btn btn-dark";
                assignButton.Click   += new EventHandler((obj, eArgs) => AssignButton_Click(obj, eArgs, item.UserID, DateBox.Text));
                aNewCell.Controls.Add(assignButton);
                aNewRow.Cells.Add(aNewCell);

                QualifiedCandidate.Rows.Add(aNewRow);
                index++;
            }
        }
        catch (Exception)
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert(‘Error occurred while obtaining data. Please contact customer support for assistance if this issue persists.’)", true);
        }
    }