public static void UpdateAccessModifiedFlags(DB.SEC_Role secRole) { //TODO : Make this work again //secRole.AccessModifiedOn = DateTime.Now; //secRole.AccessModifiedBy = ApplicationDataContext.Instance.LoggedInUser.DisplayName; //dataContext.EntityContext.SaveChanges(); }
protected override void OnNewRecord() { try { base.OnNewRecord(); secRole = BL.SEC.SEC_Role.New; } catch (Exception ex) { if (CDS.Shared.Exception.UserInterfaceExceptionHandler.HandleException(ref ex)) { throw ex; } } }
internal static String Save(DB.SEC_Role entry, DataContext dataContext) { try { if (dataContext.EntitySecurityContext.GetEntityState(entry) == System.Data.Entity.EntityState.Detached) { dataContext.EntitySecurityContext.SEC_Role.Add(entry); } } catch (System.Data.Entity.Validation.DbEntityValidationException ex) { return(dataContext.PackageValidationException()); } return("Success"); }
public override void OpenRecord(Int64 Id) { try { secRole = BL.SEC.SEC_Role.Load(Id, DataContext, new List <String>() { "SEC_RoleAccess" }); } catch (Exception ex) { if (CDS.Shared.Exception.UserInterfaceExceptionHandler.HandleException(ref ex)) { throw ex; } } }
/// <summary> /// Loads and opens the next Role record. The current record is not saved. /// </summary> /// <remarks>Created: Theo Crous 23/07/2012</remarks> protected override void OnNextRecord() { try { base.OnNextRecord(); DB.SEC_Role secRole = BL.SEC.SEC_Role.GetNextItem((DB.SEC_Role)BindingSource.DataSource, DataContext); if (secRole != null) { BindingSource.DataSource = secRole; BindData(); } } catch (Exception ex) { if (CDS.Shared.Exception.UserInterfaceExceptionHandler.HandleException(ref ex)) { throw ex; } } }
public static DB.SEC_Role GetPreviousItem(DB.SEC_Role sec_role, DataContext dataContext) { return(dataContext.EntitySecurityContext.SEC_Role.OrderByDescending(o => o.Code).FirstOrDefault(n => n.Code.CompareTo(sec_role.Code) < 0 && n.Code.CompareTo(sec_role.Code) != 0)); }