예제 #1
0
        public void adddata(string __fname)
        {
            //get candidate first name, last name etc from db.
            var cclid = new DlCandidates();

            string[] temphldoldcan = cclid.Getcandidatesindb(Session["pusername"].ToString());

            if (temphldoldcan.Length > 0)
            {
                //add max count
                var cc       = new ClCodeconverter();
                int __pcount = cc.Getmaxfile(pathsetter);

                //upload to server
                FileUpload1.SaveAs(Server.MapPath(pathsetter) + __pcount + __fname);

                var app = new DlApps();

                //apps add
                int mxdocid = app.Getmaxdocid();
                int mxappid = app.Getmaxappid();

                var    cinf     = new CultureInfo("en-GB");
                string dobdate1 = temphldoldcan[3];

                //fill in app. automatically
                app.AddApplicationcan(Convert.ToInt32(temphldoldcan[4]), temphldoldcan[0], temphldoldcan[1], dobdate1,
                                      TextBox2.Text, mxdocid, Session["pusername"].ToString());
                app.AddApplicationMapping(Convert.ToInt16(Request.QueryString["JobID"]), mxappid);
                app.Adddocuments(__pcount + __fname, pathsetter + __pcount + __fname);
            }
        }
        public void adddata(string __fname)
        {
            //get candidate first name, last name etc from db.
            var cclid = new DlCandidates();
            string[] temphldoldcan = cclid.Getcandidatesindb(Session["pusername"].ToString());

            if (temphldoldcan.Length > 0)
            {
                //add max count
                var cc = new ClCodeconverter();
                int __pcount = cc.Getmaxfile(pathsetter);

                //upload to server
                FileUpload1.SaveAs(Server.MapPath(pathsetter) + __pcount + __fname);

                var app = new DlApps();

                //apps add
                int mxdocid = app.Getmaxdocid();
                int mxappid = app.Getmaxappid();

                var cinf = new CultureInfo("en-GB");
                string dobdate1 = temphldoldcan[3];

                //fill in app. automatically
                app.AddApplicationcan(Convert.ToInt32(temphldoldcan[4]), temphldoldcan[0], temphldoldcan[1], dobdate1,
                                      TextBox2.Text, mxdocid, Session["pusername"].ToString());
                app.AddApplicationMapping(Convert.ToInt16(Request.QueryString["JobID"]), mxappid);
                app.Adddocuments(__pcount + __fname, pathsetter + __pcount + __fname);
            }
        }
예제 #3
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            //set culture to british
            //modify here in future if this needs to be set to us formats

            var      cinf     = new CultureInfo("en-GB");
            DateTime dobsdate = Convert.ToDateTime(TextBox17.Text, cinf);

            string dobdate1 = dobsdate.ToString("MM/dd/yyyy");

            var clog = new DlLogins();

            if (Request.QueryString["CRF"] == "1")
            {
                if (clog.Checkcanusern(TextBox11.Text) != TextBox11.Text)
                {
                    //add users
                    var mpg   = new DlMainpagepopulator();
                    var phash = new ClPwdhash();

                    int mxuserid      = mpg.Maxuserid();
                    int mxcandidateid = mpg.Maxcandidateid();

                    string hashpwd = phash.GetMd5Hash(TextBox12.Text);

                    //add activation id and send it in email
                    var rands1 = new Random();

                    string makehashp = phash.GetMd5Hash(rands1.Next(10000, 100000).ToString(CultureInfo.InvariantCulture));

                    //add users
                    mpg.Insertusers(TextBox11.Text, TextBox2.Text, 1, TextBox3.Text, hashpwd, 2, mxuserid,
                                    TextBox13.Text, mxcandidateid, makehashp);

                    //add candidates
                    mpg.Insertcandidates(mxcandidateid, TextBox2.Text + " " + TextBox3.Text, TextBox2.Text,
                                         TextBox3.Text, TextBox4.Text, TextBox5.Text, TextBox6.Text, TextBox7.Text,
                                         TextBox8.Text, TextBox16.Text, TextBox9.Text, "", TextBox14.Text,
                                         TextBox15.Text, DateTime.Now.ToString("yyyy:MM:dd hh:mm:ss"), dobdate1);

                    //send email.
                    var emproc = new DlEmailprocessor();

                    //make email body
                    string emailbod =
                        emproc.Emailactivateusr(
                            "https://ahrcloud.com/ActivateAccount.aspx?activationid=" + makehashp +
                            "&usertype=2&username="******"AHRCLOUD: Account Activation!", emailbod, 3);

                    //logg it as the entry for email
                    emproc.Sendappemaildbupdate(TextBox11.Text, 2);

                    Session["reasons"] =
                        "Thank your for signing up, you are awsome! <br /> Please check your email to activate your account. <br /> ";

                    //redirect to confirmation page
                    Response.Redirect("~/confirm.aspx");
                }

                else
                {
                    Label26.Visible = true;
                }
            }

            else
            {
                //update candidates for required id
                //update users table
                var ccan = new DlCandidates();

                //update candidates table
                ccan.Runcandidateupdate(TextBox2.Text, TextBox3.Text, TextBox4.Text, TextBox5.Text, TextBox6.Text,
                                        TextBox7.Text, TextBox8.Text, TextBox16.Text, dobdate1, TextBox9.Text,
                                        TextBox14.Text, TextBox15.Text, Session["pusername"].ToString());
            }
        }
