Beispiel #1
0
 public int GetStudentYearClassSectionRollId(object YCSId, object studentId)
 {
     return(Convert.ToInt32(db.QueryValue("getSYCSRIdByYCSIdSId", new Dictionary <string, object>()
     {
         { "@ycsid", YCSId },
         { "@Sid", studentId }
     }, true)));
 }
Beispiel #2
0
 public int AddSubjectYear(object subjectId, object yearId, object totalMark)
 {
     return(Convert.ToInt32(db.QueryValue("addSubjectYear", new Dictionary <string, object>()
     {
         { "@SId", subjectId },
         { "@YId", yearId },
         { "@totalmark", totalMark }
     }, true)));
 }
Beispiel #3
0
 /// <summary>
 /// Checks if given Year, Class, Section combination exists
 /// </summary>
 /// <param name="yearId">Id of corresponding year entry</param>
 /// <param name="classId">Id of corresponding class entry</param>
 /// <param name="sectionId">Id of corresponding section entry</param>
 /// <returns>True if given Year, Class, Section combination exists, False otherwise</returns>
 public bool HasYearClassSection(object yearId, object classId, object sectionId)
 {
     return(Convert.ToInt32(db.QueryValue("countYearClassSection", new Dictionary <string, object>()
     {
         { "@YId", yearId },
         { "@CId", classId },
         { "@SId", sectionId }
     }, true)) > 0);
 }
 /// <summary>
 /// Add a new term to given YearClassSection with given percentage
 /// </summary>
 /// <param name="termId">Id of term to be added</param>
 /// <param name="yearClassSectionId">Id of corresponding yearClassSection entry</param>
 /// <param name="percentage">percentage of mark of given term that will contribute in final result</param>
 /// <returns>Number of entries added</returns>
 public int AddTermYearClassSection(int termId, int yearClassSectionId, int percentage)
 {
     return(Convert.ToInt32(db.QueryValue("addTermYearClassSection",
                                          new Dictionary <string, object>()
     {
         { "@termId", termId },
         { "@YCSID", yearClassSectionId },
         { "@percentage", percentage }
     }, true)));
 }
Beispiel #5
0
        /// <summary>
        /// Check a branch exists in the branches table
        /// </summary>
        /// <param name="branchId">The Branch Id</param>
        /// <returns></returns>
        public bool BranchExists(string branchName)
        {
            string commandText = "Select count(*) as count from branches where LOWER(BranchName) = @name";
            Dictionary <string, object> parameters = new Dictionary <string, object>();

            parameters.Add("@name", branchName == null ? "" : branchName.ToLower());
            Int64 exst = (Int64)_database.QueryValue(commandText, parameters);

            return(exst > 0);
        }
 public int GetYearId(string year)
 {
     return(Convert.ToInt32(db.QueryValue("getYearId", new Dictionary <string, object>()
     {
         { "@pyear", year }
     }, true)));
 }
 public int GetStudentId(object userId)
 {
     return(Convert.ToInt32(db.QueryValue("getSIdByUId",
                                          new Dictionary <string, object>()
     {
         { "@UId", userId }
     }, true)));
 }
 /// <summary>
 /// Add a new teacherSubject entry
 /// </summary>
 /// <param name="teacherId">Id of correspondint teacher</param>
 /// <param name="subjectId">Id of correspondint subject</param>
 /// <param name="yearClassSectionId">Id of correspondint yearClassSection entry</param>
 /// <returns>Id of newly added teacherSubject entry</returns>
 public int AddTeacherSubject(object teacherId, object subjectId, object yearClassSectionId)
 {
     return(Convert.ToInt32(db.QueryValue("addTeacherSubject", new Dictionary <string, object>()
     {
         { "TId", teacherId },
         { "@SId", subjectId },
         { "@YCSId", yearClassSectionId }
     }, true)));
 }
Beispiel #9
0
        /// <summary>
        /// Returns the role Id given a role name
        /// </summary>
        /// <param name="roleName">Role's name</param>
        /// <returns>Role's Id</returns>
        public string GetRoleId(string roleName)
        {
            string roleId      = null;
            string commandText = "Select Id from roles where Name = @name";
            Dictionary <string, object> parameters = new Dictionary <string, object>()
            {
                { "@name", roleName }
            };

            var result = _database.QueryValue(commandText, parameters);

            if (result != null)
            {
                return(Convert.ToString(result));
            }

            return(roleId);
        }