Пример #1
0
        public PersonAddress(int PersonID, int AddressID)
        {
            // DataPortal.PersonAddressesData dp = new DataPortal.PersonAddressesData();
            DataPortal.PersonAddressData dp = new DataPortal.PersonAddressData();
            DataSet ds = new DataSet();

            //int PersonID;
            //int AddressID;
            // ds = dp.Fetch(PersonID, AddressID);
            ds = dp.Fetch(PersonID);

            //I don't know what dataSource to set this to, and where to bind it to?
            //data tier middle tier, user interfave
            //this week

            //This is a business object, PersonAddress is a class that defines
            //personAddress class has properties and methods.
            // Create UPDATE, DELETE, View the data Action words, things that can be done
            //properties are a unique way of describing what
            //strongly types our data.
            //instantiata an object of type personAddress, and we can get to the data through the properties.


            //set the properties using the results that have been sent to it.
            //you would need to fetch the data then use it. fetch the values and then  set them using these values and propertietr
            //in the past I would usde the dataManager,  like fetch person address, I cazn re use that, howerver I am not to ue
            //use the dataPortal object, the fetch method that i need, but it in the person address.cs file which is an empty class
            //put in a fetch  call it fetch. the only things that will go in this class
            //data access object and called a method like fetch person address, that dataset would set values,
            //in here call a methor in perosn address data that method needs to return a dataset
            //and then you will use that dataset to initialize the variablea and properties of your class.
            //more reading on object oriented pay close attention to inheritence
            //second source as well for that .
        }
Пример #2
0
        public PersonAddress(int PersonID, int AddressID)
        {
            // DataPortal.PersonAddressesData dp = new DataPortal.PersonAddressesData();
            DataPortal.PersonAddressData dp = new DataPortal.PersonAddressData();
            DataSet ds = new DataSet();
            //int PersonID;
            //int AddressID;
              // ds = dp.Fetch(PersonID, AddressID);
               ds = dp.Fetch(PersonID);

            //I don't know what dataSource to set this to, and where to bind it to?
            //data tier middle tier, user interfave
            //this week

            //This is a business object, PersonAddress is a class that defines
            //personAddress class has properties and methods.
            // Create UPDATE, DELETE, View the data Action words, things that can be done
            //properties are a unique way of describing what
            //strongly types our data.
            //instantiata an object of type personAddress, and we can get to the data through the properties.

            //set the properties using the results that have been sent to it.
            //you would need to fetch the data then use it. fetch the values and then  set them using these values and propertietr
            //in the past I would usde the dataManager,  like fetch person address, I cazn re use that, howerver I am not to ue
            //use the dataPortal object, the fetch method that i need, but it in the person address.cs file which is an empty class
            //put in a fetch  call it fetch. the only things that will go in this class
            //data access object and called a method like fetch person address, that dataset would set values,
            //in here call a methor in perosn address data that method needs to return a dataset
            //and then you will use that dataset to initialize the variablea and properties of your class.
            //more reading on object oriented pay close attention to inheritence
            //second source as well for that .
        }
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            DataPortal.EmailAddressesData ead = new DataPortal.EmailAddressesData();

            DataPortal.PersonAddressData pad = new DataPortal.PersonAddressData();

            //DataSet ds = new DataSet();
            int AddressID = Convert.ToInt32(txtAID.Text);

            //pad.Delete(AddressID);
            int affectedRecords = pad.Delete(AddressID);

            //int x = Convert.ToInt32(txtID.Text);
            if (affectedRecords > 0)
            {
                Response.Redirect("WebForm1.aspx?PersonID=" + txtID.Text);
            }
        }
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            DataPortal.EmailAddressesData ead = new DataPortal.EmailAddressesData();

            DataPortal.PersonAddressData pad = new DataPortal.PersonAddressData();

            //DataSet ds = new DataSet();
            int AddressID = Convert.ToInt32(txtAID.Text);

            //pad.Delete(AddressID);
            int affectedRecords = pad.Delete(AddressID);

            //int x = Convert.ToInt32(txtID.Text);
            if (affectedRecords > 0)
            {
                Response.Redirect("WebForm1.aspx?PersonID=" + txtID.Text);
            }
        }