Beispiel #1
0
        private void _List_AddingNew(object sender, AddingNewEventArgs e)
        {
            e.NewObject = new EmployeeSubordinate();
            EmployeeSubordinate employeeSubordinate = (EmployeeSubordinate)e.NewObject;

            employeeSubordinate.Savable += EmployeeSubordinate_Savable;
        }
Beispiel #2
0
        public EmployeeSubordinateList GetByEmployeeId(Guid id)
        {
            Database database = new Database("Employer");

            database.Command.Parameters.Clear();
            database.Command.CommandType = System.Data.CommandType.StoredProcedure;
            database.Command.CommandText = "tblEmployeeSubordinateGetByEmployeeId";
            database.Command.Parameters.Add("@EmployeeId", SqlDbType.UniqueIdentifier).Value = id;
            DataTable dt = database.ExecuteQuery();

            foreach (DataRow dr in dt.Rows)
            {
                EmployeeSubordinate eSub = new EmployeeSubordinate();
                eSub.Initialize(dr);
                eSub.InitializeBusinessData(dr);
                eSub.IsNew    = false;
                eSub.IsDirty  = false;
                eSub.Savable += EmployeeSubordinate_Savable;
                _List.Add(eSub);
            }

            return(this);
        }