public void GivenIAmOnTheSchoolSomethingPage(SchoolType schoolType, string pageName) { ScenarioContext.Current.SetSchoolType(schoolType); var page = container.ResolvePageObject(AcademicDashboardType.School, pageName, schoolType); page.Visit(); }
public SpellObject( uint ID, uint Count, uint OverlayFileRID, uint NameRID, uint Flags, ushort LightFlags, byte LightIntensity, ushort LightColor, AnimationType FirstAnimationType, byte ColorTranslation, byte Effect, Animation Animation, BaseList<SubOverlay> SubOverlays, byte TargetsCount, SchoolType SchoolType) : base(ID, Count, OverlayFileRID, NameRID, Flags, LightFlags, LightIntensity, LightColor, FirstAnimationType, ColorTranslation, Effect, Animation, SubOverlays) { this.targetsCount = TargetsCount; this.schoolType = SchoolType; }
public School(string name, SchoolType type) { this.Name = name; this.Type = type; this.classes = new List<Class>(); this.teachers = new List<Teacher>(); this.students = new List<Student>(); }
public override unsafe void ReadFrom(ref byte* Buffer) { base.ReadFrom(ref Buffer); targetsCount = Buffer[0]; Buffer++; schoolType = (SchoolType)Buffer[0]; Buffer++; }
public async Task <IActionResult> Create([Bind("SchoolTypeId,Name,Description")] SchoolType schoolType) { if (ModelState.IsValid) { _context.Add(schoolType); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(schoolType)); }
//methods public void MakeStudent(string n, int a, SchoolType s) { if (this.GetSchool() == s) { teacherStudent.Add(new Student(n, a, s, 0)); } else { Console.WriteLine("{0} not attending teacher {1} class in school: {2}", n, this.GetName(), this.GetSchool()); } }
public void OnEnable() { _LastTextDescription = DefaultTextDescription; SelectButton.interactable = false; DefaultTextDescription.SetActive(true); WolfTextDescription.SetActive(false); CatTextDescription.SetActive(false); BearTextDescription.SetActive(false); SelectedSchoolType = SchoolType.NONE; }
public static SchoolTypeDto Mapper(this SchoolType schoolType) { var dto = new SchoolTypeDto(); if (schoolType != null) { dto.Id = schoolType.Id; dto.Name = schoolType.Name; } return(dto); }
public async Task UpdateTypeAsync(SchoolType type) { VerifyPermission(Permission.ManageSchools); var currentType = await _schoolTypeRepository.GetByIdAsync(type.Id); if (currentType.SiteId != GetCurrentSiteId()) { throw new GraException($"Permission denied - type belongs site id {currentType.SiteId}."); } currentType.Name = type.Name; await _schoolTypeRepository.UpdateSaveAsync(GetClaimId(ClaimType.UserId), currentType); }
public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) { SchoolType output = null; int id; ValueProviderResult parameter = bindingContext.ValueProvider.GetValue("id"); if (parameter != null) { id = (int)parameter.ConvertTo(typeof(int)); output = container.SchoolTypeSet.FirstOrDefault(t => t.Id == id); } return(output); }
public SchoolType GetByPrimaryKey(int id) { try { string query = "select * from SchoolType where ID = " + id; SchoolType teacher = connect.Query <SchoolType>(query).FirstOrDefault <SchoolType>(); return(teacher); } catch (Exception ex) { LogService.WriteException(ex); return(null); } }
public IActionResult SubmitModify(string id, string phone, string token, string postername, string posterphone, string posteremail, string posterqq, string posterschool, string problemtype, string problemdetail, string location, string bookdate) { ReservationDetail _detail = VerifyReservationDetailWithTicket(id, phone, token); if (_detail == null) { return(RedirectToAction(nameof(Index))); } DateTime _reservationDate; DateTime now = DateTimeHelper.GetBeijingTime(); SchoolType _schoolType = (from school in db.SchoolTypes where school.Name == posterschool select school).FirstOrDefault(); ProblemType _problemType = (from problem in db.ProblemTypes where problem.Name == problemtype select problem).FirstOrDefault(); LocationType _locationType = (from loc in db.LocationTypes where loc.Name == location select loc).FirstOrDefault(); string _postername = postername ?? ""; string _posterphone = posterphone ?? ""; string _posteremail = posteremail ?? ""; string _posterqq = posterqq ?? ""; if (_schoolType != null && _problemType != null && _locationType != null && DateTime.TryParse(bookdate, out _reservationDate) == true) { _reservationDate = new DateTime(_reservationDate.Year, _reservationDate.Month, _reservationDate.Day, 23, 59, 59); _detail.PosterName = _postername; _detail.PosterPhone = _posterphone; _detail.PosterEmail = _posteremail; _detail.PosterQQ = _posterqq; _detail.PosterSchoolType = _schoolType; _detail.LocationType = _locationType; _detail.ProblemType = _problemType; _detail.Detail = problemdetail; _detail.ModifiedDate = now; _detail.LastUpdatedLanguage = cultureContext.Culture.Language; _detail.ReservationDate = _reservationDate; EntityEntry <ReservationDetail> entry = db.Entry(_detail); entry.State = EntityState.Modified; db.SaveChanges(); entry.Reload(); smsService.SendReservationUpdatedAsync(entry.Entity); TempData["id"] = entry.Entity.Id.ToString(); TempData["phone"] = entry.Entity.GetShortenPhone(); return(RedirectToActionPermanent(nameof(Detail))); } else { } return(View()); }
public override int ReadFrom(byte[] Buffer, int StartIndex = 0) { int cursor = StartIndex; cursor += base.ReadFrom(Buffer, StartIndex); targetsCount = Buffer[cursor]; cursor++; schoolType = (SchoolType)Buffer[cursor]; cursor++; return(cursor - StartIndex); }
public override int ReadFrom(byte[] Buffer, int StartIndex = 0) { int cursor = StartIndex; cursor += base.ReadFrom(Buffer, StartIndex); targetsCount = Buffer[cursor]; cursor++; schoolType = (SchoolType)Buffer[cursor]; cursor++; return cursor - StartIndex; }
public CharacteristicDataNational(Guid publicationId, int releaseId, DateTime releaseDate, string term, int year, Level level, Country country, SchoolType schoolType, Dictionary <string, string> attributes, Characteristic characteristic) : base(publicationId, releaseId, releaseDate, term, year, level, country, schoolType, attributes) { Characteristic = characteristic; }
private string crawlURLTemplate; // "http://support.renren.com/{0}/{1}.html"; public void Crawl(SchoolType st) { this.crawlURLTemplate = string.Format("http://support.renren.com/{0}/{1}.html", st.ToString().ToLower(), "{0}"); GetProvList(); if (this.provsList.Count > 0) { GetCityArrayPageInfo(); foreach (Prov prov in this.provsList) { GetCityList(prov); } } }
public override unsafe void ReadFrom(ref byte *Buffer) { base.ReadFrom(ref Buffer); #if !VANILLA && !OPENMERIDIAN targetsCount = Buffer[0]; Buffer++; schoolType = (SchoolType)Buffer[0]; Buffer++; isActiveSkill = Convert.ToBoolean(Buffer[0]); Buffer++; #endif }
public override void Clear(bool RaiseChangedEvent) { base.Clear(RaiseChangedEvent); if (RaiseChangedEvent) { TargetsCount = 0; SchoolType = 0; } else { targetsCount = 0; schoolType = 0; } }
public School(string name, SchoolType schoolType, Director director, IEnumerable <Teacher> viseDirectors, IEnumerable <StudentClass> studentClasses, IEnumerable <Worker> staff, IEnumerable <Teacher> teachersStaff) { this.name = name; this.director = director; this.viseDirectors = viseDirectors; this.studentClasses = studentClasses; this.staff = staff; this.teachersStaff = teachersStaff; }
/// <summary> /// This is the event handler for any radio button that was checked. /// First see if anything got checked, then determine which radio /// button was responsible. /// Figure out the type of school, then look it up using LINQ query. /// Finally, display the results of the query. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void RadioButton_Checked(object sender, EventArgs e) { RadioButton radioButton = sender as RadioButton; // Was it checked? if (radioButton.Checked == false) { return; } // set school type according to radio button checked SchoolType selectedSchoolType = SchoolType.Vocational; if (radioButton == radioButtonUniversity) { selectedSchoolType = SchoolType.University; } else if (radioButton == radioButtonCollege) { selectedSchoolType = SchoolType.College; } else if (radioButton == radioButtonTechnical) { selectedSchoolType = SchoolType.Technical; } else if (radioButton == radioButtonVocational) { selectedSchoolType = SchoolType.Vocational; } // look up the type var query = from school in postSecondarySchools where school.SchoolType == selectedSchoolType select school; // display in the listBox listBoxButtonSchools.Items.Clear(); foreach (School school in query) { listBoxButtonSchools.Items.Add(school); } }
public Factory(SchoolType schoolType) { this.SchoolType = schoolType; switch (SchoolType) { case SchoolType.Academy: SchoolFactory = new AcademyFactory(); break; case SchoolType.School: SchoolFactory = new SchoolFactory(); break; default: throw new NotSupportedException(SchoolType.ToString()); } }
public ActionResult SchoolType(int id = 0) { ViewBag.Edit = id != 0; SchoolType schoolType = new SchoolType(); if (id != 0) { using (var repository = new NHRepository <SchoolType>()) { schoolType = repository.Get(id); } } return(View(schoolType)); }
public override int ReadFrom(byte[] Buffer, int StartIndex = 0) { int cursor = StartIndex; cursor += base.ReadFrom(Buffer, StartIndex); #if !VANILLA && !OPENMERIDIAN targetsCount = Buffer[cursor]; cursor++; schoolType = (SchoolType)Buffer[cursor]; cursor++; isActiveSkill = Convert.ToBoolean(Buffer[cursor]); cursor++; #endif return(cursor - StartIndex); }
public Factory(SchoolType schoolType) { this.SchoolType = schoolType; switch (SchoolType) { case SchoolType.Academy: SchoolFactory = new AcademyFactory(); break; case SchoolType.School: SchoolFactory = new SchoolFactory(); break; default: throw new NotSupportedException(SchoolType.ToString()); } }
public CharacteristicDataLa(Guid publicationId, int releaseId, DateTime releaseDate, string term, int year, Level level, Country country, SchoolType schoolType, Dictionary <string, string> attributes, Region region, LocalAuthority localAuthority, Characteristic characteristic) : base(publicationId, releaseId, releaseDate, term, year, level, country, schoolType, attributes) { Region = region; LocalAuthority = localAuthority; Characteristic = characteristic; }
public GeographicData( Guid publicationId, int releaseId, DateTime releaseDate, string term, int year, Level level, Country country, SchoolType schoolType, Dictionary <string, string> attributes, Region region, LocalAuthority localAuthority, School school) : base(publicationId, releaseId, releaseDate, term, year, level, country, schoolType, attributes) { Region = region; LocalAuthority = localAuthority; School = school; }
public Post( string title, string description, SchoolType school, MaterialType materialType, string thumbImagePath, string filePath, string userNickname) { this.Title = title; this.Description = description; this.School = school; this.MaterialType = materialType; this.ThumbImagePath = thumbImagePath; this.FilePath = filePath; this.UserNickname = userNickname; this.GenerateSimplifiedTitle(); this.GenerateSearchTags(); }
public bool Update(SchoolType teacher) { try { string query = "update SchoolType set Code = @Code,Name = @Name,Description = @Description " + " where ID = @ID "; return(0 < connect.Execute(query, new { teacher.Code, teacher.Name, teacher.Description, teacher.ID })); } catch (Exception ex) { LogService.WriteException(ex); return(false); } }
protected TidyData(Guid publicationId, int releaseId, DateTime releaseDate, string term, int year, Level level, Country country, SchoolType schoolType, Dictionary <string, string> attributes) { PublicationId = publicationId; ReleaseId = releaseId; ReleaseDate = releaseDate; Term = term; Year = year; Level = level; Country = country; SchoolType = schoolType; Attributes = attributes; }
public OpticalFormType( Name name, string code, string configurationFile, SchoolType schoolType, IEnumerable <FormLessonSection> lessonSections, int maxQuestionCount) : this() { Name = name; Code = code; ConfigurationFile = configurationFile; SchoolType = schoolType; MaxQuestionCount = maxQuestionCount; if (lessonSections != null) { _formLessonSections.AddRange(lessonSections); } }
public int Insert(SchoolType teacher) { try { string query = "insert into SchoolType(" + " Code,Name,Description)" + " values (@Code,@Name,@Description)" + " SELECT @@IDENTITY"; int id = connect.Query <int>(query, new { teacher.Code, teacher.Name, teacher.Description }).Single(); return(id); } catch (Exception ex) { LogService.WriteException(ex); return(0); } }
/// <summary> /// Creates or updates resources based on the natural key values of the supplied resource. The POST operation can be used to create or update resources. In database terms, this is often referred to as an "upsert" operation (insert + update). Clients should NOT include the resource "id" in the JSON body because it will result in an error (you must use a PUT operation to update a resource by "id"). The web service will identify whether the resource already exists based on the natural key values provided, and update or create the resource appropriately. /// </summary> /// <param name="body">The JSON representation of the "schoolType" resource to be created or updated.</param> /// <returns>A RestSharp <see cref="IRestResponse"/> instance containing the API response details.</returns> public IRestResponse PostSchoolTypes(SchoolType body) { var request = new RestRequest("/schoolTypes", Method.POST); request.RequestFormat = DataFormat.Json; // verify required params are set if (body == null) { throw new ArgumentException("API method call is missing required parameters"); } request.AddBody(body); var response = client.Execute(request); var location = response.Headers.FirstOrDefault(x => x.Name == "Location"); if (location != null && !string.IsNullOrWhiteSpace(location.Value.ToString())) { body.id = location.Value.ToString().Split('/').Last(); } return(response); }
/// <summary> /// Constructor by values /// </summary> /// <param name="ID"></param> /// <param name="Count"></param> /// <param name="OverlayFileRID"></param> /// <param name="NameRID"></param> /// <param name="Flags"></param> /// <param name="LightingInfo"></param> /// <param name="FirstAnimationType"></param> /// <param name="ColorTranslation"></param> /// <param name="Effect"></param> /// <param name="Animation"></param> /// <param name="SubOverlays"></param> /// <param name="TargetsCount"></param> /// <param name="SchoolType"></param> public SpellObject( uint ID, uint Count, uint OverlayFileRID, uint NameRID, uint Flags, LightingInfo LightingInfo, AnimationType FirstAnimationType, byte ColorTranslation, byte Effect, Animation Animation, IEnumerable <SubOverlay> SubOverlays, byte TargetsCount, SchoolType SchoolType) : base( ID, Count, OverlayFileRID, NameRID, Flags, LightingInfo, FirstAnimationType, ColorTranslation, Effect, Animation, SubOverlays) { this.targetsCount = TargetsCount; this.schoolType = SchoolType; }
/// <summary> /// Updates or creates a resource based on the resource identifier. The PUT operation is used to update or create a resource by identifier. If the resource doesn't exist, the resource will be created using that identifier. Additionally, natural key values cannot be changed using this operation, and will not be modified in the database. If the resource "id" is provided in the JSON body, it will be ignored as well. /// </summary> /// <param name="id">A resource identifier specifying the resource to be updated.</param> /// <param name="IfMatch">The ETag header value used to prevent the PUT from updating a resource modified by another consumer.</param> /// <param name="body">The JSON representation of the "schoolType" resource to be updated.</param> /// <returns>A RestSharp <see cref="IRestResponse"/> instance containing the API response details.</returns> public IRestResponse PutSchoolType(string id, string IfMatch, SchoolType body) { var request = new RestRequest("/schoolTypes/{id}", Method.PUT); request.RequestFormat = DataFormat.Json; request.AddUrlSegment("id", id); // verify required params are set if (id == null || body == null) { throw new ArgumentException("API method call is missing required parameters"); } request.AddHeader("If-Match", IfMatch); request.AddBody(body); var response = client.Execute(request); var location = response.Headers.FirstOrDefault(x => x.Name == "Location"); if (location != null && !string.IsNullOrWhiteSpace(location.Value.ToString())) { body.id = location.Value.ToString().Split('/').Last(); } return(response); }
public void OnClicked(Button button) { SelectButton.interactable = true; _LastTextDescription.SetActive(false); if (button == WolfButton) { SelectedSchoolType = SchoolType.WOLF; WolfTextDescription.SetActive(true); _LastTextDescription = WolfTextDescription; } else if (button == CatButton) { SelectedSchoolType = SchoolType.CAT; CatTextDescription.SetActive(true); _LastTextDescription = CatTextDescription; } else// if(button == BearButton) { SelectedSchoolType = SchoolType.BEAR; BearTextDescription.SetActive(true); _LastTextDescription = BearTextDescription; } }
public static SchoolType CreateSchoolType(int ID, string title, byte[] rowVersion) { SchoolType schoolType = new SchoolType(); schoolType.Id = ID; schoolType.Title = title; schoolType.RowVersion = rowVersion; return schoolType; }
public void AddToSchoolTypes(SchoolType schoolType) { base.AddObject("SchoolTypes", schoolType); }
/// <summary> /// 透過學生類別取得 UDT 內設定不排名學生.ID /// </summary> /// <returns></returns> public static List<string> GetNonRankStudentIDFromUDTByStudentTag(List<StudentTagRecord> StudTagRecList,SchoolType ST) { List<string> TagNameList = new List<string>(); List<string> retVal = new List<string>(); TagNameList = (from data in UDTTransfer.GetDataFromUDT_StudTypeWeight() where data.CheckNonRank==true && data.SchoolType== ST.ToString () select data.StudentType).ToList(); foreach (StudentTagRecord StudTagRec in StudTagRecList) { if(TagNameList.Contains(StudTagRec.FullName )) retVal.Add(StudTagRec.RefStudentID ); } return retVal; }
public IActionResult Create(string postername, string posterphone, string posteremail, string posterqq, string posterschool, string problemtype, string problemdetail, string location, string bookdate, string captchaText, string captchaToken, [FromServices] IServiceState serviceState) { if (!serviceState.AllowCreate) { return(RedirectToAction(nameof(ServiceNotAvailable))); } string _postername = postername ?? ""; string _posterphone = posterphone ?? ""; string _posteremail = posteremail ?? ""; string _posterqq = posterqq ?? ""; if (!IsCaptchaValidate(captchaText, captchaToken)) { ViewData["CaptchaError"] = true; ViewData["Name"] = _postername; ViewData["Phone"] = _posterphone; ViewData["Email"] = _posteremail; ViewData["QQ"] = _posterqq; ViewData["ProblemDetail"] = problemdetail; ViewData["School"] = posterschool; ViewData["ProblemType"] = problemtype; ViewData["Location"] = location; ViewData["BookDate"] = bookdate; ViewData["SchoolTypes"] = db.SchoolTypes.OrderBy(type => type.Id); ViewData["ProblemTypes"] = db.ProblemTypes.OrderBy(type => type.Id); ViewData["LocationTypes"] = db.LocationTypes.OrderBy(type => type.Id); return(View()); } DateTime _reservationDate; DateTime now = DateTimeHelper.GetBeijingTime(); SchoolType _schoolType = db.SchoolTypes.FirstOrDefault(item => item.Name == posterschool); ProblemType _problemType = db.ProblemTypes.FirstOrDefault(item => item.Name == problemtype); LocationType _locationType = db.LocationTypes.FirstOrDefault(item => item.Name == location); if (_schoolType != null && _problemType != null && _locationType != null && DateTime.TryParse(bookdate, out _reservationDate) == true) { _reservationDate = new DateTime(_reservationDate.Year, _reservationDate.Month, _reservationDate.Day, 23, 59, 59); ReservationDetail detail = new ReservationDetail() { PosterName = _postername, PosterPhone = _posterphone, PosterEmail = _posteremail, PosterQQ = _posterqq, PosterSchoolType = _schoolType, LocationType = _locationType, ProblemType = _problemType, Detail = problemdetail, ActionDate = now, CreateDate = now, ModifiedDate = now, ReservationDate = _reservationDate, State = ReservationState.NewlyCreated, LastUpdatedLanguage = cultureContext.Culture.Language }; EntityEntry <ReservationDetail> entry = db.ReservationDetails.Add(detail); db.SaveChanges(); smsService.SendCreationSuccessAsync(entry.Entity, cultureContext.Culture); smsService.SendReservationCreatedAsync(entry.Entity); TempData["id"] = entry.Entity.Id.ToString(); TempData["phone"] = entry.Entity.GetShortenPhone(); TempData["showhint"] = true; return(RedirectToAction(nameof(Detail))); } else { } return(View()); }
/// <summary> /// Sets the school type associated with the current scenario. /// </summary> /// <param name="context">The <see cref="ScenarioContext"/> of the current test scenario.</param> /// <param name="schoolType">The type of school that is in context for the current scenario.</param> public static void SetSchoolType(this ScenarioContext context, SchoolType schoolType) { context.Set(schoolType, SchoolTypeKey); }
/// <summary> /// Navigates to the specified Academic Dashboard page. /// </summary> /// <param name="academicDashboardType">The academic dashboard type (e.g. LEA, School, Student).</param> /// <param name="linkText">The text of the link for the desired Academic Dashboard subpage.</param> /// <param name="schoolType">The type of school Id to be used for navigation.</param> /// <param name="forceNavigation">Indicates whether to force browser navigation, even if the target page is /// already the current page (useful for scenarios where we want to explicitly force the browser to make a /// request from server). /// </param> public static void VisitAcademicDashboardSection(AcademicDashboardType academicDashboardType, string linkText, SchoolType schoolType = SchoolType.Unspecified, bool forceNavigation = false) { // TODO: revisit this navigation // TODO: consider adding page to context for use by MetricSteps? PageBase page = null; switch (academicDashboardType) { case AcademicDashboardType.LocalEducationAgency: page = Container.Resolve<LEA_OverviewPage>(); break; case AcademicDashboardType.School: page = Container.Resolve<School_OverviewPage>().For(schoolType); break; //case AcademicDashboardType.Student: // page = Container.Resolve<Student_OverviewPage>().For(schoolType); // break; default: throw new NotSupportedException(string.Format("Cannot yet visit the {0} academic dashboard yet.", academicDashboardType.ToString())); } // Navigate to the Overview page of the appropriate academic dashboard if (!page.IsCurrent() || forceNavigation) page.Visit(forceNavigation); var browser = ScenarioContext.Current.GetBrowser(); // Try to find the desired link on the Academic Dashboard submenu if (!TryClickLink(browser, linkText, Make_It.Wait_1_Second)) { // Try to click the Academic Dashboard if (!TryClickLink(browser, "Academic Dashboard")) { Thread.Sleep(2000); ScenarioContext.Current.GetBrowser().SaveScreenshot(string.Format("Trying to find the '{0}' link", "Academic Dashboard")); throw new Exception("Unable to locate the Academic Dashboard link."); } // Try to click the target submenu again if (!TryClickLink(browser, linkText)) { Thread.Sleep(2000); ScenarioContext.Current.GetBrowser().SaveScreenshot(string.Format("Trying to find the '{0}' link", linkText)); throw new Exception("Unable to locate the " + linkText + " link."); } } }
/// <summary> /// 创建与修改学校 /// </summary> /// <returns></returns> public string _EditSchool(long? id = null, string areaCode = null, SchoolType? schoolType = null) { RouteValueDictionary dictionary = new RouteValueDictionary(); if (schoolType.HasValue) { dictionary.Add("schoolType", schoolType); } dictionary.Add("id", id); dictionary.Add("areaCode", areaCode); return CachedUrlHelper.Action("_EditSchool", "ControlPanelSettings", CommonAreaName, dictionary); }
public ActionResult _SchoolSelector(string inputId, string areaCode = null, string keyword = null, SchoolType? schoolType = null) { ViewData["inputId"] = inputId; int pageSize = string.IsNullOrEmpty(areaCode) ? 100 : 1000; PagingDataSet<School> schools = schoolService.Gets(areaCode, keyword, schoolType, pageSize, 1); AreaService areaService = new AreaService(); var area = areaService.Get(areaCode); if (area != null) { while (area.Depth >= 3) { area = areaService.Get(area.ParentCode); } areaCode = area.AreaCode; } ViewData["areaCode"] = areaCode; return View(schools); }
/// <summary> /// 学校选择器 /// </summary> public string _SchoolSelector(string inputId, string areaCode = null, string keyword = null, SchoolType? schoolType = null) { return CachedUrlHelper.Action("_SchoolSelector", "Channel", CommonAreaName, new RouteValueDictionary { { "inputId", inputId }, { "areaCode", areaCode }, { "keyword", keyword }, { "schoolType", schoolType } }); }
public void GivenIGoToThePageOfTheAcademicDashboard(string subPageName, SchoolType schoolType) { // Perform direct navigation to the Overview page, then use links to get to sub-types PageBase.VisitAcademicDashboardSection(AcademicDashboardType.School, subPageName, schoolType, forceNavigation: true); }
public AvatarCreatorSpellObject(uint ExtraID, uint SpellNameID, uint SpellDescriptionID, uint SpellCost, SchoolType SchoolType) { this.extraID = ExtraID; this.spellNameID = SpellNameID; this.spellDescriptionID = SpellDescriptionID; this.spellCost = SpellCost; this.schoolType = SchoolType; }
/// <summary> /// 呈现地区列表,在search按钮处调用 /// </summary> /// <param name="areaCode"></param> /// <param name="keyword"></param> /// <param name="schoolType"></param> /// <param name="pageIndex"></param> /// <param name="pageSize"></param> /// <returns></returns> public ActionResult ManageSchools(string areaCode = null, string keyword = null, SchoolType? schoolType = null, int pageSize = 50, int pageIndex = 1) { pageResourceManager.InsertTitlePart("学校管理"); PagingDataSet<School> schools = schoolService.Gets(areaCode, keyword, schoolType, pageSize, pageIndex); ViewData["areaCode"] = areaCode; return View(schools); }
static string getSchoolString(SchoolType school) { switch (school) { case SchoolType.Abjuration: return "ограждение"; case SchoolType.Conjuration: return "призыв"; case SchoolType.Divination: return "прорицание"; case SchoolType.Enchantment: return "очарование"; case SchoolType.Evocation: return "проявление"; case SchoolType.Illusion: return "иллюзия"; case SchoolType.Necromancy: return "некромантия"; case SchoolType.Transmutation: return "преобразование"; default: throw new ArgumentException(); } }
/// <summary> /// /// </summary> /// <param name="RaiseChangedEvent"></param> public override void Clear(bool RaiseChangedEvent) { base.Clear(RaiseChangedEvent); if (RaiseChangedEvent) { TargetsCount = 0; SchoolType = 0; } else { targetsCount = 0; schoolType = 0; } }
/// <summary> /// 透過學生類別取得 UDT 內設定加分比重 學生.ID,比重 /// </summary> /// <param name="StudTagRecList"></param> /// <param name="ST"></param> /// <returns></returns> public static Dictionary<string, decimal> GetStudentAddWeightFormUDTByStudentTag(List<StudentTagRecord> StudTagRecList, SchoolType ST) { Dictionary<string, decimal> retVal = new Dictionary<string, decimal>(); Dictionary<string, decimal> weight = new Dictionary<string, decimal>(); foreach (DAL.UserDefData_StudTypeWeight udd in UDTTransfer.GetDataFromUDT_StudTypeWeight().Where(x=>x.SchoolType == ST.ToString ())) { if(udd.AddWeight < 0) continue ; if(!weight.ContainsKey (udd.StudentType)) weight.Add(udd.StudentType,udd.AddWeight); } foreach (StudentTagRecord StudTagRec in StudTagRecList ) { if(weight.ContainsKey(StudTagRec.FullName )) { if (retVal.ContainsKey(StudTagRec.RefStudentID)) { // 當有2個以上,取其高 if(retVal[StudTagRec.RefStudentID]<weight[StudTagRec.FullName]) retVal[StudTagRec.RefStudentID]=weight[StudTagRec.FullName]; } else retVal.Add(StudTagRec.RefStudentID, weight[StudTagRec.FullName]); } } return retVal; }
/// <summary> /// 学校管理界面 /// </summary> /// <returns></returns> public string ManageSchools(string areaCode, string keyword = null, SchoolType? schoolType = null) { return CachedUrlHelper.Action("ManageSchools", "ControlPanelSettings", CommonAreaName, new RouteValueDictionary() { { "AreaCode", areaCode }, { "keyword", keyword }, { "schoolType", schoolType } }); }
public ActionResult _EditSchool(long? id = null, string areaCode = null, SchoolType? schoolType = null) { if (id == null) { SchoolEditModel model = new SchoolEditModel(); model.AreaCode = areaCode; model.SchoolType = schoolType ?? SchoolType.University; return View(model); } else { var school = schoolService.Get(id.Value); SchoolEditModel model = school.AsEditModel(); return View(model); } }
///// <summary> ///// Gets or sets the user's LEA's code. ///// </summary> //public string LocalEducationAgency { get; set; } ///// <summary> ///// Gets or sets the user's LEA's id. ///// </summary> //public int LocalEducationAgencyId { get; set; } /// <summary> /// Gets the School Id for the requested school type from the user profile (if defined), or if the type is /// not specified, returns the first configured School Id (looking first at high school, then middle school /// and finally elementary school). /// </summary> /// <param name="schoolType">The specific type of school Id being requested.</param> /// <returns>The corresponding school Id if found; otherwise <b>null</b>.</returns> public int GetSchoolId(SchoolType schoolType = SchoolType.Unspecified) { switch (schoolType) { case SchoolType.ElementarySchool: return ElementarySchoolId.Value; case SchoolType.MiddleSchool: return MiddleSchoolId.Value; case SchoolType.HighSchool: return HighSchoolId.Value; case SchoolType.Unspecified: var currentSchoolType = ScenarioContext.Current.GetSchoolType(); if (currentSchoolType != SchoolType.Unspecified) return GetSchoolId(currentSchoolType); var schoolId = HighSchoolId ?? MiddleSchoolId ?? ElementarySchoolId; if (schoolId == null) throw new Exception("There is no school in context, nor is there one defined for the current user profile."); return schoolId.Value; default: throw new NotSupportedException(schoolType.ToString()); } }
/// <summary> /// 透過學生類別取得 UDT 內設定特種身分 學生.ID,特種身分 /// </summary> /// <param name="StudTagRecList"></param> /// <param name="ST"></param> /// <returns></returns> public static Dictionary<string, string> GetStudentSpcTypeFormUDTByStudentTag(List<StudentTagRecord> StudTagRecList, SchoolType ST) { Dictionary<string, DAL.UserDefData_StudTypeWeight> retVal = new Dictionary<string, DAL.UserDefData_StudTypeWeight>(); Dictionary<string, DAL.UserDefData_StudTypeWeight> weight = new Dictionary<string, DAL.UserDefData_StudTypeWeight>(); Dictionary<string, string> retVal1 = new Dictionary<string, string>(); foreach (DAL.UserDefData_StudTypeWeight udd in UDTTransfer.GetDataFromUDT_StudTypeWeight().Where(x => x.SchoolType == ST.ToString())) { if (udd.AddWeight < 0) continue; if (!weight.ContainsKey(udd.StudentType)) weight.Add(udd.StudentType,udd); } foreach (StudentTagRecord StudTagRec in StudTagRecList) { if (weight.ContainsKey(StudTagRec.FullName)) { if (retVal.ContainsKey(StudTagRec.RefStudentID)) { // 當有2個以上,取其高 if (retVal[StudTagRec.RefStudentID].AddWeight < weight[StudTagRec.FullName].AddWeight) retVal[StudTagRec.RefStudentID] = weight[StudTagRec.FullName]; } else retVal.Add(StudTagRec.RefStudentID, weight[StudTagRec.FullName]); } } foreach (KeyValuePair<string, DAL.UserDefData_StudTypeWeight> dd in retVal) { // 回傳特種身分 retVal1.Add(dd.Key, dd.Value.JoinStudType); } return retVal1; }
/// <summary> /// 查询学校 /// </summary> /// <param name="areaCode">地区编码</param> /// <param name="keyword">关键词(支持拼音搜索)</param> /// <param name="schoolType"></param> /// <param name="pageIndex"></param> /// <param name="pageSize"></param> /// <returns></returns> public PagingDataSet<School> Gets(string areaCode, string keyword, SchoolType? schoolType, int pageSize, int pageIndex) { return schoolRepository.Gets(areaCode, keyword, schoolType, pageSize, pageIndex); //设计要点: //1.缓存策略:当Keyword为null时,使用AreaCode分区缓存,否则不使用缓存; //2.缓存周期:稳定数据; //3.keyword:Name、PinyinName、ShortPinyinName,支持模糊搜索; //4.排序:按照DisplayOrder升序排序; }