Ejemplo n.º 1
0
        protected void btnSubmit_Click1(object sender, EventArgs e)
        {
            Models.Profile A = new Models.Profile();
            A.FirstName  = txtFirstName.Text;
            A.LastName   = txtLastName.Text;
            A.Image      = "";
            A.Email      = txtEmail.Text;
            A.Middlename = txtMiddleName.Text;
            A.schoolid   = Convert.ToInt32(txtIdNumber.Text);
            A.Street     = txtstreet.Text;
            A.Town       = txttown.Text;
            A.Parish     = txtparish.Text;
            //  int sid = Models.Business.Profile_Insert(A.FirstName, A.LastName, A.Image, A.Middlename, A.schoolid, A.Street, A.Town, A.Parish,A.Email);



            Session["Applicant"] = A;
            Response.Redirect("Next.aspx");
        }
Ejemplo n.º 2
0
        public Models.Profile GetEmailById(int studentid)
        {
            string cs = ConfigurationManager.ConnectionStrings["UBSConnection"].ConnectionString;

            using (SqlConnection con = new SqlConnection(cs))
            {
                SqlCommand cmd = new SqlCommand("SelectEmailById", con);
                cmd.CommandType = CommandType.StoredProcedure;
                SqlParameter parameter = new SqlParameter("@id", studentid);
                cmd.Parameters.Add(parameter);
                Models.Profile a = new Models.Profile();
                con.Open();
                SqlDataReader reader = cmd.ExecuteReader();
                while (reader.Read())
                {
                    a.Email = reader["email"].ToString();
                }

                return(a);
            }
        }