protected void btnSubmit_Click(object sender, EventArgs e) { string name = txtName.Text.ToString(); string email = txtEmail.Text.ToString(); string phNo = txtMobNo.Text.ToString(); string pswd = txtPswd.Text.ToString(); string level = ddlQual.SelectedItem.Text.ToString(); string institute = ddlUniversity.SelectedItem.Text.ToString(); string marks = ddlMarks.SelectedItem.Text.ToString(); string city = ddlCity.SelectedItem.Text.ToString(); string company = ddlCompany.SelectedItem.Text.ToString(); string experience = ddlExp.SelectedItem.Text.ToString(); string comments = txtAreaAbout.Text.ToString(); string fileSaved = string.Empty; User user = new User(name, email, email, phNo, level, institute, marks, city, company, experience, comments, ApplicationSession.Current.UserType); user.Password = pswd; HttpPostedFile file = Request.Files["ctl00$ContentPlaceHolder1$fileType"]; fileSaved = SaveResume(user.Email, file); if (!string.IsNullOrEmpty(fileSaved)) { user.ResumeSubmitted = "Y"; // user.ResumePath = user.Email.Substring(0, user.Email.IndexOf("@")).ToString() + '/' + file.FileName; user.ResumePath = fileSaved.Substring(fileSaved.IndexOf("Resume")); //folder + '/' +email.Substring(0, email.IndexOf("@")).ToString()+DateTime.Now+ filename } else { user.ResumeSubmitted = "N"; } user.Add.Location = ""; string userMessage = SendEmail.BuildUserMail(user); string adminMessage = SendEmail.BuildAdminMail(user); if (UserBO.UserRegistration(user, userMessage, adminMessage, Constants.MailSubject)) { ApplicationSession.Current.user = new User(user); ApplicationSession.Current.user.Name = name; ApplicationSession.Current.user.Email = email; //Mailing Windows Service //SendEmail.SendUserMail(user); //ResetFields(); //ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModal();", true); //ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "none", "<script>$('#regConfirm').modal('show');</script>", false); //ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "none", "<script>alert('Registration Successful! You can now Login');</script>", false); Response.Redirect("~/login?login="******"id", "callMyJSFunction()", true); //Response.Redirect("Default.aspx"); } else { ClientScript.RegisterStartupScript(GetType(), "id", "<script>alert('server busy!!!')</script>", true); } }
protected void btnSubmit_Click1(object sender, EventArgs e) { string name = txtName.Text.ToString(); string phNo = txtMobNo.Text.ToString(); string email = txtEmail.Text.ToString(); string query = txtQuery.Text.ToString(); string city = ddlCity.SelectedItem.Text.ToString(); string level = ddlQual.SelectedItem.Text.ToString(); string careerField = ddlCareerField.SelectedItem.Text.ToString(); User user = new User(name, phNo, email, query, city, level, careerField, Constants.QUERYUSERTYPE); string userMessage = SendEmail.BuildUserMail(user); string adminMessage = SendEmail.BuildAdminMail(user); if (UserBO.AddUserQury(user, userMessage, adminMessage, Constants.MailSubject)) { //Mailing Windows Service //SendEmail.SendUserMail(user); submitInfo.Visible = true; ResetSubmitFields(); submitInfo.InnerText = "Thank you!!We will reach at you shortly."; } }