示例#1
0
        public static string GetGradePoint(string DepartmentCode, string GradeMessageCode, string MainDefineCode)
        {
            GradeList list = new GradeList();

            if ((GradeMessageCode != "") && (GradeMessageCode != null))
            {
                list.GradeMessageCode = GradeMessageCode;
            }
            if ((DepartmentCode != "") && (DepartmentCode != null))
            {
                list.DepartmentDefineCode = DepartmentCode;
            }
            DataTable grades = list.GetGrades();
            DataTable lastConsiderPercentage = new GradeConsiderPercentage().GetLastConsiderPercentage(GradeMessageCode, MainDefineCode);
            decimal   num = 0M;

            if (list != null)
            {
                for (int i = 0; i < grades.Rows.Count; i++)
                {
                    if ((lastConsiderPercentage != null) && (lastConsiderPercentage.Rows.Count != 0))
                    {
                        num += (Convert.ToDecimal(grades.Rows[i]["GradeValue"]) * Convert.ToDecimal(lastConsiderPercentage.Select("ConsiderDiathesisCode='" + grades.Rows[i]["ConsiderDiathesisCode"].ToString() + "'")[0]["Percentage"])) * 10M;
                    }
                    else
                    {
                        num += Convert.ToDecimal(grades.Rows[i]["GradeValue"]);
                    }
                }
            }
            return(num.ToString("N0"));
        }
示例#2
0
        public static string GetGrade(string ConsiderDiathesisCode, string DepartmentCode, string GradeMessageCode)
        {
            GradeList list = new GradeList();

            list.GradeMessageCode      = GradeMessageCode;
            list.ConsiderDiathesisCode = ConsiderDiathesisCode;
            list.DepartmentDefineCode  = DepartmentCode;
            DataTable grades = list.GetGrades();

            if (grades.Rows.Count > 0)
            {
                return(grades.Rows[0]["GradeValue"].ToString());
            }
            return("0");
        }