private void _List_AddingNew(object sender, AddingNewEventArgs e) { e.NewObject = new EmployeeFamily(); EmployeeFamily employeeFamily = (EmployeeFamily)e.NewObject; employeeFamily.Savable += EmployeeFamily_Savable; }
public EmployeeFamilyList GetByEmployeeId(Guid id) { Database database = new Database("Employer"); database.Command.Parameters.Clear(); database.Command.CommandType = System.Data.CommandType.StoredProcedure; database.Command.CommandText = "tblEmployeeFamilyGetByEmployeeId"; database.Command.Parameters.Add("@EmployeeId", SqlDbType.UniqueIdentifier).Value = id; DataTable dt = database.ExecuteQuery(); foreach (DataRow dr in dt.Rows) { EmployeeFamily eFam = new EmployeeFamily(); eFam.Initialize(dr); eFam.InitializeBusinessData(dr); eFam.IsNew = false; eFam.IsDirty = false; eFam.Savable += EmployeeFamily_Savable; _List.Add(eFam); } return(this); }