public override void RecreateExtendedProperties() { base.RecreateExtendedProperties(); ExtendedProperties.Add("InsurerId", InsurerId.ToString()); ExtendedProperties.Add("ProgramId", ProgramId.ToString()); ExtendedProperties.Add("BenefitPlanId", BenefitPlanId.ToString()); ExtendedProperties.Add("ContinuousEnrollment", ContinuousEnrollment.ToString()); ExtendedProperties.Add("ContinuousAllowedGaps", ContinuousAllowedGaps.ToString()); ExtendedProperties.Add("ContinuousAllowedGapDays", ContinuousAllowedGapDays.ToString()); foreach (String currentKey in DateCriteria.MapToExtendedProperties().Keys) { ExtendedProperties.Add(currentKey, DateCriteria.MapToExtendedProperties()[currentKey]); } return; }
/// <summary> /// Returns true if RepositoryBranch instances are equal /// </summary> /// <param name="other">Instance of RepositoryBranch to be compared</param> /// <returns>Boolean</returns> public bool Equals(RepositoryBranch other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( ProgramId == other.ProgramId || ProgramId != null && ProgramId.Equals(other.ProgramId) ) && ( RepositoryId == other.RepositoryId || RepositoryId.Equals(other.RepositoryId) ) && ( Name == other.Name || Name != null && Name.Equals(other.Name) ) && ( Links == other.Links || Links != null && Links.Equals(other.Links) )); }
/// <summary> /// Gets the <see cref="ProgramIndexMapInfo"/> associated with the specified program ID. /// </summary> /// <param name="programId">The program ID of the map info to get.</param> /// <returns>If the program ID was found, the <see cref="ProgramIndexMapInfo"/> associated /// with that ID; otherwise, <see langword="null"/>.</returns> public Optional <ProgramIndexMapInfo> Get(ProgramId programId) { lock (MapEntries) { return(GetImpl((in ProgramIndexMapInfo x) => x.ProgramId == programId)); } }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (Service != null) { hashCode = hashCode * 59 + Service.GetHashCode(); } if (Name != null) { hashCode = hashCode * 59 + Name.GetHashCode(); } if (Date != null) { hashCode = hashCode * 59 + Date.GetHashCode(); } hashCode = hashCode * 59 + ProgramId.GetHashCode(); hashCode = hashCode * 59 + EnvironmentId.GetHashCode(); if (Links != null) { hashCode = hashCode * 59 + Links.GetHashCode(); } return(hashCode); } }
public static Result MountCode(this FileSystemClient fs, out CodeVerificationData verificationData, U8Span mountName, U8Span path, ProgramId programId) { Result rc; if (fs.IsEnabledAccessLog(AccessLogTarget.System)) { TimeSpan startTime = fs.Time.GetCurrent(); rc = MountCodeImpl(fs, out verificationData, mountName, path, programId); TimeSpan endTime = fs.Time.GetCurrent(); fs.OutputAccessLog(rc, startTime, endTime, $", name: \"{mountName.ToString()}\", name: \"{path.ToString()}\", programid: 0x{programId}"); } else { rc = MountCodeImpl(fs, out verificationData, mountName, path, programId); } if (rc.IsSuccess() && fs.IsEnabledAccessLog(AccessLogTarget.System)) { fs.EnableFileSystemAccessorAccessLog(mountName); } return(rc); }
private static Result MountCodeImpl(this FileSystemClient fs, out CodeVerificationData verificationData, U8Span mountName, U8Span path, ProgramId programId) { Unsafe.SkipInit(out verificationData); Result rc = MountHelpers.CheckMountName(mountName); if (rc.IsFailure()) { return(rc); } rc = FspPath.FromSpan(out FspPath fsPath, path); if (rc.IsFailure()) { return(rc); } IFileSystemProxyForLoader fsProxy = fs.GetFileSystemProxyForLoaderServiceObject(); rc = fsProxy.OpenCodeFileSystem(out IFileSystem codeFs, out verificationData, in fsPath, programId); if (rc.IsFailure()) { return(rc); } return(fs.Register(mountName, codeFs)); }
/// <summary> /// Format the data section of a SEEVSE startup record. /// </summary> /// <returns>String representation of a SEEVSE startup record.</returns> public override string ToString() { return(CpuId.PadRight(17, ' ') + " " + ProgramId.PadRight(8 + 2, ' ') + " " + ProgramVersion.PadRight(8, ' ') + " " + DateFormatter(StartTime).PadRight(FIELD_DATE_LENGTH, ' ')); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (Id != null) { hashCode = hashCode * 59 + Id.GetHashCode(); } if (ProgramId != null) { hashCode = hashCode * 59 + ProgramId.GetHashCode(); } if (Name != null) { hashCode = hashCode * 59 + Name.GetHashCode(); } if (Description != null) { hashCode = hashCode * 59 + Description.GetHashCode(); } hashCode = hashCode * 59 + Type.GetHashCode(); if (Links != null) { hashCode = hashCode * 59 + Links.GetHashCode(); } return(hashCode); } }
public ProgramInfo(FileSystemServer fsServer, ulong processId, ProgramId programId, StorageId storageId, ReadOnlySpan <byte> accessControlData, ReadOnlySpan <byte> accessControlDescriptor) { ProcessId = processId; AccessControl = new AccessControl(fsServer, accessControlData, accessControlDescriptor); ProgramId = programId; StorageId = storageId; }
public static bool IsWebAppletId(ProgramId programId) { return(programId == Web || programId == Shop || programId == OfflineWeb || programId == LoginShare || programId == WifiWebAuth); }
/// <summary> /// Get the name of the specified plugin's program. Note that IDs are 1-based. /// </summary> public static void PluginProgramName(PluginId pluginId, ProgramId programId, [MarshalAs(UnmanagedType.LPWStr)] StringBuilder buffer) { Id.Check(pluginId); Id.Check(programId); Contract.Requires(buffer != null); Contract.Requires(buffer.Capacity > 0); NowSoundGraph_PluginProgramName(pluginId, programId, buffer, buffer.Capacity); }
public List <RoleModel> GetProgramRoles(int programId) { var db = new StoreProcdureManagement(); db.AddParameter("@ProgramId", ProgramId.ToString()); var roles = db.RunSp <RoleModel>(ConnectionString, "sp_ProgramRoles"); return(roles); }
public SaveDataAttribute(ProgramId programId, SaveDataType type, UserId userId, ulong saveDataId, ushort index, SaveDataRank rank) { ProgramId = programId; Type = type; UserId = userId; StaticSaveDataId = saveDataId; Index = index; Rank = rank; }
public void Add(Program type) { lock (type) { if (Count == ProgramId.Length) { var newLength = ProgramId.Length + 4; var _ProgramId = new string[newLength]; ProgramId.CopyTo(_ProgramId); ProgramId = _ProgramId; var _Name = new string[newLength]; Name.CopyTo(_Name); Name = _Name; var _Duration = new string[newLength]; Duration.CopyTo(_Duration); Duration = _Duration; var _Limit = new int[newLength]; Limit.CopyTo(_Limit); Limit = _Limit; var _DepartmentId = new string[newLength]; DepartmentId.CopyTo(_DepartmentId); DepartmentId = _DepartmentId; var _Specializations = new SpecializationDM[newLength]; Specializations.CopyTo(_Specializations); Specializations = _Specializations; var _mountedCourseDM = new MountedCourseDM[newLength]; MountedCourses.CopyTo(_mountedCourseDM); MountedCourses = _mountedCourseDM; } ProgramId.Span[Count] = type.ProgramId; Name.Span[Count] = type.Name; Duration.Span[Count] = type.Duration; Limit.Span[Count] = type.Limit; DepartmentId.Span[Count] = type.DepartmentId; Specializations.Span[Count] = new SpecializationDM(length); if (type.Specializations?.Count > 0) { foreach (var t in type.Specializations) { Specializations.Span[Count].Add(t); } } MountedCourses.Span[Count] = new MountedCourseDM(length); if (type.MountedCourses?.Count > 0) { foreach (var t in type.MountedCourses) { MountedCourses.Span[Count].Add(t); } } Count++; } }
/// <summary> /// Импорт описаний программ. /// Формат: /// $Краткое_Имя_Программы1 /// Описание.... /// $Краткое_Имя_Программы2 /// Описание.... /// </summary> public void ImportDescriptions(DBType dbType, DeviceType device, string fileName, int LCID, Encoding encoding) { StringBuilder warnings = new StringBuilder(); Dictionary <string, ProgramId> nameToProgId = new Dictionary <string, ProgramId>(); //создаем словарь имен var names = DB.GetProgramNames(dbType, device, LCID); foreach (var progId in names.Keys) { nameToProgId[names[progId].ShortName] = new ProgramId(dbType, device, progId); } //читаем файл using (StreamReader sr = new StreamReader(fileName, encoding)) { ProgramId currentProgramId = null; string currentDesc = ""; int iLineCounter = 0; while (sr.Peek() >= 0) { iLineCounter++; string line = sr.ReadLine(); if (line.StartsWith("$"))//имя программы { if (currentProgramId != null) { FlushProgramDesc(LCID, names, currentProgramId, currentDesc, nameToProgId, warnings); } currentDesc = ""; string progName = line.Trim().Substring(1); if (!nameToProgId.ContainsKey(progName)) { currentProgramId = null; warnings.AppendLine(Lang.Phrase("Строка {0}: {1}", iLineCounter, Lang.Phrase("Имя программы не найдено: {0}", progName))); continue; } currentProgramId = nameToProgId[progName]; } else { currentDesc += line + Environment.NewLine; } } if (currentProgramId != null) { FlushProgramDesc(LCID, names, currentProgramId, currentDesc, nameToProgId, warnings); } } // if (warnings.Length > 0) { throw new NonCriticalException(Lang.Phrase("Импорт выполнен, со следующими замечаниями:\r\n{0}", warnings.ToString())); } }
/// <returns><see cref="Result.Success"/>: The operation was successful.<br/> /// <see cref="ResultFs.InvalidArgument"/>: The process ID is already registered.<br/> /// <see cref="ResultFs.PermissionDenied"/>: Insufficient permissions.</returns> /// <inheritdoc cref="ProgramRegistryManager.RegisterProgram"/> public Result RegisterProgram(ulong processId, ProgramId programId, StorageId storageId, ReadOnlySpan <byte> accessControlData, ReadOnlySpan <byte> accessControlDescriptor) { if (!ProgramInfo.IsInitialProgram(_processId)) { return(ResultFs.PermissionDenied.Log()); } return(_registryService.RegisterProgram(processId, programId, storageId, accessControlData, accessControlDescriptor)); }
public DataTable GetMenu(int userId) { var db = new TableBasedSp(RunSpName); var parameters = new Dictionary <string, string> { { "ProgramId", ProgramId.ToString() }, { "UserId", userId.ToString() } }; return(db.GetFirstTableOfData("uspGetUserMenu", ConnectionString, parameters)); }
/// <returns><see cref="Result.Success"/>: The operation was successful.<br/> /// <see cref="ResultFs.InvalidArgument"/>: The process ID is already registered.<br/> /// <see cref="ResultFs.PermissionDenied"/>: Insufficient permissions.</returns> /// <inheritdoc cref="ProgramRegistryManager.RegisterProgram"/> public Result RegisterProgram(ulong processId, ProgramId programId, StorageId storageId, InBuffer accessControlData, InBuffer accessControlDescriptor) { if (!ProgramInfo.IsInitialProgram(_processId)) { return(ResultFs.PermissionDenied.Log()); } return(Globals.ServiceImpl.RegisterProgramInfo(processId, programId, storageId, accessControlData.Buffer, accessControlDescriptor.Buffer)); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (Id != null) { hashCode = hashCode * 59 + Id.GetHashCode(); } if (ProgramId != null) { hashCode = hashCode * 59 + ProgramId.GetHashCode(); } if (PipelineId != null) { hashCode = hashCode * 59 + PipelineId.GetHashCode(); } if (ArtifactsVersion != null) { hashCode = hashCode * 59 + ArtifactsVersion.GetHashCode(); } if (User != null) { hashCode = hashCode * 59 + User.GetHashCode(); } hashCode = hashCode * 59 + Status.GetHashCode(); hashCode = hashCode * 59 + Trigger.GetHashCode(); if (CreatedAt != null) { hashCode = hashCode * 59 + CreatedAt.GetHashCode(); } if (UpdatedAt != null) { hashCode = hashCode * 59 + UpdatedAt.GetHashCode(); } if (FinishedAt != null) { hashCode = hashCode * 59 + FinishedAt.GetHashCode(); } if (Embedded != null) { hashCode = hashCode * 59 + Embedded.GetHashCode(); } if (Links != null) { hashCode = hashCode * 59 + Links.GetHashCode(); } return(hashCode); } }
public List <UserModel> GetProgramUsers(UserStatusEnum userStatusEnum = UserStatusEnum.All) { var db = new TableBasedSp(RunSpName); var parameters = new Dictionary <string, string> { { "ProgramId", ProgramId.ToString() }, { "Enable", ((int)userStatusEnum).ToString() } }; var dt = db.GetFirstTableOfData("uspGetProgramUsers", ConnectionString, parameters); var users = new DataTableToList().Convert <UserModel>(dt); return(users); }
public ProgramModel GetProgram(int programId) { var db = new StoreProcdureManagement(); db.AddParameter("@ProgramId", ProgramId.ToString()); var program = db.RunSp <ProgramModel>(ConnectionString, "sp_Program"); if (program.Any()) { return(program[0]); } return(new ProgramModel()); }
public override int GetHashCode() { int hashCode = -823121408; if (Id != null) { hashCode += Id.GetHashCode(); } if (Mappings != null) { hashCode += Mappings.GetHashCode(); } if (ProgramId != null) { hashCode += ProgramId.GetHashCode(); } if (Balance != null) { hashCode += Balance.GetHashCode(); } if (LifetimePoints != null) { hashCode += LifetimePoints.GetHashCode(); } if (CustomerId != null) { hashCode += CustomerId.GetHashCode(); } if (EnrolledAt != null) { hashCode += EnrolledAt.GetHashCode(); } if (CreatedAt != null) { hashCode += CreatedAt.GetHashCode(); } if (UpdatedAt != null) { hashCode += UpdatedAt.GetHashCode(); } return(hashCode); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (Id != null) { hashCode = hashCode * 59 + Id.GetHashCode(); } if (ProgramId != null) { hashCode = hashCode * 59 + ProgramId.GetHashCode(); } if (Name != null) { hashCode = hashCode * 59 + Name.GetHashCode(); } hashCode = hashCode * 59 + Trigger.GetHashCode(); hashCode = hashCode * 59 + Status.GetHashCode(); if (CreatedAt != null) { hashCode = hashCode * 59 + CreatedAt.GetHashCode(); } if (UpdatedAt != null) { hashCode = hashCode * 59 + UpdatedAt.GetHashCode(); } if (LastStartedAt != null) { hashCode = hashCode * 59 + LastStartedAt.GetHashCode(); } if (LastFinishedAt != null) { hashCode = hashCode * 59 + LastFinishedAt.GetHashCode(); } if (Phases != null) { hashCode = hashCode * 59 + Phases.GetHashCode(); } if (Links != null) { hashCode = hashCode * 59 + Links.GetHashCode(); } return(hashCode); } }
public static bool IsLibraryAppletId(ProgramId programId) { return(programId == Auth || programId == Controller || programId == Error || programId == PlayerSelect || programId == Swkbd || programId == Web || programId == Shop || programId == PhotoViewer || programId == OfflineWeb || programId == LoginShare || programId == WifiWebAuth || programId == MyPage); }
private static Result MountSaveDataImpl(this FileSystemClientImpl fs, U8Span mountName, SaveDataSpaceId spaceId, ProgramId programId, UserId userId, SaveDataType type, bool openReadOnly, ushort index) { Result rc = fs.CheckMountName(mountName); if (rc.IsFailure()) { return(rc); } using ReferenceCountedDisposable <IFileSystemProxy> fsProxy = fs.GetFileSystemProxyServiceObject(); rc = SaveDataAttribute.Make(out SaveDataAttribute attribute, programId, type, userId, 0, index); if (rc.IsFailure()) { return(rc); } ReferenceCountedDisposable <IFileSystemSf> fileSystem = null; try { if (openReadOnly) { rc = fsProxy.Target.OpenReadOnlySaveDataFileSystem(out fileSystem, spaceId, in attribute); if (rc.IsFailure()) { return(rc); } } else { rc = fsProxy.Target.OpenSaveDataFileSystem(out fileSystem, spaceId, in attribute); if (rc.IsFailure()) { return(rc); } } var fileSystemAdapter = new FileSystemServiceObjectAdapter(fileSystem); return(fs.Fs.Register(mountName, fileSystemAdapter, fileSystemAdapter, null, false, true)); } finally { fileSystem?.Dispose(); } }
public override int GetHashCode() { int hash = 1; if (ProgramId.Length != 0) { hash ^= ProgramId.GetHashCode(); } if (TierId.Length != 0) { hash ^= TierId.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
static Result Mount(FileSystemClient fs, out CodeVerificationData verificationData, U8Span mountName, U8Span path, ProgramId programId) { UnsafeHelpers.SkipParamInit(out verificationData); Result rc = fs.Impl.CheckMountName(mountName); if (rc.IsFailure()) { return(rc); } if (path.IsNull()) { return(ResultFs.NullptrArgument.Log()); } rc = FspPath.FromSpan(out FspPath fsPath, path); if (rc.IsFailure()) { return(rc); } using ReferenceCountedDisposable <IFileSystemProxyForLoader> fsProxy = fs.Impl.GetFileSystemProxyForLoaderServiceObject(); ReferenceCountedDisposable <IFileSystemSf> fileSystem = null; try { rc = fsProxy.Target.OpenCodeFileSystem(out fileSystem, out verificationData, in fsPath, programId); if (rc.IsFailure()) { return(rc); } var fileSystemAdapter = new FileSystemServiceObjectAdapter(fileSystem); return(fs.Register(mountName, fileSystemAdapter)); } finally { fileSystem?.Dispose(); } }
public string ConvertToSearch() { var cc = DbUtil.Db.ScratchPadCondition(); cc.Reset(); var c = cc.AddNewClause(QueryType.OrgSearchMember, CompareType.Equal, "1,True"); if (Name.HasValue()) { c.OrgName = Name; } if (ProgramId != 0) { c.Program = ProgramId.ToString(); } if (DivisionId != 0) { c.Division = DivisionId.ToString(); } if (StatusId != 0) { c.OrgStatus = StatusId.ToString(); } if (TypeId != 0) { c.OrgType2 = TypeId ?? 0; } if (CampusId != 0) { c.Campus = CampusId.ToString(); } if (ScheduleId != 0) { c.Schedule = ScheduleId.ToString(); } if (OnlineReg != 0) { c.OnlineReg = OnlineReg.ToString(); } cc.Save(DbUtil.Db); return("/Query/" + cc.Id); }
public List <ProgramRoleModel> GetProgramRoles(int programId) { var db = new TableBasedSp(RunSpName); var parameters = new Dictionary <string, string> { { "ProgramId", ProgramId.ToString() } }; try { var dt = db.GetFirstTableOfData("uspGetProgramRoles", ConnectionString, parameters); var roles = new DataTableToList().Convert <ProgramRoleModel>(dt); return(roles); } catch (Exception ex) { throw ex; } }
public HorizonClient CreateHorizonClient(ProgramId programId, AccessControlBits.Bits fsPermissions) { HorizonClient client = CreateHorizonClient(); var dataHeader = new AccessControlDataHeader(); var descriptor = new AccessControlDescriptor(); descriptor.Version = 1; dataHeader.Version = 1; descriptor.AccessFlags = (ulong)fsPermissions; dataHeader.AccessFlags = (ulong)fsPermissions; LoaderClient.Fs.RegisterProgram(client.ProcessId.Value, programId, StorageId.BuiltInUser, SpanHelpers.AsReadOnlyByteSpan(in dataHeader), SpanHelpers.AsReadOnlyByteSpan(in descriptor)) .ThrowIfFailure(); return(client); }