/// <summary>
        /// Deletes a record based on primary key(s)
        /// </summary>
        internal static void Delete(int enrollmentId)
        {
            CourseEnquiryContext context = new CourseEnquiryContext();
            var objCourseEnrollment      = context.CourseEnrollment.Where(c => c.EnrollmentId == enrollmentId).FirstOrDefault();

            if (objCourseEnrollment != null)
            {
                context.CourseEnrollment.Remove(objCourseEnrollment);
                context.SaveChanges();
            }
        }
Пример #2
0
        /// <summary>
        /// Deletes a record based on primary key(s)
        /// </summary>
        internal static void Delete(int courseId)
        {
            CourseEnquiryContext context = new CourseEnquiryContext();
            var objCourse = context.Course.Where(c => c.CourseId == courseId).FirstOrDefault();

            if (objCourse != null)
            {
                context.Course.Remove(objCourse);
                context.SaveChanges();
            }
        }
        /// <summary>
        /// Deletes a record based on primary key(s)
        /// </summary>
        internal static void Delete(int workflowId)
        {
            CourseEnquiryContext context = new CourseEnquiryContext();
            var objWorkflowMaster        = context.WorkflowMaster.Where(w => w.WorkflowId == workflowId).FirstOrDefault();

            if (objWorkflowMaster != null)
            {
                context.WorkflowMaster.Remove(objWorkflowMaster);
                context.SaveChanges();
            }
        }
Пример #4
0
        /// <summary>
        /// Deletes a record based on primary key(s)
        /// </summary>
        internal static void Delete(int studenId)
        {
            CourseEnquiryContext context = new CourseEnquiryContext();
            var objStudent = context.Student.Where(s => s.StudenId == studenId).FirstOrDefault();

            if (objStudent != null)
            {
                context.Student.Remove(objStudent);
                context.SaveChanges();
            }
        }
Пример #5
0
        /// <summary>
        /// Deletes a record based on primary key(s)
        /// </summary>
        internal static void Delete(int roleId)
        {
            CourseEnquiryContext context = new CourseEnquiryContext();
            var objRoleMaster            = context.RoleMaster.Where(r => r.RoleId == roleId).FirstOrDefault();

            if (objRoleMaster != null)
            {
                context.RoleMaster.Remove(objRoleMaster);
                context.SaveChanges();
            }
        }
        /// <summary>
        /// Deletes a record based on primary key(s)
        /// </summary>
        internal static void Delete(int userId)
        {
            CourseEnquiryContext context = new CourseEnquiryContext();
            var objUserMaster            = context.UserMaster.Where(u => u.UserId == userId).FirstOrDefault();

            if (objUserMaster != null)
            {
                context.UserMaster.Remove(objUserMaster);
                context.SaveChanges();
            }
        }
        /// <summary>
        /// Inserts a record
        /// </summary>
        internal static int Insert(CourseEnrollment objCourseEnrollment)
        {
            CourseEnquiryContext context             = new CourseEnquiryContext();
            CourseEnrollment     entCourseEnrollment = new CourseEnrollment();

            entCourseEnrollment.CourseName  = objCourseEnrollment.CourseName;
            entCourseEnrollment.StudentName = objCourseEnrollment.StudentName;
            entCourseEnrollment.Comments    = objCourseEnrollment.Comments;

            context.CourseEnrollment.Add(entCourseEnrollment);
            context.SaveChanges();

            return(entCourseEnrollment.EnrollmentId);
        }
        /// <summary>
        /// Inserts a record
        /// </summary>
        internal static int Insert(UserRoles objUserRoles)
        {
            CourseEnquiryContext context      = new CourseEnquiryContext();
            UserRoles            entUserRoles = new UserRoles();

            entUserRoles.UserId = objUserRoles.UserId;
            entUserRoles.RoleId = objUserRoles.RoleId;
            entUserRoles.Status = objUserRoles.Status;

            context.UserRoles.Add(entUserRoles);
            context.SaveChanges();

            return(entUserRoles.UserRoleId);
        }
        /// <summary>
        /// Updates a record
        /// </summary>
        internal static void Update(UserRoles objUserRoles)
        {
            CourseEnquiryContext context      = new CourseEnquiryContext();
            UserRoles            entUserRoles = context.UserRoles.Where(u => u.UserRoleId == objUserRoles.UserRoleId).FirstOrDefault();

            if (entUserRoles != null)
            {
                entUserRoles.UserId = objUserRoles.UserId;
                entUserRoles.RoleId = objUserRoles.RoleId;
                entUserRoles.Status = objUserRoles.Status;

                context.SaveChanges();
            }
        }
        /// <summary>
        /// Updates a record
        /// </summary>
        internal static void Update(CourseEnrollment objCourseEnrollment)
        {
            CourseEnquiryContext context             = new CourseEnquiryContext();
            CourseEnrollment     entCourseEnrollment = context.CourseEnrollment.Where(c => c.EnrollmentId == objCourseEnrollment.EnrollmentId).FirstOrDefault();

            if (entCourseEnrollment != null)
            {
                entCourseEnrollment.CourseName  = objCourseEnrollment.CourseName;
                entCourseEnrollment.StudentName = objCourseEnrollment.StudentName;
                entCourseEnrollment.Comments    = objCourseEnrollment.Comments;

                context.SaveChanges();
            }
        }