예제 #4
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            //set culture to british
            //modify here in future if this needs to be set to us formats

            var cinf = new CultureInfo("en-GB");
            DateTime dobsdate = Convert.ToDateTime(TextBox17.Text, cinf);

            string dobdate1 = dobsdate.ToString("MM/dd/yyyy");

            var clog = new DlLogins();

            if (Request.QueryString["CRF"] == "1")
            {
                if (clog.Checkcanusern(TextBox11.Text) != TextBox11.Text)
                {
                    //add users
                    var mpg = new DlMainpagepopulator();
                    var phash = new ClPwdhash();

                    int mxuserid = mpg.Maxuserid();
                    int mxcandidateid = mpg.Maxcandidateid();

                    string hashpwd = phash.GetMd5Hash(TextBox12.Text);

                    //add activation id and send it in email
                    var rands1 = new Random();

                    string makehashp = phash.GetMd5Hash(rands1.Next(10000, 100000).ToString(CultureInfo.InvariantCulture));

                    //add users
                    mpg.Insertusers(TextBox11.Text, TextBox2.Text, 1, TextBox3.Text, hashpwd, 2, mxuserid,
                                    TextBox13.Text, mxcandidateid, makehashp);

                    //add candidates
                    mpg.Insertcandidates(mxcandidateid, TextBox2.Text + " " + TextBox3.Text, TextBox2.Text,
                                         TextBox3.Text, TextBox4.Text, TextBox5.Text, TextBox6.Text, TextBox7.Text,
                                         TextBox8.Text, TextBox16.Text, TextBox9.Text, "", TextBox14.Text,
                                         TextBox15.Text, DateTime.Now.ToString("yyyy:MM:dd hh:mm:ss"), dobdate1);

                    //send email.
                    var emproc = new DlEmailprocessor();

                    //make email body
                    string emailbod =
                        emproc.Emailactivateusr(
                            "https://ahrcloud.com/ActivateAccount.aspx?activationid=" + makehashp +
                            "&usertype=2&username="******"AHRCLOUD: Account Activation!", emailbod, 3);

                    //logg it as the entry for email
                    emproc.Sendappemaildbupdate(TextBox11.Text, 2);

                    Session["reasons"] =
                        "Thank your for signing up, you are awsome! <br /> Please check your email to activate your account. <br /> ";

                    //redirect to confirmation page
                    Response.Redirect("~/confirm.aspx");
                }

                else
                {
                    Label26.Visible = true;
                }
            }

            else
            {
                //update candidates for required id
                //update users table
                var ccan = new DlCandidates();

                //update candidates table
                ccan.Runcandidateupdate(TextBox2.Text, TextBox3.Text, TextBox4.Text, TextBox5.Text, TextBox6.Text,
                                        TextBox7.Text, TextBox8.Text, TextBox16.Text, dobdate1, TextBox9.Text,
                                        TextBox14.Text, TextBox15.Text, Session["pusername"].ToString());
            }
        }