/// <summary> /// The binding source is bound to a new instance of an Role. This is for the instances where a new record is to be created. /// </summary> /// <remarks>Created: Theo Crous 24/07/2012</remarks> protected override void OnNewRecord() { try { base.OnNewRecord(); hrsRole = BL.HRS.HRS_Role.New; } catch (Exception ex) { if (CDS.Shared.Exception.UserInterfaceExceptionHandler.HandleException(ref ex)) { throw ex; } } }
internal static String Save(DB.HRS_Role entry, DataContext dataContext) { try { if (dataContext.EntityHumanResourcesContext.GetEntityState(entry) == System.Data.Entity.EntityState.Detached) { dataContext.EntityHumanResourcesContext.HRS_Role.Add(entry); } } catch (System.Data.Entity.Validation.DbEntityValidationException ex) { return(dataContext.PackageValidationException()); } return("Success"); }
/// <summary> /// Open a Role record from the database. /// </summary> /// <param name="Id">The id (primary key) of the Role to open.</param> /// <remarks>Created: Theo Crous 24/07/2012</remarks> public override void OpenRecord(Int64 Id) { try { base.OpenRecord(Id); hrsRole = BL.HRS.HRS_Role.Load(Id, DataContext); chkAppointments.SetItemChecked(0, hrsRole.Appointment.Value); chkAppointments.SetItemChecked(1, hrsRole.PurchaseAppointment.Value); chkAppointments.SetItemChecked(2, hrsRole.SaleAppointment.Value); chkAppointments.SetItemChecked(3, hrsRole.WorkshopAppointment.Value); } catch (Exception ex) { if (CDS.Shared.Exception.UserInterfaceExceptionHandler.HandleException(ref ex)) { throw ex; } } }