Ejemplo n.º 1
0
 public static String GetCVModule(CVModule EnumModule)
 {
     if (EnumModule == CVModule.CPUModule)
     {
         return("CVIE-Esaote-USPlusView-CPU-DSP");
     }
     else
     {
         return("CVIE-Esaote-USPlusView-DSP");
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        LoginModule myLoginModule = new LoginModule();
        myLoginModule.checkLoginStatus();
        myLoginModule.checkPermission(0);
        WelcomeLabel.Text = myLoginModule.getFirstName((String)Session["userID"]);

        try
        {
            if (!IsPostBack)
            {
                CVModule myCVModule = new CVModule();
                //LoginModule myLoginModule = new LoginModule();
                String[] stringArray = myCVModule.getDetailsToForm((String)Session["userID"]);
                fName.Text = stringArray[0]; mName.Text = stringArray[1]; lName.Text = stringArray[2];
                //String date = stringArray[3];
                DateTime myDateTime = new DateTime();
                myDateTime = DateTime.Parse(stringArray[3]);
                Datepicker.Text = myDateTime.ToString("MM/dd/yyyy");
                //DateTime dt = Convert.ToDateTime(date);
                //Calendar1.SelectedDate = dt;
                //Calendar1.VisibleDate = dt;
                int genderIndex;
                if (stringArray[5].Equals("True"))
                {
                    genderIndex = 1;
                }
                else
                {
                    genderIndex = 0;
                }
                Gender.SelectedIndex = genderIndex;
                int mStatusIndex;
                if (stringArray[6].Equals("True"))
                {
                    mStatusIndex = 1;
                }
                else
                {
                    mStatusIndex = 0;
                }
                mStatus.SelectedIndex = mStatusIndex;
                number.Text = stringArray[7]; street.Text = stringArray[8]; town.Text = stringArray[9];
                email.Text = stringArray[10]; phone.Text = stringArray[11]; school.Text = stringArray[12];
            }
        }
        catch (Exception ex)
        {
            Page.ClientScript.RegisterStartupScript(Page.GetType(), "showAlert", "showAlert();", true);
        }
    }
 protected void SubmitAndNewButton_Click(object sender, EventArgs e)
 {
     if (JobTextBox.Text != "")
     {
         CVModule myCVModule = new CVModule();
         myCVModule.setUserID((String)Session["userID"]);
         ConfirmationLabel.Text = myCVModule.insertSeekingJob(JobTextBox.Text, JobTypeDropDownList.SelectedValue);
         JobTextBox.Text = String.Empty;
     }
     else
     {
         ConfirmationLabel.Text = "Please enter a job position.";
     }
 }
 protected void SubmitAndNewButton_Click(object sender, EventArgs e)
 {
     if (Language.Text != "")
     {
         CVModule myCVModule = new CVModule();
         myCVModule.setUserID((String)Session["userID"]);
         ConfirmationLabel.Text = myCVModule.insertComputerLanguage(Language.Text, ProficiencyDropDownList.SelectedValue);
         Language.Text = String.Empty;
     }
     else
     {
         ConfirmationLabel.Text = "Please enter a language.";
     }
 }
 protected void SubmitAndNewButton_Click(object sender, EventArgs e)
 {
     if (PhoneNumberTextBox.Text != "")
     {
         CVModule myCVModule = new CVModule();
         myCVModule.setUserID((String)Session["userID"]);
         ConfirmationLabel.Text = myCVModule.insertPersonalPhoneNumber(PhoneNumberTextBox.Text);
         PhoneNumberTextBox.Text = String.Empty;
     }
     else
     {
         ConfirmationLabel.Text = "Please enter a language.";
     }
 }
 protected void SubmitAndNewButton_Click(object sender, EventArgs e)
 {
     if (SoftSkillTextBox.Text != "")
     {
         CVModule myCVModule = new CVModule();
         myCVModule.setUserID((String)Session["userID"]);
         FunctionCallerLabel.Text = myCVModule.insertSoftSkill(SoftSkillTextBox.Text);
         SoftSkillTextBox.Text = String.Empty;
     }
     else
     {
         ConfirmationLabel.Text = "Please fill in all the details.";
     }
 }
 protected void SubmitAndCloseButton_Click(object sender, EventArgs e)
 {
     if (Language.Text != "")
     {
         CVModule myCVModule = new CVModule();
         myCVModule.setUserID((String)Session["userID"]);
         ConfirmationLabel.Text = myCVModule.insertComputerLanguage(Language.Text, ProficiencyDropDownList.SelectedValue);
         FunctionCallerLabel.Text = "<script type='text/javascript'>closeWindow();</script>";
     }
     else
     {
         ConfirmationLabel.Text = "Please enter a language.";
     }
     //Page.ClientScript.RegisterOnSubmitStatement(typeof(Page), "closeWindow", "window.onunload = closeWindow();");
     //Page.ClientScript.RegisterOnSubmitStatement(typeof(Page), "closePage", "closeWindow();");
 }
 protected void SubmitButton_Click(object sender, EventArgs e)
 {
     //DateTime dt = (Calendar1.SelectedDate);
     //String format = "yyyy-MM-dd";
     //String dob = dt.ToString(format);
     CVModule myCVModule = new CVModule();
     myCVModule.setStrings(fName.Text, mName.Text, lName.Text, phone.Text, email.Text, school.Text, number.Text, street.Text, town.Text);
     //myCVModule.setdob(dob);
     myCVModule.setdob(Datepicker.Text);
     //myCVModule.setUsername(fName.Text);
     myCVModule.setUserID((String)Session["userID"]);
     int x = Gender.SelectedIndex, y = mStatus.SelectedIndex;
     myCVModule.setints(x, y);
     TextBox1.Text = myCVModule.createCV();
     Response.Redirect("HomePage.aspx");
 }
 protected void SubmitAndNewButton_Click(object sender, EventArgs e)
 {
     if (DegreeNameTextBox.Text != "" && UniversityNameTextBox.Text != "" && YearTextBox.Text != "")
     {
         CVModule myCVModule = new CVModule();
         myCVModule.setUserID((String)Session["userID"]);
         FunctionCallerLabel.Text = myCVModule.insertFirstDegree(DegreeNameTextBox.Text, UniversityNameTextBox.Text, YearTextBox.Text);
         DegreeNameTextBox.Text = String.Empty;
         UniversityNameTextBox.Text = String.Empty;
         YearTextBox.Text = String.Empty;
     }
     else
     {
         ConfirmationLabel.Text = "Please fill in all the details.";
     }
 }
 protected void SubmitAndCloseButton_Click(object sender, EventArgs e)
 {
     if (DegreeNameTextBox.Text != "" && UniversityNameTextBox.Text != "" && YearTextBox.Text != "")
     {
         CVModule myCVModule = new CVModule();
         myCVModule.setUserID((String)Session["userID"]);
         FunctionCallerLabel.Text = myCVModule.insertFirstDegree(DegreeNameTextBox.Text, UniversityNameTextBox.Text, YearTextBox.Text);
         FunctionCallerLabel.Text = "<script type='text/javascript'>closeWindow();</script>";
     }
     else
     {
         ConfirmationLabel.Text = "Please fill in all the details.";
     }
     //Page.ClientScript.RegisterOnSubmitStatement(typeof(Page), "closePage", "closeWindow();");
     //Page.ClientScript.RegisterOnSubmitStatement(typeof(Page), "closeWindow", "window.onunload = closeWindow();");
 }
 protected void SubmitAndCloseButton_Click(object sender, EventArgs e)
 {
     if (JobTextBox.Text != "")
     {
         CVModule myCVModule = new CVModule();
         myCVModule.setUserID((String)Session["userID"]);
         ConfirmationLabel.Text = myCVModule.insertSeekingJob(JobTextBox.Text, JobTypeDropDownList.SelectedValue);
         FunctionCallerLabel.Text = "<script type='text/javascript'>closeWindow();</script>";
         Response.Redirect("ApplicantsJobs.aspx");
     }
     else
     {
         ConfirmationLabel.Text = "Please enter a seeking job.";
     }
     //Page.ClientScript.RegisterOnSubmitStatement(typeof(Page), "closeWindow", "window.onunload = closeWindow();");
     //Page.ClientScript.RegisterOnSubmitStatement(typeof(Page), "closePage", "closeWindow();");
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        LoginModule myLoginModule = new LoginModule();
        myLoginModule.checkLoginStatus();
        myLoginModule.checkPermission(0);
        WelcomeLabel.Text = myLoginModule.getFirstName((String)Session["userID"]);

        HttpContext context = System.Web.HttpContext.Current;
        //Added code
        CVModule myCVModule = new CVModule();
        myCVModule.setUserID(context.Request.QueryString["userId"]);
        picone.ImageUrl = "ShowPhoto.aspx?userId=" + context.Request.QueryString["userId"];
        //String[] stringArray = myCVModule.getDetailsToForm(myLoginModule.getID(TextBox2.Text));
        String[] stringArray = myCVModule.getDetailsToForm(context.Request.QueryString["userId"]);
        name.Text = stringArray[0] + " " + stringArray[1] + " " + stringArray[2];
        String dob = stringArray[3];
        DateTime myDateTime = new DateTime();
        myDateTime = DateTime.Parse(stringArray[3]);
        String stringAge = myDateTime.Subtract(DateTime.Now).ToString("dhms");
        long age = Int64.Parse(stringAge);
        age /= 1000000;
        age /= 365;
        Calendar1.Text = age.ToString();
        if (stringArray[5].Equals("True"))
        {
            Gender.Text = "Female";
        }
        else
        {
            Gender.Text = "Male";
        }
        if (stringArray[6].Equals("True"))
        {
            mStatus.Text = "Married";
        }
        else
        {
            mStatus.Text = "Single";
        }
        number.Text = stringArray[7]; street.Text = stringArray[8]; town.Text = stringArray[9];
        email.Text = stringArray[10];
        //phone.Text = stringArray[11];
        school.Text = stringArray[12];

        FirstDegreeGridView.DataSource = myCVModule.getFirstDegree();
        FirstDegreeGridView.DataBind();
        FirstDegreeGridView.GridLines = GridLines.None;
        if (FirstDegreeGridView.Rows.Count == 0)
        {
            FirstDegreesLabel.Visible = false;
        }

        MastersDegreeGridView.DataSource = myCVModule.getMastersDegree();
        MastersDegreeGridView.DataBind();
        MastersDegreeGridView.GridLines = GridLines.None;
        if (MastersDegreeGridView.Rows.Count == 0)
        {
            MastersDegreeLabel.Visible = false;
        }

        PhdGridView.DataSource = myCVModule.getPhd();
        PhdGridView.DataBind();
        PhdGridView.GridLines = GridLines.None;
        if (PhdGridView.Rows.Count == 0)
        {
            PhdLabel.Visible = false;
        }

        SoftSkillGridView.DataSource = myCVModule.getSoftSkill();
        SoftSkillGridView.DataBind();
        SoftSkillGridView.GridLines = GridLines.None;
        if (SoftSkillGridView.Rows.Count == 0)
        {
            SoftSkillLabel.Visible = false;
        }

        PhoneGridView.DataSource = myCVModule.getPhoneNumbers();
        PhoneGridView.DataBind();
        PhoneGridView.GridLines = GridLines.None;
        if (PhoneGridView.Rows.Count == 0)
        {
            PhoneLabel.Visible = false;
        }

        SeekingJobsGridView.DataSource = myCVModule.getSeekingJobs();
        SeekingJobsGridView.DataBind();
        SeekingJobsGridView.GridLines = GridLines.None;
        if (SeekingJobsGridView.Rows.Count == 0)
        {
            SeekingJobsLabel.Visible = false;
        }
    }
 protected void UploadPDFButton_Click(object sender, EventArgs e)
 {
     CVModule myCVModule = new CVModule();
     myCVModule.setUserID((String)Session["userID"]);
     myCVModule.uploadPdfCv(PDFUploadControl);
 }
 protected void SubmitButton_Click(object sender, EventArgs e)
 {
     try
     {
         //DateTime dt = (Calendar1.SelectedDate);
         //String format = "yyyy-MM-dd";
         // String dob = dt.ToString(format);
         CVModule myCVModule = new CVModule();
         myCVModule.setStrings(fName.Text, mName.Text, lName.Text, phone.Text, email.Text, school.Text, number.Text, street.Text, town.Text);
         //myCVModule.setdob(dob);
         myCVModule.setdob(Datepicker.Text);
         //myCVModule.setUsername(fName.Text);
         myCVModule.setUserID((String)Session["userID"]);
         int x = Gender.SelectedIndex, y = mStatus.SelectedIndex;
         myCVModule.setints(x, y);
         TextBox1.Text = myCVModule.UpdateCV();
         if (TextBox1.Text.Equals("Non-returning query Successfully executed.Non-returning query Successfully executed.Non-returning query Successfully executed."))
         {
             Response.Redirect("HomePage.aspx");
         }
     }
     catch (Exception ex)
     {
         Page.ClientScript.RegisterStartupScript(Page.GetType(), "showAlert", "showAlert();", true);
     }
 }