public void AddStandards(IEnumerable <LuaFuncStandard> standards) { if (standards != null) { Standards.AddRange(standards); } }
public void AddStandards(params LuaFuncStandard[] standards) { if (standards != null) { Standards.AddRange(standards); } }
private static void ImportStandards(Standards standards, Guid standardSetsKey) { foreach (var standard in standards) { ImportStandard(standardSetsKey, standard); } }
/// <summary> /// 获取控制器的授权角色 /// </summary> /// <param name="typeInfo">TypeInfo</param> /// <param name="methodInfo">MethodInfo</param> /// <returns>控制器的授权角色</returns> public static ControllerRole Fetch(TypeInfo typeInfo, MethodInfo methodInfo) { return(_cache.GetValue(Standards.FormatCompoundKey(typeInfo.FullName, methodInfo.Name, methodInfo.GetHashCode()), () => FetchRoot(Database.Default, p => p.ControllerName == typeInfo.FullName && p.ActionName == methodInfo.Name, () => new ControllerRole(Database.Default.DataSourceKey, Database.Default.Sequence.Value, typeInfo, methodInfo)) )); }
public async Task <ActionResult <Standards> > PostStandards(Standards standards) { _context.Standard.Add(standards); await _context.SaveChangesAsync(); return(CreatedAtAction("GetStandards", new { id = standards.StandardId }, standards)); }
public LuaScriptStandard(params LuaFuncStandard[] standards) { if (standards != null) { Standards.AddRange(standards); } }
/// <summary> /// Returns true if Availability instances are equal /// </summary> /// <param name="other">Instance of Availability to be compared</param> /// <returns>Boolean</returns> public bool Equals(Availability other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Standards == other.Standards || Standards != null && Standards.SequenceEqual(other.Standards) ) && ( Exception == other.Exception || Exception != null && Exception.Equals(other.Exception) ) && ( IsPublicAccessAllowed == other.IsPublicAccessAllowed || IsPublicAccessAllowed != null && IsPublicAccessAllowed.Equals(other.IsPublicAccessAllowed) )); }
/// <summary> /// Execute PromoteAllStudent button click operations /// </summary> /// <param name="sender"></param> private void ExecutePromoteAllStudentCommand(object sender) { S360BusinessLogic.StudentBusinessLogic StudentBusiness = new S360BusinessLogic.StudentBusinessLogic(); IEnumerable <STUD_StudentAcademic_Details> studentsaccademicdetails = StudentBusiness.GetAllStudentsAccademicDetails().Where(S => S.IsActive = true); studentsaccademicdetails.Select(S => { S.AcademicYearStart = S360Model.S360Configuration.Instance.AcademicYearStart; S.AcademicYearEnd = S360Model.S360Configuration.Instance.AcademicYearEnd; S.Standard_ID = (S.Standard_ID != 102 /*&& S.Standard_ID != 12*/) ? ++S.Standard_ID : 1; //S.Standard_ID = (S.Standard_ID == 102) ? 1 : S.Standard_ID; S.Section_ID = Standards.Where(St => St.Standard_Id == S.Standard_ID).FirstOrDefault() == null ? S.Section_ID : Standards.Where(St => St.Standard_Id == S.Standard_ID).FirstOrDefault().Section_Id; return(S); }).ToList(); IEnumerable <STUD_Students_Master> Students = StudentBusiness.GetAllStudents().Where(S => S.IsActive == true); STUD_Students_Master PromotingStudent = null; foreach (STUD_StudentAcademic_Details studentacc in studentsaccademicdetails) { StudentBusiness.SavePromotion(studentacc); PromotingStudent = Students.Where(St => St.Student_ID == studentacc.Student_ID).FirstOrDefault(); PromotingStudent.CurrentAcaDetail_ID = studentacc.AcademicDet_ID; PromotingStudent.CurrentStd_ID = studentacc.Standard_ID; PromotingStudent.LastModifiedBy_ID = S360Model.S360Configuration.Instance.LoginID; PromotingStudent.LastModifiedOn = System.DateTimeOffset.Now; StudentBusiness.UpdateStudent(PromotingStudent); } }
/// <summary> /// 获取用户身份 /// </summary> /// <param name="companyName">公司名</param> /// <param name="userName">登录名</param> /// <param name="cultureName">区域性名称</param> /// <param name="cacheDiscardIntervalHours">缓存丢弃间隔(小时)</param> /// <returns>用户资料</returns> public static Identity Fetch(string companyName, string userName, string cultureName, int?cacheDiscardIntervalHours = null) { if (String.IsNullOrEmpty(companyName)) { return(null); } if (String.IsNullOrEmpty(userName)) { return(null); } string primaryKey = Standards.FormatCompoundKey(companyName, userName); cacheDiscardIntervalHours = cacheDiscardIntervalHours ?? CacheDiscardIntervalHours; if (cacheDiscardIntervalHours > 0 && _cache.TryGetValue(primaryKey, out CachedObject <Identity> cachedObject)) { cachedObject.Value._cultureName = cultureName; return(cachedObject.Value); } Identity result = new Identity(companyName, userName, cultureName); _cache[primaryKey] = new CachedObject <Identity>(result, DateTime.Now.AddHours(cacheDiscardIntervalHours.Value)); return(result); }
public async Task <IActionResult> PutStandards(int id, Standards standards) { if (id != standards.StandardId) { return(BadRequest()); } _context.Entry(standards).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StandardsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
private void lnkStandard_Click(object sender, RoutedEventArgs e) { Standards frmStandards = new Standards(); ToUnicode.Content = frmStandards; Thickness position = new Thickness(179, 162, 0, 0); imgSpecifier.Margin = position; }
public void Clear() { ProgTypes.Clear(); Providers.Clear(); SectorSubjectAreaTier1s.Clear(); SectorSubjectAreaTier2s.Clear(); Standards.Clear(); StandardSectorCodes.Clear(); }
private WorkSchedule FetchWorkSchedule(short year, short month) { return(Kernel.TryGetValue(Standards.FormatYearMonth(year, month), out WorkSchedule workSchedule) ? workSchedule : WorkSchedule.New(Database, NameValue.Set <WorkSchedule>(p => p.Manager, Manager). Set(p => p.Year, year). Set(p => p.Month, month). Set(p => p.Workers, new long[0]))); }
public string GetStandardsQueryString() { if (App.DefaultSearchOption == SearchOption.StandardCode) { return(string.Join(" ", Standards.Select(s => !string.IsNullOrEmpty(s.CommonCoreCode) ? s.CommonCoreCode : (!string.IsNullOrEmpty(s.Name) ? s.Name : "")).ToArray())); } else { return(string.Join(" ", Standards.Select(s => !string.IsNullOrEmpty(s.Name) ? s.Name : (!string.IsNullOrEmpty(s.CommonCoreCode) ? s.CommonCoreCode : "")).ToArray())); } }
public void SetParamsAndDisplay(int pieceHovered, int locationOfPiece) { if (pieceHovered == 0) { logoIcon.sprite = x; text.text = xStatement; } else { logoIcon.sprite = o; text.text = oStatement; } var y = locationOfPiece; var image = panel.GetComponent <Image>(); panel.transform.localRotation = Quaternion.Euler(0f, 0f, 0f); section.transform.localRotation = Quaternion.Euler(0f, 0f, 0f); image.sprite = r1; panel.GetComponent <RectTransform>().pivot = new Vector2(1, 0); if (y == 3 || y == 6 || y == 9) { image.sprite = l1; panel.GetComponent <RectTransform>().pivot = new Vector2(0, 0); } if (y == 7 || y == 8 || y == 9) { panel.transform.localRotation = Quaternion.Euler(0f, 0f, 180f); section.transform.localRotation = Quaternion.Euler(0f, 0f, 180f); } panel.transform.localPosition = GetPosition(locationOfPiece); if (y == 7 || y == 8) { image.sprite = l1; panel.transform.localPosition = new Vector3(panel.transform.localPosition.x - 250f, panel.transform.localPosition.y, panel.transform.localPosition.z); } if (y == 9) { image.sprite = r1; panel.transform.localPosition = new Vector3(panel.transform.localPosition.x + 250f, panel.transform.localPosition.y, panel.transform.localPosition.z); } panel.SetActive(true); LeanTween.scale(panel, Standards.V3Equal(0.53f), 0.1f).setLoopPingPong(1); }
public bool PutUpdateStandards([FromBody] Standards standards) { try { gestaoDeRegrasServico.Update(standards); return(true); } catch (Exception ex) { return(false); } }
public void ButtonPointerUp(int buttonNum) { if (buttonNum == 1) { var button = button1; button.GetComponent <Image>().color = Standards.RGBEqual(233f / 255f); } else { var button = button2; button.GetComponent <Image>().color = Standards.RGBEqual(233f / 255f); } }
public void Clear() { Apprenticeships.Clear(); Courses.Clear(); Frameworks.Clear(); ProgTypes.Clear(); Providers.Clear(); SectorSubjectAreaTier1s.Clear(); SectorSubjectAreaTier2s.Clear(); Standards.Clear(); StandardSectorCodes.Clear(); Venues.Clear(); }
/// <summary> /// 接收消息 /// </summary> /// <param name="content">消息内容</param> /// <param name="token">StreamSequenceToken</param> protected override Task OnReceiving(string content, StreamSequenceToken token) { DateTime deadline = GetDeadline(); if (Kernel.TryGetValue(Standards.FormatYearMonth((short)deadline.Year, (short)deadline.Month), out WorkSchedule workSchedule)) { foreach (long receiver in workSchedule.Workers) { SendEventForRefreshProjectWorkloads(receiver, content, token); } } return(Task.CompletedTask); }
async Task IWorkScheduleGrain.PutWorkSchedule(WorkSchedule source) { bool unlimited = await User.Identity.IsInRole(ProjectRoles.经营管理); if (!(unlimited || new DateTime(source.Year, source.Month, 1).AddDays(DateTime.Now.Day - 1) < GetDeadline())) { throw new ValidationException("不允许修改已归档的工作档期!"); } if (!(unlimited || User.Identity.Id == Manager)) { throw new SecurityException("管好自己的工作档期就行啦!"); } List <long> receivers = new List <long>(); DateTime key = Standards.FormatYearMonth(source.Year, source.Month); if (Kernel.TryGetValue(key, out WorkSchedule workSchedule)) { receivers.AddRange(workSchedule.Workers); Database.Execute(dbTransaction => { workSchedule.UpdateSelf(dbTransaction, source); ResetWorkers(dbTransaction, workSchedule); }); foreach (long item in source.Workers) { if (!receivers.Contains(item)) { receivers.Add(item); } } } else { Database.Execute(dbTransaction => { source.InsertSelf(dbTransaction); ResetWorkers(dbTransaction, source); Kernel[key] = source; }); receivers.AddRange(source.Workers); } //播报 foreach (long item in receivers) { await SendEventForRefreshProjectWorkloads(item, Manager.ToString()); } }
private void SplitPrimaryKeyString() { string primaryKeyString = this.GetPrimaryKeyString(); string[] strings = Standards.SplitCompoundKey(primaryKeyString); if (strings.Length == 2) { _primaryKeyString = strings[0]; _primaryKeyExtension = strings[1]; } else { _primaryKeyString = primaryKeyString; } }
static void Main(string[] args) { if (Config.SetArgs(args)) { return; } Standards.Build(); Console.WriteLine(Config.ProgrammTitle); Manager manager = new Manager(); manager.Run(); if (System.Diagnostics.Debugger.IsAttached) { Console.WriteLine("================= END =================="); Console.ReadKey(); } }
MappingStandardsToCourses IConfigReader.LoadSettings() { string id = "12345"; string name = "Game XYZ"; string url = "play.google.com"; Games g = new Games(id, name, url); Games g1 = new Games(id, name, url); Games g2 = new Games(id, name, url); Games g3 = new Games(id, name, url); Games g4 = new Games(id, name, url); Games[] games = { g, g1, g2, g3, g4 }; string[] vorbedingungen1 = { }; string[] nachbedingungen1 = { "2" }; Standards s1 = new Standards("1", vorbedingungen1, nachbedingungen1, games); string[] vorbedingungen2 = { "2" }; string[] vorbedingungen12 = { "1" }; string[] nachbedingungen2 = { "3", "4" }; Standards s2 = new Standards("2", vorbedingungen12, nachbedingungen2, games); Standards s3 = new Standards("3", vorbedingungen2, vorbedingungen1, games); Standards s4 = new Standards("4", vorbedingungen2, vorbedingungen1, games); Standards[] standards = { s1, s2, s3, s4 }; Courses math = new Courses("Math", standards); Courses english = new Courses("English", standards); Courses[] courses = { math, english }; Classes first_class = new Classes("First Class", courses); Classes second_class = new Classes("Second Class", courses); Classes[] classes = { first_class, second_class }; MappingStandardsToCourses settings = new MappingStandardsToCourses(classes); return(settings); }
private string ValidateStandard(SQLHoshinCoreContext _ctx, IMapper _mapper, Standard standard) { string validation = string.Empty; Standards standardValidation = _ctx.Standards.Where(x => (x.Name == standard.Name || x.Code == standard.Code) && x.StandardID != standard.StandardID).FirstOrDefault(); validation = standardValidation != null ? "NameExist" : string.Empty; if (!string.IsNullOrEmpty(validation)) { return(validation); } validation = standard.Aspects.Count() == standard.Aspects.Where(x => !x.Active).Count() ? "OneActive" : string.Empty; if (!string.IsNullOrEmpty(validation)) { return(validation); } return(validation); }
/// <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 (Standards != null) { hashCode = hashCode * 59 + Standards.GetHashCode(); } if (Exception != null) { hashCode = hashCode * 59 + Exception.GetHashCode(); } if (IsPublicAccessAllowed != null) { hashCode = hashCode * 59 + IsPublicAccessAllowed.GetHashCode(); } return(hashCode); } }
// Start is called before the first frame update void Start() { networkManager = FindObjectOfType <ModifiedNetworkManager>(); gameConfiguration = FindObjectOfType <GameConfiguration>(); manager = FindObjectOfType <AudioManager>(); mainMenuSoundsMuted = false; gameConfiguration.playUpTo = PlayerPrefs.GetInt(HOST_DEFAULT_POINT_WIN_VALUE_KEY, 10); gameConfiguration.turnsAlternateAfterEndOfRound = PlayerPrefs.GetInt(HOST_ALTERNATE_TURNS_SCORING_KEY, 1) == 1 ? true : false; check.SetActive(gameConfiguration.turnsAlternateAfterEndOfRound); pointsUpToText.text = gameConfiguration.playUpTo.ToString(); hostMenuFullyDisplayed = false; ScaleUp(); void ScaleUp() { LeanTween.scale(banner, Standards.V3Equal(1.1f), 2.5f).setEaseInOutSine().setLoopPingPong(); } }
/// <summary> /// 获取Orleans服务集群客户端 /// </summary> /// <param name="clusterId">Orleans集群的唯一ID</param> /// <param name="serviceId">Orleans服务的唯一ID</param> /// <param name="connectionString">Orleans数据库连接串</param> /// <returns>Orleans服务集群客户端</returns> public static IClusterClient Fetch(string clusterId, string serviceId, string connectionString) { return(_cache.GetValue(Standards.FormatCompoundKey(clusterId, serviceId), () => { IClusterClient value = new ClientBuilder() .Configure <SerializationProviderOptions>(options => { options.SerializationProviders.Add(typeof(BondSerializer)); options.FallbackSerializationProvider = typeof(BondSerializer); }) .Configure <ConnectionOptions>(options => { options.ProtocolVersion = NetworkProtocolVersion.Version2; }) .Configure <ClusterOptions>(options => { options.ClusterId = clusterId; options.ServiceId = serviceId; }) .UseAdoNetClustering(options => { options.ConnectionString = connectionString; #if PgSQL options.Invariant = "Npgsql"; #endif #if MsSQL options.Invariant = "System.Data.SqlClient"; #endif #if MySQL options.Invariant = "MySql.Data.MySqlClient"; #endif #if ORA options.Invariant = "Oracle.DataAccess.Client"; #endif }) .ConfigureApplicationParts(parts => { /* * 装配Actor协议 * 业务程序集都应该统一采用"*.Business.dll"作为文件名的后缀 * 契约程序集都应该统一采用"*.Contract.dll"作为文件名的后缀 * 以上程序集都应该被部署到主程序的执行目录下 */ foreach (string fileName in Directory.GetFiles(Phenix.Core.AppRun.BaseDirectory, "*.Business.dll")) { parts.AddApplicationPart(Assembly.LoadFrom(fileName)).WithReferences().WithCodeGeneration(); } foreach (string fileName in Directory.GetFiles(Phenix.Core.AppRun.BaseDirectory, "*.Contract.dll")) { parts.AddApplicationPart(Assembly.LoadFrom(fileName)).WithReferences().WithCodeGeneration(); } }) .AddSimpleMessageStreamProvider(ContextKeys.SimpleMessageStreamProviderName) .AddOutgoingGrainCallFilter(context => { if (context.Grain is ISecurityContext) { IIdentity currentIdentity = Principal.CurrentIdentity; if (currentIdentity != null) { RequestContext.Set(ContextKeys.CurrentIdentityCompanyName, currentIdentity.CompanyName); RequestContext.Set(ContextKeys.CurrentIdentityUserName, currentIdentity.UserName); RequestContext.Set(ContextKeys.CurrentIdentityCultureName, currentIdentity.CultureName); } } if (context.Grain is ITraceLogContext) { long traceKey; if (RequestContext.Get(ContextKeys.TraceKey) == null) { traceKey = Database.Default.Sequence.Value; RequestContext.Set(ContextKeys.TraceKey, traceKey); } else { traceKey = (long)RequestContext.Get(ContextKeys.TraceKey); } int traceOrder = RequestContext.Get(ContextKeys.TraceOrder) != null ? (int)RequestContext.Get(ContextKeys.TraceOrder) + 1 : 0; RequestContext.Set(ContextKeys.TraceOrder, traceOrder); Task.Run(() => EventLog.Save(context.InterfaceMethod, Phenix.Core.Reflection.Utilities.JsonSerialize(context.Arguments), traceKey, traceOrder)); try { return context.Invoke(); } catch (Exception ex) { Task.Run(() => EventLog.Save(context.InterfaceMethod, Phenix.Core.Reflection.Utilities.JsonSerialize(context.Arguments), traceKey, traceOrder, ex)); throw; } } return context.Invoke(); }) .Build(); AsyncHelper.RunSync(() => value.Connect()); return value; })); }
private void StandardsBtn_Click(object sender, RoutedEventArgs e) { var bItem = (Button)sender; Standards.Navigate(bItem.Tag.ToString()); }
// Tab 3 /// These are all PDFs, if we load PDFs and webpages in the same tabs we lose the scroll point of the PDF private void StandardsMenu_Click(object sender, RoutedEventArgs e) { var mItem = (MenuItem)sender; Standards.Navigate(mItem.Tag.ToString()); }
public bool ContainsKey(string key) { return(Standards.ContainsKey(key) || Customs.ContainsKey(key)); }