public void NewAddress_InsertOrUpdate_Persisted() { var detail = new StudentDetailModel() { Name = "Jane Doe", Address = new AddressDetailModel() { City = "Brno", Country = "Jihomoravsky-kraj", State = "Czechia", Street = "Bozetechova 2", }, Grade = new GradeMapper().MapListModel(Seed.GradeJane), Courses = new List <StudentCourseListModel>() { new() { CourseId = Seed.IcsCourse.Id, Name = Seed.IcsCourse.Name, } } }; detail = _facadeSUT.Save(detail); Assert.NotEqual(Guid.Empty, detail.Id); var entityFromDb = _repository.GetById(detail.Id); Assert.Equal(detail, _mapper.Map(entityFromDb)); }
public CascadingDropDownNameValue[] GetGradesByJobCode(string knownCategoryValues, string category) { StringDictionary kv = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues); string jobCode; if (!kv.ContainsKey("JobTitle")) { return(null); } jobCode = kv["JobTitle"]; List <CascadingDropDownNameValue> values = new List <CascadingDropDownNameValue>(); List <GradeEntity> list = new GradeMapper().ListByJobeCode(jobCode); foreach (GradeEntity ent in list) { string text = ent.Id; CascadingDropDownNameValue cdnv = new CascadingDropDownNameValue(text, ent.Id.ToString()); values.Add(cdnv); } return(values.ToArray()); }
protected void ProceedButton_Click(object sender, EventArgs e) { JobDetailsSessionView jbs = new JobDetailsSessionView(); FunctionalLevelEntity flentity = new FunctionalLevelEntity(); flentity.Id = Convert.ToInt32(FunctionalLevelDropDownList.SelectedValue); flentity = new FunctionalLevelMapper().Get(flentity); jbs.FunctionalLevel = flentity; OrganizationalUnitEntity ouentity = new OrganizationalUnitEntity(); ouentity.Id = Convert.ToInt32(OrganisationalUnitDropDownList.SelectedValue); OrganizationalUnitView ouView = new OrganizationalUnitMapper().Get(ouentity); jbs.OrganisationalUnit = ouView; GradeEntity gentity = new GradeEntity(); gentity.Id = GradeDropDownList.SelectedValue; gentity = new GradeMapper().Get(gentity); jbs.Grade = gentity; JobTitleEntity job = new JobTitleEntity(); job.JobCode = JobDetailsDropDownList.SelectedValue; JobTitleView jobview = new JobTitleMapper().Get(job); jbs.Job = jobview; StepEntity sentity = new StepEntity(); sentity.Id = StepDropDownList.SelectedValue; sentity = new StepMapper().Get(sentity); jbs.Step = sentity; foreach (ListItem item in ContractsCheckBoxList.Items) { if (item.Selected == true) { jbs.ContractsTemplates.Add(new ContractTemplateEntity() { Id = Convert.ToInt32(item.Value), Title = item.Text }); } } Session.Add("JobDetails", jbs); Response.Redirect("Contract.aspx?EmployeeId=" + Request.QueryString["EmployeeId"] + "&ContractTemplateId=" + jbs.ContractsTemplates[0].Id); }
public CascadingDropDownNameValue[] GetGradesByJobCode(string knownCategoryValues, string category) { StringDictionary kv = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues); string jobCode; if (!kv.ContainsKey("JobTitle")) { return null; } jobCode = kv["JobTitle"]; List<CascadingDropDownNameValue> values = new List<CascadingDropDownNameValue>(); List<GradeEntity> list = new GradeMapper().ListByJobeCode(jobCode); foreach (GradeEntity ent in list) { string text = ent.Id; CascadingDropDownNameValue cdnv = new CascadingDropDownNameValue(text, ent.Id.ToString()); values.Add(cdnv); } return values.ToArray(); }