protected void saveButton_Click(object sender, EventArgs e) { personalInfo personalinfo = new personalInfo() { FirstName = firstname.Value, MiddleName = "NA", LastName = lastname.Value, Email = email.Value, Password = password.Value, Phone = phoneNumber.Value, Gender = "M", Title = "1", DateofBirth = "01/01/1991", MaritalStatus = Convert.ToInt32("1"), }; residentialInfo residentialinfo = new residentialInfo() { Streetname = streetAddress.Text, StreetnameII = "NA", City = city.Value, Zipcode = "NA", State = stateID.Value, Country = country.Value, }; // add the business referee to the save method. educationInfo educationinfo = new educationInfo() { HighestDegree = "NA", NameofSchool = "NA", Graddate = "01/01/1991", Certifications = "NA", }; employmentInfo employmentinfo = new employmentInfo() { YearsofExperience = "3", RecentEmployer = "NA", Position = "NA", DateEmployed = "01/01/1991", Functions = "NA", OtherEmployerII = "null", PositionII = "null", DateEmployedII = "01/01/1991", EndDateII = "01/01/1991", JobDescriptionII = "null", OtherEmployerIII = "null", PositionIII = "null", DateEmployedIII = "01/01/1991", EndDateIII = "01/01/1991", JobDescriptionIII = "null", }; businessReferee businessreferee = new businessReferee() { RefereeFirstName = "NA", RefereeLastName = "NA", PositionOccupied = "NA", RefereeEmail = "NA", RefereePhoneNumber = "NA", RefereeFirstNameII = "NA", RefereeLastNameII = "NA", PositionOccupiedII = "NA", RefereeEmailII = "NA", RefereePhoneNumberII = "NA" }; userInfo userinfo = new userInfo() { MemcategoryID = Convert.ToInt32(memcatgoryID.Value), }; studentInfo studentinfo = new studentInfo() { NyscStateCode = "NA" }; companyInfo companyinfo = new companyInfo() { Position = position.Value, CompanyName = nameofCompany.Value, CompanyAddress = adressofCompany.Text, CompanyEmail = companyEmail.Text, WebAddress = webAddress.Value, }; //paymentDetails paymentdetails = new paymentDetails() //{ // Description = paymentCatID.Value, // ReferenceID = transRefID.Value, // PaymentItemID = paymentCatID.Value, //}; registrationViewModel viewObj = new registrationViewModel() { personalinfo = personalinfo, residentinfo = residentialinfo, businessreferee = businessreferee, educationinfo = educationinfo, employmentinfo = employmentinfo, userinfo = userinfo, studentinfo = studentinfo, companyinfo = companyinfo }; Session["ActiveMemCatID"] = userinfo.MemcategoryID; long biodataid = logic.RegisterUser(viewObj); //biodataid =Convert.ToInt64(Session["active_biodataid"]); if (biodataid > 0) { Session["UserEmail"] = personalinfo.Email; // try // { // if (FileUpload1.FileName.EndsWith("jpg")) // { // String fileName = Server.MapPath("~") + "/ICA/Credentials/Passport/" + biodataid + ".jpg"; // FileUpload1.SaveAs(fileName); // uploadNotificationI.Text = utilities.ShowSuccess("Uploaded Successfully."); // } // else // { // uploadNotificationI.Text = utilities.ShowError("Invalid File Format."); // } //// upload pdf files to the folder. // if (FileUpload2.FileName.EndsWith("pdf")) // { // String fileNameII = Server.MapPath("~") + "/ICA/Credentials/Resume/" + biodataid + ".pdf"; // FileUpload2.SaveAs(fileNameII); // uploadNotificationII.Text = utilities.ShowSuccess("Uploaded Successfully."); // } // else // { // uploadNotificationII.Text = utilities.ShowError("Invalid File Format."); // } // } // catch (Exception ex) // { // } Response.Write("<script>alert('Registration Process is Successful');</script>"); Response.Redirect("~/guest/registrationPayment.aspx"); } else { } }
internal long RegisterUser(registrationViewModel regUser) { userModel userObj = new userModel() { personalInfo = new PersonalInfo() { FirstName = regUser.personalinfo.FirstName, MiddleName = regUser.personalinfo.MiddleName, LastName = regUser.personalinfo.LastName, Email = regUser.personalinfo.Email, Password = regUser.personalinfo.Password, Phone = regUser.personalinfo.Phone, Gender = regUser.personalinfo.Gender, Title = regUser.personalinfo.Title, // DateofBirth = regUser.personalinfo.DateofBirth != "" ? Convert.ToDateTime(regUser.personalinfo.DateofBirth) : new DateTime(), DateofBirth = regUser.personalinfo.DateofBirth != "" ? DateTime.ParseExact(regUser.personalinfo.DateofBirth, "dd/MM/yyyy", CultureInfo.InvariantCulture) : new DateTime(1900, 1, 1), MaritalStatus = regUser.personalinfo.MaritalStatus, }, residentialInfo = new ResidentialInfo() { Streetname = regUser.residentinfo.Streetname, StreetnameII = regUser.residentinfo.StreetnameII, City = regUser.residentinfo.City, State = regUser.residentinfo.State, Zipcode = regUser.residentinfo.Zipcode, Country = regUser.residentinfo.Country, }, educationInfo = new EducationInfo() { HighestDegree = regUser.educationinfo.HighestDegree, NameofSchool = regUser.educationinfo.NameofSchool, // Graddate = regUser.educationinfo.Graddate != "" ? Convert.ToDateTime(regUser.educationinfo.Graddate) : new DateTime(), Graddate = regUser.educationinfo.Graddate != "" ? DateTime.ParseExact(regUser.educationinfo.Graddate, "dd/MM/yyyy", CultureInfo.InvariantCulture) : new DateTime(1900, 1, 1), Certifications = regUser.educationinfo.Certifications }, employmentInfo = new EmploymentInfo() { YearsofExperience = Convert.ToInt32(regUser.employmentinfo.YearsofExperience), RecentEmployer = regUser.employmentinfo.RecentEmployer, Position = regUser.employmentinfo.Position, DateEmployed = regUser.employmentinfo.DateEmployed != "" ? DateTime.ParseExact(regUser.employmentinfo.DateEmployed, "dd/MM/yyyy", CultureInfo.InvariantCulture) : new DateTime(1900, 1, 1), Functions = regUser.employmentinfo.Functions, OtherEmployerII = regUser.employmentinfo.OtherEmployerII, PositionII = regUser.employmentinfo.PositionII, DateEmployedII = regUser.employmentinfo.DateEmployedII != "" ? DateTime.ParseExact(regUser.employmentinfo.DateEmployedII, "dd/MM/yyyy", CultureInfo.InvariantCulture) : new DateTime(1900, 1, 1), EndDateII = regUser.employmentinfo.EndDateII != "" ? DateTime.ParseExact(regUser.employmentinfo.EndDateII, "dd/MM/yyyy", CultureInfo.InvariantCulture) : new DateTime(1900, 1, 1), JobDescriptionII = regUser.employmentinfo.JobDescriptionII, OtherEmployerIII = regUser.employmentinfo.OtherEmployerIII, PositionIII = regUser.employmentinfo.PositionIII, DateEmployedIII = regUser.employmentinfo.DateEmployedIII != "" ? DateTime.ParseExact(regUser.employmentinfo.DateEmployedIII, "dd/MM/yyyy", CultureInfo.InvariantCulture) : new DateTime(1900, 1, 1), EndDateIII = regUser.employmentinfo.EndDateIII != "" ? DateTime.ParseExact(regUser.employmentinfo.EndDateIII, "dd/MM/yyyy", CultureInfo.InvariantCulture) : new DateTime(1900, 1, 1), JobDescriptionIII = regUser.employmentinfo.JobDescriptionIII, }, businessReferee = new BusinessReferee() { RefereeFirstName = regUser.businessreferee.RefereeFirstName, RefereeLastName = regUser.businessreferee.RefereeLastName, Position = regUser.businessreferee.PositionOccupied, RefereeEmail = regUser.businessreferee.RefereeEmail, RefereePhoneNumber = regUser.businessreferee.RefereePhoneNumber, RefereeFirstNameII = regUser.businessreferee.RefereeFirstNameII, RefereeLastNameII = regUser.businessreferee.RefereeLastNameII, PositionII = regUser.businessreferee.PositionOccupiedII, RefereeEmailII = regUser.businessreferee.RefereeEmailII, RefereePhoneNumberII = regUser.businessreferee.RefereePhoneNumberII }, userInfo = new UserInfo() { MemcategoryID = regUser.userinfo.MemcategoryID, }, studentInfo = new StudentInfo() { NyscStateCode = regUser.studentinfo.NyscStateCode }, companyInfo = new CompanyInfo() { Position = regUser.companyinfo.Position, CompanyName = regUser.companyinfo.CompanyName, CompanyAddress = regUser.companyinfo.CompanyAddress, CompanyEmail = regUser.companyinfo.CompanyEmail, WebAddress = regUser.companyinfo.WebAddress } //paymentDetails = new PaymentDetails() //{ // Description = regUser.paymentdetails.Description, // ReferenceID = regUser.paymentdetails.ReferenceID, // paymentitemID = Convert.ToInt32(regUser.paymentdetails.PaymentItemID), // Status = 1, //} }; int memcatID = regUser.userinfo.MemcategoryID; if (memcatID == 7) { return(conn.saveStudent(userObj)); } else if (memcatID == 4 || memcatID == 5 || memcatID == 6) { return(conn.saveUser(userObj)); } else { return(conn.saveCorporateData(userObj)); } }