示例#1
0
 /// <summary>
 /// 返回所有年级的所有班级成绩
 /// 年级实体
 /// </summary>
 /// <param name="path">年级文件夹路径:六个年级的文件</param>
 /// <returns>所有年级的list</returns>
 public static List <GradeEntity> GetExcelFiles(string path)
 {
     try
     {
         DirectoryInfo directoryInfo = new DirectoryInfo(path);
         var           gradeList     = new List <GradeEntity>();
         //file 每一个年级文件
         foreach (var file in directoryInfo.GetFiles())
         {
             if (file.Extension.Length <= 0)
             {
                 continue;
             }
             var id    = CalculationFromExcel(file.FullName, out var classGrade);
             var grade = new GradeEntity()
             {
                 Id = Path.GetFileNameWithoutExtension(file.FullName),
             };
             grade.ClassLists = classGrade;
             gradeList.Add(grade);
         }
         //grade.ClassLists = class
         return(gradeList);
     }
     catch (Exception e)
     {
     }
     return(null);
 }
 private void BindsList(GradeEntity d, List <SubjectEntity> allList)
 {
     if (d.Id.Equals("1年级") || d.Id.Equals("1") || d.Id.Equals("一年级"))
     {
         m_dataGrid.ItemsSource = allList;
     }
     else if (d.Id.Equals("2年级") || d.Id.Equals("2") || d.Id.Equals("二年级"))
     {
         m_dataGrid2.ItemsSource = allList;
     }
     else if (d.Id.Equals("3年级") || d.Id.Equals("3") || d.Id.Equals("三年级"))
     {
         m_dataGrid3.ItemsSource = allList;
     }
     else if (d.Id.Equals("4年级") || d.Id.Equals("4") || d.Id.Equals("四年级"))
     {
         m_dataGrid4.ItemsSource = allList;
     }
     else if (d.Id.Equals("5年级") || d.Id.Equals("5") || d.Id.Equals("五年级"))
     {
         m_dataGrid5.ItemsSource = allList;
     }
     else if (d.Id.Equals("6年级") || d.Id.Equals("6") || d.Id.Equals("六年级"))
     {
         m_dataGrid6.ItemsSource = allList;
     }
 }
 public JobDetailsSessionView()
 {
     ContractsTemplates = new List<ContractTemplateEntity>();
     FunctionalLevel = new FunctionalLevelEntity();
     OrganisationalUnit = new OrganizationalUnitView();
     Grade = new GradeEntity();
     Step = new StepEntity();
     Job = new JobTitleView();
     IsGenerated = false;
 }
示例#4
0
 public JobDetailsSessionView()
 {
     ContractsTemplates = new List <ContractTemplateEntity>();
     FunctionalLevel    = new FunctionalLevelEntity();
     OrganisationalUnit = new OrganizationalUnitView();
     Grade       = new GradeEntity();
     Step        = new StepEntity();
     Job         = new JobTitleView();
     IsGenerated = false;
 }
示例#5
0
        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 void InsertGradeTest()
        {
            //Arrange
            var gradeEntity = new GradeEntity
            {
                Name    = "Freshman",
                Section = "High school"
            };

            //Act
            testContext.SchoolDbContextSUT.Grades.Add(gradeEntity);
            testContext.SchoolDbContextSUT.SaveChanges();


            //Assert
            using (var schoolDbContext = testContext.CreateSchoolDbContext())
            {
                var retrievedGrade = schoolDbContext.Grades.First(e => e.Id == gradeEntity.Id);
                Assert.Equal(gradeEntity, retrievedGrade, new GradeEqualityComparer());
            }
        }
示例#7
0
        protected void newEducationButton_Click(object sender, EventArgs e)
        {
            GradeEntity grade = new GradeEntity();

            grade.Id      = GradeTextBox.Text;
            grade.JobCode = Request.QueryString["jobCode"];
            try
            {
                new GradeMapper().Insert(grade);
                Response.Redirect("DefineGrade.aspx?jobCode=" + Request.QueryString["jobCode"]);
            }
            catch (Exception)
            {
                StringBuilder sb = new StringBuilder();
                sb.Append("<script language='javascript'>displayNoty('Please write another Grade name beacuse this Grade name already exists.');</script>");

                // if the script is not already registered
                if (!Page.ClientScript.IsClientScriptBlockRegistered(Page.GetType(), "HeyPopup"))
                {
                    ClientScript.RegisterClientScriptBlock(Page.GetType(), "HeyPopup", sb.ToString());
                }
            }
        }
        public void InsertGradeWithStudentsTest()
        {
            var studentEntity = new StudentEntity {
                Name = "Nogah Jael"
            };
            //Arrange
            var gradeEntity = new GradeEntity
            {
                Name     = "Junior",
                Section  = "Senior high school",
                Students = new List <StudentEntity>
                {
                    studentEntity,
                    new StudentEntity {
                        Name = "Elias Yochanan"
                    },
                    new StudentEntity {
                        Name = "Gideon Cambyses"
                    }
                }
            };

            //Act
            testContext.SchoolDbContextSUT.Grades.Add(gradeEntity);
            testContext.SchoolDbContextSUT.SaveChanges();


            //Assert
            using (var schoolDbContext = testContext.CreateSchoolDbContext())
            {
                var retrievedGrade = schoolDbContext.Grades.Include(e => e.Students)
                                     .First(e => e.Id == gradeEntity.Id);
                Assert.Equal(gradeEntity, retrievedGrade, new GradeEqualityComparer());
                Assert.Equal(studentEntity, retrievedGrade.Students.First(e => e.Id == studentEntity.Id),
                             new StudentEqualityComparer());
            }
        }
示例#9
0
 public void SubmitForm(GradeEntity entity, string keyValue)
 {
     throw new NotImplementedException();
 }