コード例 #1
0
        private void _List_AddingNew(object sender, AddingNewEventArgs e)
        {
            e.NewObject = new EmployeeEmail();
            EmployeeEmail employeeEmail = (EmployeeEmail)e.NewObject;

            employeeEmail.Savable += EmployeeEmail_Savable;
        }
コード例 #2
0
        public EmployeeEmailList GetByEmployeeId(Guid id)
        {
            Database database = new Database("Employer");

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

            foreach (DataRow dr in dt.Rows)
            {
                EmployeeEmail eEmail = new EmployeeEmail();
                eEmail.Initialize(dr);
                eEmail.InitializeBusinessData(dr);
                eEmail.IsNew    = false;
                eEmail.IsDirty  = false;
                eEmail.Savable += EmployeeEmail_Savable;
                _List.Add(eEmail);
            }

            return(this);
        }