Пример #11
0
        /// <summary>
        /// Inserts a record
        /// </summary>
        internal static int Insert(Student objStudent)
        {
            CourseEnquiryContext context = new CourseEnquiryContext();
            Student entStudent           = new Student();

            entStudent.StudentName   = objStudent.StudentName;
            entStudent.EmailId       = objStudent.EmailId;
            entStudent.ContactNumber = objStudent.ContactNumber;
            entStudent.Password      = objStudent.Password;

            context.Student.Add(entStudent);
            context.SaveChanges();

            return(entStudent.StudenId);
        }
Пример #12
0
        /// <summary>
        /// Updates a record
        /// </summary>
        internal static void Update(Student objStudent)
        {
            CourseEnquiryContext context = new CourseEnquiryContext();
            Student entStudent           = context.Student.Where(s => s.StudenId == objStudent.StudenId).FirstOrDefault();

            if (entStudent != null)
            {
                entStudent.StudentName   = objStudent.StudentName;
                entStudent.EmailId       = objStudent.EmailId;
                entStudent.ContactNumber = objStudent.ContactNumber;
                entStudent.Password      = objStudent.Password;

                context.SaveChanges();
            }
        }
Пример #13
0
        /// <summary>
        /// Updates a record
        /// </summary>
        internal static void Update(Course objCourse)
        {
            CourseEnquiryContext context = new CourseEnquiryContext();
            Course entCourse             = context.Course.Where(c => c.CourseId == objCourse.CourseId).FirstOrDefault();

            if (entCourse != null)
            {
                entCourse.CourseName = objCourse.CourseName;
                entCourse.StartDate  = objCourse.StartDate;
                entCourse.EndDate    = objCourse.EndDate;
                entCourse.Fees       = objCourse.Fees;

                context.SaveChanges();
            }
        }
Пример #14
0
        /// <summary>
        /// Inserts a record
        /// </summary>
        internal static int Insert(Course objCourse)
        {
            CourseEnquiryContext context = new CourseEnquiryContext();
            Course entCourse             = new Course();

            entCourse.CourseName = objCourse.CourseName;
            entCourse.StartDate  = objCourse.StartDate;
            entCourse.EndDate    = objCourse.EndDate;
            entCourse.Fees       = objCourse.Fees;

            context.Course.Add(entCourse);
            context.SaveChanges();

            return(entCourse.CourseId);
        }
Пример #15
0
        /// <summary>
        /// Inserts a record
        /// </summary>
        internal static int Insert(RoleMaster objRoleMaster)
        {
            CourseEnquiryContext context       = new CourseEnquiryContext();
            RoleMaster           entRoleMaster = new RoleMaster();

            entRoleMaster.RoleDescription = objRoleMaster.RoleDescription;
            entRoleMaster.CreatedOn       = objRoleMaster.CreatedOn;
            entRoleMaster.CreatedBy       = objRoleMaster.CreatedBy;
            entRoleMaster.ModifiedOn      = objRoleMaster.ModifiedOn;
            entRoleMaster.ModifiedBy      = objRoleMaster.ModifiedBy;

            context.RoleMaster.Add(entRoleMaster);
            context.SaveChanges();

            return(entRoleMaster.RoleId);
        }
