Exemplo n.º 1
0
        protected void btnSumbit_Click(object sender, EventArgs e)
        {
            Server.Transfer("/About.aspx", true);

            if (Page.IsValid)
            {
                string expertise     = lstExpertise.SelectedItem.Text;
                string Qualification = chkQualification.SelectedItem.Text;

                var input = new Assessment()
                {
                    id            = 1,
                    firstname     = txtFirstName.Text,
                    lastname      = textLastName.Text,
                    email         = txtEmail.Text,
                    age           = Convert.ToInt32(txtAge.Text),
                    Gender        = (rdGender.SelectedIndex == 1) ? 2 : 1,
                    expertise     = expertise,
                    country       = ddlCountry.SelectedItem.Text,
                    qualification = Qualification
                };

                DataAccessLogic obj = new DataAccessLogic();
                obj.SaveAssessment(input);
                //bool res = obj.Register(txtEmail.Text,txtPassword.Text);
                var dataList = obj.GetAssessments();
                grdAssessments.DataSource = dataList;
                grdAssessments.DataBind();
            }
        }
Exemplo n.º 2
0
        protected void grdAssessments_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            DataAccessLogic obj = new DataAccessLogic();

            grdAssessments.PageIndex = e.NewPageIndex;
            var dataList = obj.GetAssessments();

            grdAssessments.DataSource = dataList;
            grdAssessments.DataBind();
        }