protected void Button2_Click(object sender, EventArgs e) { if (capts.Text == Session["capts"].ToString()) { //check if the current user exists in the database var lgeins = new DlLogins(); _fg = Convert.ToInt16(Request.QueryString["Fg"]); if (_fg == 1) { //update //update user rec information var yohrecl = new DlRecruiter(); yohrecl.Runrecuserupdate(TextBox2.Text, TextBox3.Text, Session["pusername"].ToString()); //update logo if (FileUpload1.PostedFile.FileName.Length > 1) { //get current article id for the logo. int tmpartid = yohrecl.Getarticleids(Session["pusername"].ToString()); //save to hlogo string hlogo = ConfigurationManager.AppSettings["filepth"] + tmpartid + FileUpload1.PostedFile.FileName; //update articles FileUpload1.PostedFile.SaveAs(hlogo); //update articles in db yohrecl.Runreclogoupdate(hlogo, "Recruiter Logo", Session["pusername"].ToString()); } //update recruiters own information yohrecl.Runrectableupdate(TextBox4.Text, TextBox5.Text, TextBox6.Text, TextBox7.Text, TextBox8.Text, TextBox9.Text, TextBox10.Text, TextBox15.Text, TextBox16.Text, TextBox14.Text, Session["pusername"].ToString()); } else { if (lgeins.Checkrecusern(TextBox11.Text) != TextBox11.Text) { //insert var mps = new DlMainpagepopulator(); var pwds = new ClPwdhash(); var arc = new DlArticles(); int getmaxrec = mps.RecHasRows() + 1; int getmaxrecarticles = getmaxrec + 10000000; int getmaxrecuserid = getmaxrec + 20000000; var rnd23 = new Random(); string shahsp = pwds.GetMd5Hash(rnd23.Next(10000, 100000).ToString(CultureInfo.InvariantCulture)); //set email body var emaps = new DlEmailprocessor(); string ebod1 = emaps.Emailactivateusr( "https://ahrcloud.com/ActivateAccount.aspx?activationid=" + shahsp + "&usertype=1&username="******"GB", TextBox9.Text, TextBox11.Text, TextBox15.Text, TextBox16.Text, TextBox14.Text, DateTime.Now.ToString("yyyy:MM:dd hh:mm:ss"), 1, getmaxrecarticles); //users and pwds string md5h = pwds.GetMd5Hash(TextBox12.Text); mps.Insertusers(TextBox11.Text, TextBox2.Text, 1, TextBox3.Text, md5h, 1, getmaxrecuserid, "hint", -1, shahsp); //employee logo string holdlogo = Path.GetFileName(FileUpload1.PostedFile.FileName); arc.AddArticle(getmaxrecarticles, holdlogo, ConfigurationManager.AppSettings["filepth"] + getmaxrecarticles + holdlogo); //real upload FileUpload1.PostedFile.SaveAs(ConfigurationManager.AppSettings["filepth"] + getmaxrecarticles + holdlogo); //user recruiter assignments mps.Insertrecusermapping(getmaxrecuserid, getmaxrec); //finally send out the email emaps.Clemail.Sendmailproc(TextBox11.Text, "AHRCLOUD: Account Activation!", ebod1, 4); //logg it as the entry for email emaps.Sendappemaildbupdate(TextBox11.Text, 1); } else { //user already exists Label24.Visible = true; } } } else { Label31.Text = "please retype the captcha as shown in grey box!"; } }