public void someCandidatePropertyOK() { //create an instance of the collection class clsCandidateCollection aCandidateCollection = new clsCandidateCollection(); //create a test candidate to go in the list clsCandidate testCandidate = new clsCandidate(); //add test candidate data testCandidate.CandidateNo = 2430705; testCandidate.CandidateTitle = "Mr"; testCandidate.CandidateFirstName = "Janzeb"; testCandidate.CandidateLastName = "Masiano"; testCandidate.CandidateBirthDate = Convert.ToDateTime("1988/01/14"); testCandidate.CandidateAddress = "212 De Montfort University, The Gateway, Leicester"; testCandidate.CandidatePostCode = "LE1 9BH"; testCandidate.CandidatePhone = "07816152348"; testCandidate.CandidateEmail = "*****@*****.**"; testCandidate.CandidateUsername = "******"; testCandidate.CandidatePassword = "******"; testCandidate.CandidateSecurityAnswer = "Is a secrete 1"; testCandidate.CandidateCVFile = @"..\InigmaIT\CVFolder\MyCV"; testCandidate.CandidateDateRegistered = Convert.ToDateTime("2020/01/14"); //assign the data the the property aCandidateCollection.someCandidate = testCandidate; //test to see that the the property in aCandidateCollection is the same as testCandidate Assert.AreEqual(aCandidateCollection.someCandidate, testCandidate); }
protected void BtnSaveDetails_Click(object sender, EventArgs e) { //string to store the validation error string validationError = ""; //create instance of clsCandidate clsCandidate aCandidate = new clsCandidate(); //assign the data to the validation method. We have no candidateNo for new candidates so just use "1" validationError = aCandidate.CandidateValidation("1", txtCandidateRegistrationCandidateTitle.Text, txtCandidateRegistrationCandidateFirstName.Text, txtCandidateRegistrationCandidateLastName.Text, txtCandidateRegistrationCandidateBirthDate.Text, txtCandidateRegistrationCandidateAddress.Text, txtCandidateRegistrationCandidatePostCode.Text, txtCandidateRegistrationCandidatePhone.Text, txtCandidateRegistrationCandidateEmail.Text, txtCandidateRegistrationCandidateUserName.Text, txtCandidateRegistrationCandidatePassword.Text, txtCandidateRegistrationCandidateConfirmPassword.Text, txtCandidateRegistrationCandidateSecurityAnswer.Text, lblCandidateRegistrationDateRegistered.Text); //if there are no validation errors if (validationError == "") { //create an instance of clsCandidateCollection clsCandidateCollection theCandidateCollection = new clsCandidateCollection(); //pass in the data of someCandidate in the newCandidate object theCandidateCollection.SomeCandidate.CandidateTitle = txtCandidateRegistrationCandidateTitle.Text; theCandidateCollection.SomeCandidate.CandidateFirstName = txtCandidateRegistrationCandidateFirstName.Text; theCandidateCollection.SomeCandidate.CandidateLastName = txtCandidateRegistrationCandidateLastName.Text; theCandidateCollection.SomeCandidate.CandidateBirthDate = Convert.ToDateTime(txtCandidateRegistrationCandidateBirthDate.Text); theCandidateCollection.SomeCandidate.CandidateAddress = txtCandidateRegistrationCandidateAddress.Text; theCandidateCollection.SomeCandidate.CandidatePostCode = txtCandidateRegistrationCandidatePostCode.Text; theCandidateCollection.SomeCandidate.CandidatePhone = txtCandidateRegistrationCandidatePhone.Text; theCandidateCollection.SomeCandidate.CandidateEmail = txtCandidateRegistrationCandidateEmail.Text; theCandidateCollection.SomeCandidate.CandidateUsername = txtCandidateRegistrationCandidateUserName.Text; theCandidateCollection.SomeCandidate.CandidatePassword = txtCandidateRegistrationCandidatePassword.Text; theCandidateCollection.SomeCandidate.CandidateSecurityAnswer = txtCandidateRegistrationCandidateSecurityAnswer.Text; theCandidateCollection.SomeCandidate.CandidateCVFile = "no file path"; //execute the AddCandidate method, to add a new candidate to database if (theCandidateCollection.AddCandidate()) { //if the result of AddCandidate is true register Response.Redirect("CandidateSaveConfirmation.aspx"); } } //if there is a validation error if (validationError != "") { //display validation error lblCandidateRegistrationValidationError.Text = validationError; } }
public int InsertCandidateDetails(clsCandidate objCandidate) { Hashtable htparams = new Hashtable { { "inCandidateId", objCandidate.CandidateId }, { "inFirstName", objCandidate.FirstName }, { "inLastName", objCandidate.LastName }, { "inMiddleName", objCandidate.MiddleName }, { "inEmailID", objCandidate.EmailID }, { "inContactNo", objCandidate.ContactNo }, { "inJobVacancy", objCandidate.JobVacancy }, { "inKeyword", objCandidate.Keyword }, { "inComments", objCandidate.Comments }, { "inApplicationDate", objCandidate.ApplicationDate }, { "inCanResumeUpload", objCandidate.CanResumeUpload }, { "inCanResumeFilePath", objCandidate.CanResumeFilePath }, { "in_OpName", objCandidate.OpName }, }; return(ExecuteNonQuery("candidate_insert_update", htparams)); }
public DataSet GetCandidateList(clsCandidate objCandList) { Hashtable htparams = new Hashtable { { "inCandidateId", objCandList.CandidateId }, { "inFirstName", objCandList.FirstName }, { "inLastName", objCandList.LastName }, { "inMiddleName", objCandList.MiddleName }, { "inEmailID", objCandList.EmailID }, { "inContactNo", objCandList.ContactNo }, { "inJobVacancy", objCandList.JobVacancy }, { "inKeyword", objCandList.Keyword }, { "inComments", objCandList.Comments }, { "inApplicationDate", objCandList.ApplicationDate }, { "inCanResumeUpload", objCandList.CanResumeUpload }, { "inCanResumeFilePath", objCandList.CanResumeFilePath }, { "in_OpName", objCandList.OpName }, }; return(ExecuteDataSet("candidate_insert_update", htparams)); }
public void CountMatchesCandidateListOK() { //create an instance of the collection class clsCandidateCollection aCandidateCollection = new clsCandidateCollection(); //create some test list List <clsCandidate> testCandidateList = new List <clsCandidate>(); //create a test candidate to go in the list clsCandidate testCandidate = new clsCandidate(); //add test candidate data testCandidate.CandidateNo = 2430705; testCandidate.CandidateTitle = "Mr"; testCandidate.CandidateFirstName = "Janzeb"; testCandidate.CandidateLastName = "Masiano"; testCandidate.CandidateBirthDate = Convert.ToDateTime("1988/01/14"); testCandidate.CandidateAddress = "212 De Montfort University, The Gateway, Leicester"; testCandidate.CandidatePostCode = "LE1 9BH"; testCandidate.CandidatePhone = "07816152348"; testCandidate.CandidateEmail = "*****@*****.**"; testCandidate.CandidateUsername = "******"; testCandidate.CandidatePassword = "******"; testCandidate.CandidateSecurityAnswer = "Is a secrete 1"; testCandidate.CandidateCVFile = @"..\InigmaIT\CVFolder\MyCV"; testCandidate.CandidateDateRegistered = Convert.ToDateTime("2020/01/14"); testCandidate.CandidateAccountLock = false; //add the test candidate to the test list testCandidateList.Add(testCandidate); //assign the data the the property aCandidateCollection.CandidateList = testCandidateList; //test to see that the CandidateCount (property of Collection class) and testList.Count (built in method that returns count) are same Assert.AreEqual(aCandidateCollection.CandidateCount, testCandidateList.Count); }