Пример #16
0
        /// <summary>
        /// Updates a record
        /// </summary>
        internal static void Update(RoleMaster objRoleMaster)
        {
            CourseEnquiryContext context       = new CourseEnquiryContext();
            RoleMaster           entRoleMaster = context.RoleMaster.Where(r => r.RoleId == objRoleMaster.RoleId).FirstOrDefault();

            if (entRoleMaster != null)
            {
                entRoleMaster.RoleDescription = objRoleMaster.RoleDescription;
                entRoleMaster.CreatedOn       = objRoleMaster.CreatedOn;
                entRoleMaster.CreatedBy       = objRoleMaster.CreatedBy;
                entRoleMaster.ModifiedOn      = objRoleMaster.ModifiedOn;
                entRoleMaster.ModifiedBy      = objRoleMaster.ModifiedBy;

                context.SaveChanges();
            }
        }
        /// <summary>
        /// Updates a record
        /// </summary>
        internal static void Update(WorkflowMaster objWorkflowMaster)
        {
            CourseEnquiryContext context           = new CourseEnquiryContext();
            WorkflowMaster       entWorkflowMaster = context.WorkflowMaster.Where(w => w.WorkflowId == objWorkflowMaster.WorkflowId).FirstOrDefault();

            if (entWorkflowMaster != null)
            {
                entWorkflowMaster.WorkflowName     = objWorkflowMaster.WorkflowName;
                entWorkflowMaster.LevelOfApprovals = objWorkflowMaster.LevelOfApprovals;
                entWorkflowMaster.CreatedBy        = objWorkflowMaster.CreatedBy;
                entWorkflowMaster.CreatedOn        = objWorkflowMaster.CreatedOn;
                entWorkflowMaster.Updatedby        = objWorkflowMaster.Updatedby;
                entWorkflowMaster.Updatedon        = objWorkflowMaster.Updatedon;

                context.SaveChanges();
            }
        }
        /// <summary>
        /// Inserts a record
        /// </summary>
        internal static int Insert(WorkflowMaster objWorkflowMaster)
        {
            CourseEnquiryContext context           = new CourseEnquiryContext();
            WorkflowMaster       entWorkflowMaster = new WorkflowMaster();

            entWorkflowMaster.WorkflowName     = objWorkflowMaster.WorkflowName;
            entWorkflowMaster.LevelOfApprovals = objWorkflowMaster.LevelOfApprovals;
            entWorkflowMaster.CreatedBy        = objWorkflowMaster.CreatedBy;
            entWorkflowMaster.CreatedOn        = objWorkflowMaster.CreatedOn;
            entWorkflowMaster.Updatedby        = objWorkflowMaster.Updatedby;
            entWorkflowMaster.Updatedon        = objWorkflowMaster.Updatedon;

            context.WorkflowMaster.Add(entWorkflowMaster);
            context.SaveChanges();

            return(entWorkflowMaster.WorkflowId);
        }
        /// <summary>
        /// Updates a record
        /// </summary>
        internal static void Update(UserMaster objUserMaster)
        {
            CourseEnquiryContext context       = new CourseEnquiryContext();
            UserMaster           entUserMaster = context.UserMaster.Where(u => u.UserId == objUserMaster.UserId).FirstOrDefault();

            if (entUserMaster != null)
            {
                entUserMaster.UserName   = objUserMaster.UserName;
                entUserMaster.Password   = objUserMaster.Password;
                entUserMaster.Email      = objUserMaster.Email;
                entUserMaster.CreatedOn  = objUserMaster.CreatedOn;
                entUserMaster.CreatedBy  = objUserMaster.CreatedBy;
                entUserMaster.ModifiedOn = objUserMaster.ModifiedOn;
                entUserMaster.ModifiedBy = objUserMaster.ModifiedBy;

                context.SaveChanges();
            }
        }
        /// <summary>
        /// Inserts a record
        /// </summary>
        internal static int Insert(UserMaster objUserMaster)
        {
            CourseEnquiryContext context       = new CourseEnquiryContext();
            UserMaster           entUserMaster = new UserMaster();

            entUserMaster.UserName   = objUserMaster.UserName;
            entUserMaster.Password   = objUserMaster.Password;
            entUserMaster.Email      = objUserMaster.Email;
            entUserMaster.CreatedOn  = objUserMaster.CreatedOn;
            entUserMaster.CreatedBy  = objUserMaster.CreatedBy;
            entUserMaster.ModifiedOn = objUserMaster.ModifiedOn;
            entUserMaster.ModifiedBy = objUserMaster.ModifiedBy;

            context.UserMaster.Add(entUserMaster);
            context.SaveChanges();

            return(entUserMaster.UserId);
        }