Example #1
0
        public override bool Delete(int id)
        {
            bool success;

            try
            {
                dsAddressBookTableAdapters.directoryTableAdapter directory = new dsAddressBookTableAdapters.directoryTableAdapter();
                directory.DeleteQuery(id);

                success = true;
            }
            catch (Exception)
            {
                success = false;
            }
            return(success);
        }
Example #2
0
        public override bool Update(int id)
        {
            bool success;

            try
            {
                dsAddressBookTableAdapters.directoryTableAdapter directory = new dsAddressBookTableAdapters.directoryTableAdapter();
                directory.Edit(FirstName, LastName, Email, PhoneNumber, id);

                success = true;
            }
            catch (Exception)
            {
                success = false;
            }
            return(success);
        }
Example #3
0
        public override bool GetData(int id)
        {
            bool success = false;

            try
            {
                dsAddressBookTableAdapters.directoryTableAdapter ta = new dsAddressBookTableAdapters.directoryTableAdapter();
                dsAddressBook.directoryDataTable dt = ta.GetDataById(id);

                if (dt.Rows.Count > 0)
                {
                    data    = (dsAddressBook.directoryRow)dt.Rows[0];
                    success = true;
                }
            }
            catch (Exception)
            {
                success = false;
            }

            return(success);
        }