Example #1
0
        public PhoneTypeList GetAll()
        {
            Database database = new Database("Employer");

            database.Command.Parameters.Clear();
            database.Command.CommandType = System.Data.CommandType.StoredProcedure;
            database.Command.CommandText = "tblPhoneTypeGetAll";
            DataTable dt    = database.ExecuteQuery();
            PhoneType blank = new PhoneType();

            blank.Type = "Select a Phone Type";
            _List.Add(blank);
            foreach (DataRow dr in dt.Rows)
            {
                PhoneType e = new PhoneType();
                e.Initialize(dr);
                e.InitializeBusinessData(dr);
                e.IsNew    = false;
                e.IsDirty  = false;
                e.Savable += PhoneType_Savable;
                _List.Add(e);
            }

            return(this);
        }
Example #2
0
        private void _List_AddingNew(object sender, AddingNewEventArgs e)
        {
            e.NewObject = new PhoneType();
            PhoneType PhoneType = (PhoneType)e.NewObject;

            PhoneType.Savable += PhoneType_Savable;
        }
Example #3
0
        public PhoneTypeList GetAll()
        {
            StudentDB database = new StudentDB("Student");

            database.Command.Parameters.Clear();
            database.Command.CommandType = System.Data.CommandType.StoredProcedure;
            database.Command.CommandText = "tblPhoneType_GETALL";
            DataTable dt = database.ExecuteQuery();

            foreach (DataRow dr in dt.Rows)
            {
                PhoneType phonetype = new PhoneType();
                phonetype.Initialize(dr);
                phonetype.InitializeBusinessData(dr);
                phonetype.isNew   = false;
                phonetype.isDirty = false;
                _List.Add(phonetype);
            }
            return(this);
        }
        public PhoneTypeList GetAll()
        {
            Database database = new Database("Employer");

            database.Command.Parameters.Clear();
            database.Command.CommandType = CommandType.StoredProcedure;
            database.Command.CommandText = "tblPhoneTypeGetAll";

            DataTable dt = database.ExecuteQuery();

            foreach (DataRow dr in dt.Rows)
            {
                PhoneType p = new PhoneType();
                p.Initialize(dr);
                p.InitializeBusinessData(dr);
                p.IsNew    = false;
                p.IsDirty  = false;
                p.Savable += Phonetype_Savable;
                _List.Add(p);
            }

            return(this);
        }