public async Task <bool> InsertUpdateRole(Role role)
        {
            string          query      = "SpInsertUpdateRole";
            List <SqlParam> collection = new List <SqlParam>()
            {
                new SqlParam("@Id", SqlDbType.Int, role.Id),
                new SqlParam("@Name", SqlDbType.NVarChar, role.Name),
            };

            return(await _dao.ExecuteNonQueryAsync(query, collection, CommandType.StoredProcedure));
        }
Esempio n. 2
0
        public async Task <bool> InsertUpdateStudentModuleMapping(StudentModuleMapping studentModuleMapping)
        {
            string          query      = "SpInsertUpdateStudentModuleMapping";
            List <SqlParam> collection = new List <SqlParam>()
            {
                new SqlParam("@Id", SqlDbType.Int, studentModuleMapping.Id),
                new SqlParam("@StudentId", SqlDbType.Int, studentModuleMapping.StudentId),
                new SqlParam("@ModuleId", SqlDbType.Int, studentModuleMapping.ModuleId),
            };

            return(await _dao.ExecuteNonQueryAsync(query, collection, CommandType.StoredProcedure));
        }
Esempio n. 3
0
        public async Task <bool> InsertUpdateCourse(Course student)
        {
            string          query      = "SpInsertUpdateCourse";
            List <SqlParam> collection = new List <SqlParam>()
            {
                new SqlParam("@Id", SqlDbType.Int, student.Id),
                new SqlParam("@Name", SqlDbType.NVarChar, student.Name),
                new SqlParam("@Description", SqlDbType.NVarChar, student.Description),
            };

            return(await _dao.ExecuteNonQueryAsync(query, collection, CommandType.StoredProcedure));
        }
        public async Task <bool> InsertUpdateUser(User user)
        {
            string          query      = "SpInsertUpdateUser";
            List <SqlParam> collection = new List <SqlParam>()
            {
                new SqlParam("@Id", SqlDbType.Int, user.Id),
                new SqlParam("@UserName", SqlDbType.VarChar, user.UserName),
                new SqlParam("@Password", SqlDbType.NVarChar, user.Password),
                new SqlParam("@Email", SqlDbType.NVarChar, user.Email),
                new SqlParam("@RoleId", SqlDbType.Int, user.RoleId),
            };

            return(await _dao.ExecuteNonQueryAsync(query, collection, CommandType.StoredProcedure));
        }
        public async Task <bool> InsertUpdateTeacher(Teacher teacher)
        {
            string          query      = "SpInsertUpdateTeacher";
            List <SqlParam> collection = new List <SqlParam>()
            {
                new SqlParam("@Id", SqlDbType.Int, teacher.Id),
                new SqlParam("@Name", SqlDbType.VarChar, teacher.Name),
                new SqlParam("@Type", SqlDbType.Int, teacher.Type),
                new SqlParam("@Email", SqlDbType.VarChar, teacher.Email),
                new SqlParam("@MobileNo", SqlDbType.VarChar, teacher.MobileNo),
            };

            return(await _dao.ExecuteNonQueryAsync(query, collection, CommandType.StoredProcedure));
        }
        public async Task <bool> InsertUpdateStudent(SAMS.Models.Student student)
        {
            string          query      = "SpInsertUpdateStudent";
            List <SqlParam> collection = new List <SqlParam>()
            {
                new SqlParam("@Id", SqlDbType.Int, student.Id),
                new SqlParam("@Name", SqlDbType.NVarChar, student.Name),
                new SqlParam("@RollNumber", SqlDbType.NVarChar, student.RollNumber),
                new SqlParam("@Email", SqlDbType.NVarChar, student.Email),
                new SqlParam("@AcademicYear", SqlDbType.NVarChar, student.AcademicYear),
                new SqlParam("@EnrollDate", SqlDbType.Date, student.EnrollDate),
            };

            return(await _dao.ExecuteNonQueryAsync(query, collection, CommandType.StoredProcedure));
        }
Esempio n. 7
0
        public async Task <bool> InsertUpdateModule(Module module)
        {
            string          query      = "SpInsertUpdateModule";
            List <SqlParam> collection = new List <SqlParam>()
            {
                new SqlParam("@Id", SqlDbType.Int, module.Id),
                new SqlParam("@Name", SqlDbType.NVarChar, module.Name),
                new SqlParam("@Code", SqlDbType.NVarChar, module.Code),
                new SqlParam("@Credit", SqlDbType.Int, module.Credit),
                new SqlParam("@Level", SqlDbType.Int, module.Level),
                new SqlParam("@CourseId", SqlDbType.Int, module.CourseId),
                new SqlParam("@SemesterId", SqlDbType.Int, module.SemesterId)
            };

            return(await _dao.ExecuteNonQueryAsync(query, collection, CommandType.StoredProcedure));
        }
Esempio n. 8
0
        public async Task <bool> SaveAttendance(AttendanceMaster data)
        {
            string qry = @"USP_UPDATE_ATTENDANCE";

            DataTable dtDetails = data.details.Select(x => new
            {
                Id        = (int)x.Id,
                MastId    = (int)x.MastId,
                StudentId = (int)x.StudentId,
                Status    = x.Status ?? "",
                Remarks   = x.Remarks ?? ""
            }
                                                      ).ToList().ToDataTable();

            List <SqlParam> parameters = new List <SqlParam>()
            {
                new SqlParam("@AttendanceId", SqlDbType.Int, data.Id),
                new SqlParam("@ModuleId", SqlDbType.Int, data.ModuleId),
                new SqlParam("@AttendanceDate", SqlDbType.Date, data.AttendanceDate),
                new SqlParam("@TimetableId", SqlDbType.Int, data.TimetableId),
                new SqlParam("@ATTENDANCE_DETAILS", SqlDbType.Structured, dtDetails),
            };

            return(await _dao.ExecuteNonQueryAsync(qry, parameters, CommandType.StoredProcedure));
        }
Esempio n. 9
0
        public async Task <bool> InsertUpdateTimeTable(Timetable timetable)
        {
            string          query      = "SpInsertUpdateTimetable";
            List <SqlParam> collection = new List <SqlParam>()
            {
                new SqlParam("@Id", SqlDbType.Int, timetable.Id),
                new SqlParam("@CourseId", SqlDbType.Int, timetable.CourseId),
                new SqlParam("@SemesterId", SqlDbType.Int, timetable.SemesterId),
                new SqlParam("@AcademicYear", SqlDbType.Int, timetable.AcademicYear),
                new SqlParam("@ModuleId", SqlDbType.Int, timetable.ModuleId),
                new SqlParam("@TeacherId", SqlDbType.Int, timetable.TeacherId),
                new SqlParam("@StartTime", SqlDbType.NVarChar, timetable.StartTime),
                new SqlParam("@EndTime", SqlDbType.NVarChar, timetable.EndTime),
                new SqlParam("@Day", SqlDbType.NVarChar, timetable.Day),
            };

            return(await _dao.ExecuteNonQueryAsync(query, collection, CommandType.StoredProcedure));
        }