protected void btnSearch_Click(object sender, EventArgs e)
        {
            DataManager.DataAccess da = new DataManager.DataAccess();
            DataSet dsPersons = new DataSet();
            int PersonID = Convert.ToInt32(txtID.Text);

            dsPersons = da.FetchPerson(PersonID);
            gvPersonName.DataSource = dsPersons;
            gvPersonName.DataBind();
        }
        protected void gvPersonName_PageIndexChanging2(object sender, GridViewPageEventArgs e)
        {
            gvPersonName.PageIndex = e.NewPageIndex;
            DataManager.DataAccess da = new DataManager.DataAccess();
            DataSet dsPersons = new DataSet();

            dsPersons = da.FetchPerson(txtFirstName.Text.Trim(), txtLastName.Text.Trim());
            gvPersonName.DataSource = dsPersons;
            gvPersonName.DataBind();
        }
        protected void gvPersonName_PageIndexChanging2(object sender, GridViewPageEventArgs e)
        {
            gvPersonName.PageIndex = e.NewPageIndex;
            DataManager.DataAccess da = new DataManager.DataAccess();
            DataSet dsPersons         = new DataSet();

            dsPersons = da.FetchPerson(txtFirstName.Text.Trim(), txtLastName.Text.Trim());
            gvPersonName.DataSource = dsPersons;
            gvPersonName.DataBind();
        }
        public void SearchPersonFunction()
        {
            DataManager.DataAccess da = new DataManager.DataAccess();
            DataSet dsPersons         = new DataSet();
            int     PersonID          = Convert.ToInt32(txtID.Text);

            dsPersons = da.FetchPerson(PersonID);
            gvPersonName.DataSource = dsPersons;
            gvPersonName.DataBind();
        }
        public void SearchPersonFunction()
        {
            DataManager.DataAccess da = new DataManager.DataAccess();
            DataSet dsPersons = new DataSet();
            int PersonID = Convert.ToInt32(txtID.Text);

            dsPersons = da.FetchPerson(PersonID);
            gvPersonName.DataSource = dsPersons;
            gvPersonName.DataBind();
        }
示例#6
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            DataManager.DataAccess da = new DataManager.DataAccess();
            DataSet dsPersons         = new DataSet();
            int     PersonID          = Convert.ToInt32(txtID.Text);

            dsPersons = da.FetchPerson(PersonID);
            gvPersonName.DataSource = dsPersons;
            gvPersonName.DataBind();
        }
        protected void btnFindPerson_Click(object sender, EventArgs e)
        {
            //'Dim da As New DataAccess_OLD

            DataManager.DataAccess da = new DataManager.DataAccess();
            DataSet dsPersons = new DataSet();

            dsPersons = da.FetchPerson(txtFirstName.Text.Trim(), txtLastName.Text.Trim());
            gvPersonName.DataSource = dsPersons;
            gvPersonName.DataBind();
        }
        protected void btnFindPerson_Click(object sender, EventArgs e)
        {
            //'Dim da As New DataAccess_OLD


            DataManager.DataAccess da = new DataManager.DataAccess();
            DataSet dsPersons         = new DataSet();

            dsPersons = da.FetchPerson(txtFirstName.Text.Trim(), txtLastName.Text.Trim());
            gvPersonName.DataSource = dsPersons;
            gvPersonName.DataBind();
        }
        protected void SearchButton_Click(object sender, EventArgs e)
        {
            if (txtID.Text != "")
            {
                DataManager.DataAccess da = new DataManager.DataAccess();
                DataSet dsPersons         = new DataSet();
                int     PersonID          = Convert.ToInt32(txtID.Text);

                dsPersons = da.FetchPerson(PersonID);
                gvPersonName.DataSource = dsPersons;
                gvPersonName.DataBind();
            }

            else
            {
                DataManager.DataAccess da = new DataManager.DataAccess();
                DataSet dsPersons         = new DataSet();

                dsPersons = da.FetchPerson(txtFirstName.Text.Trim(), txtLastName.Text.Trim());
                gvPersonName.DataSource = dsPersons;
                gvPersonName.DataBind();
            }
        }
        private void LoadPerson()
        {
            this.txtID.Text = Request.QueryString["PersonID"];
            int PersonID = Convert.ToInt32(txtID.Text);

            DataManager.DataAccess da = new DataManager.DataAccess();

            DataSet ds = da.FetchPerson(PersonID);

            object pi = ds.Tables[0].Rows[0]["PersonID"];
            object fn = ds.Tables[0].Rows[0]["FirstName"];
            object ln = ds.Tables[0].Rows[0]["LastName"];

            txtID.Text        = pi.ToString();
            txtFirstName.Text = fn.ToString();
            txtLastName.Text  = ln.ToString();

            String FirstName = txtFirstName.Text;
            String LastName  = txtLastName.Text;

            // add an else, set the NameDisplayLabel to empty string, and i
            NameDisplayLabel.Text = FirstName + " " + LastName + " has been added to the database.";
        }
        private void LoadPerson()
        {
            this.txtID.Text = Request.QueryString["PersonID"];
            int PersonID = Convert.ToInt32(txtID.Text);

            DataManager.DataAccess da = new DataManager.DataAccess();

            DataSet ds = da.FetchPerson(PersonID);

            object pi = ds.Tables[0].Rows[0]["PersonID"];
            object fn = ds.Tables[0].Rows[0]["FirstName"];
            object ln = ds.Tables[0].Rows[0]["LastName"];
            txtID.Text = pi.ToString();
            txtFirstName.Text = fn.ToString();
            txtLastName.Text = ln.ToString();

            String FirstName = txtFirstName.Text;
            String LastName = txtLastName.Text;
            // add an else, set the NameDisplayLabel to empty string, and i
            NameDisplayLabel.Text = FirstName + " " + LastName + " has been added to the database.";
        }
        protected void SearchButton_Click(object sender, EventArgs e)
        {
            if (txtID.Text != "")
            {
                DataManager.DataAccess da = new DataManager.DataAccess();
                DataSet dsPersons = new DataSet();
                int PersonID = Convert.ToInt32(txtID.Text);

                dsPersons = da.FetchPerson(PersonID);
                gvPersonName.DataSource = dsPersons;
                gvPersonName.DataBind();

            }

            else
            {
                DataManager.DataAccess da = new DataManager.DataAccess();
                DataSet dsPersons = new DataSet();

                dsPersons = da.FetchPerson(txtFirstName.Text.Trim(), txtLastName.Text.Trim());
                gvPersonName.DataSource = dsPersons;
                gvPersonName.DataBind();

            }
        }