public bool PermissionType_Updated(Context context, Column column = null) { return(PermissionType.ToLong() != SavedPermissionType && (column == null || column.DefaultInput.IsNullOrEmpty() || column.DefaultInput.ToLong() != PermissionType.ToLong())); }
private string DisplayTypeName() { var permissionType = Type.ToLong(); return(Parameters.Permissions.Pattern.ContainsValue(permissionType) ? Displays.Get(Parameters.Permissions.Pattern.First(o => o.Value == permissionType).Key) : Displays.Special()); }
private string DisplayTypeName(Context context) { var permissionType = Type.ToLong(); var typeName = Parameters.Permissions.Pattern.ContainsValue(permissionType) ? Displays.Get( context: context, id: Parameters.Permissions.Pattern.First(o => o.Value == permissionType).Key) : Displays.Special(context: context); return($" - [{typeName}]"); }
private void Set(Context context, DataRow dataRow, string tableAlias = null) { AccessStatus = Databases.AccessStatuses.Selected; foreach (DataColumn dataColumn in dataRow.Table.Columns) { var column = new ColumnNameInfo(dataColumn.ColumnName); if (column.TableAlias == tableAlias) { switch (column.Name) { case "ReferenceId": if (dataRow[column.ColumnName] != DBNull.Value) { ReferenceId = dataRow[column.ColumnName].ToLong(); SavedReferenceId = ReferenceId; } break; case "DeptId": if (dataRow[column.ColumnName] != DBNull.Value) { DeptId = dataRow[column.ColumnName].ToInt(); SavedDeptId = DeptId; } break; case "GroupId": if (dataRow[column.ColumnName] != DBNull.Value) { GroupId = dataRow[column.ColumnName].ToInt(); SavedGroupId = GroupId; } break; case "UserId": if (dataRow[column.ColumnName] != DBNull.Value) { UserId = dataRow[column.ColumnName].ToInt(); SavedUserId = UserId; } break; case "Ver": Ver = dataRow[column.ColumnName].ToInt(); SavedVer = Ver; break; case "DeptName": DeptName = dataRow[column.ColumnName].ToString(); SavedDeptName = DeptName; break; case "GroupName": GroupName = dataRow[column.ColumnName].ToString(); SavedGroupName = GroupName; break; case "Name": Name = dataRow[column.ColumnName].ToString(); SavedName = Name; break; case "PermissionType": PermissionType = (Permissions.Types)dataRow[column.ColumnName].ToLong(); SavedPermissionType = PermissionType.ToLong(); break; case "Comments": Comments = dataRow[column.ColumnName].ToString().Deserialize <Comments>() ?? new Comments(); SavedComments = Comments.ToJson(); break; case "Creator": Creator = SiteInfo.User(context: context, userId: dataRow.Int(column.ColumnName)); SavedCreator = Creator.Id; break; case "Updator": Updator = SiteInfo.User(context: context, userId: dataRow.Int(column.ColumnName)); SavedUpdator = Updator.Id; break; case "CreatedTime": CreatedTime = new Time(dataRow, column.ColumnName); SavedCreatedTime = CreatedTime.Value; break; case "UpdatedTime": UpdatedTime = new Time(dataRow, column.ColumnName); Timestamp = dataRow.Field <DateTime>(column.ColumnName).ToString("yyyy/M/d H:m:s.fff"); SavedUpdatedTime = UpdatedTime.Value; break; case "IsHistory": VerType = dataRow[column.ColumnName].ToBool() ? Versions.VerTypes.History : Versions.VerTypes.Latest; break; } } } }
private void Set(DataRow dataRow) { AccessStatus = Databases.AccessStatuses.Selected; foreach (DataColumn dataColumn in dataRow.Table.Columns) { var name = dataColumn.ColumnName; switch (name) { case "Word": if (dataRow[name] != DBNull.Value) { Word = dataRow[name].ToString(); SavedWord = Word; } break; case "ReferenceId": if (dataRow[name] != DBNull.Value) { ReferenceId = dataRow[name].ToLong(); SavedReferenceId = ReferenceId; } break; case "Ver": Ver = dataRow[name].ToInt(); SavedVer = Ver; break; case "Priority": Priority = dataRow[name].ToInt(); SavedPriority = Priority; break; case "ReferenceType": ReferenceType = dataRow[name].ToString(); SavedReferenceType = ReferenceType; break; case "Title": Title = dataRow[name].ToString(); SavedTitle = Title; break; case "Subset": Subset = dataRow[name].ToString(); SavedSubset = Subset; break; case "PermissionType": PermissionType = (Permissions.Types)dataRow[name].ToLong(); SavedPermissionType = PermissionType.ToLong(); break; case "Comments": Comments = dataRow["Comments"].ToString().Deserialize <Comments>() ?? new Comments(); SavedComments = Comments.ToJson(); break; case "Creator": Creator = SiteInfo.User(dataRow.Int(name)); SavedCreator = Creator.Id; break; case "Updator": Updator = SiteInfo.User(dataRow.Int(name)); SavedUpdator = Updator.Id; break; case "CreatedTime": CreatedTime = new Time(dataRow, "CreatedTime"); SavedCreatedTime = CreatedTime.Value; break; case "UpdatedTime": UpdatedTime = new Time(dataRow, "UpdatedTime"); Timestamp = dataRow.Field <DateTime>("UpdatedTime").ToString("yyyy/M/d H:m:s.fff"); SavedUpdatedTime = UpdatedTime.Value; break; case "IsHistory": VerType = dataRow[name].ToBool() ? Versions.VerTypes.History : Versions.VerTypes.Latest; break; } } }
public bool PermissionType_Updated() { return(PermissionType.ToLong() != SavedPermissionType); }