public async Task <List <DocumentPortalModel> > GetDocumentByEnqId(int enqId)
        {
            List <DocumentPortalModel> documentList = new List <DocumentPortalModel>();

            GEEDbContext context = new GEEDbContext();

            var docList = (from ds in context.DocumentSubmissionDetails
                           join dt in context.DocumentTypes on ds.DocumentTypeID equals dt.DocumentTypeID
                           join ms in context.MasterTables on dt.DocumentCategoryID equals ms.MasterTable_id
                           join m in context.MasterTables on ms.Parent_id equals m.MasterTable_id
                           where ds.Enquiry_Id == enqId
                           select new {
                DocumentType = dt.DocumentTypeName,
                Subcategory = ms.Name,
                Category = m.Name,
                DigitalPath = ds.DigitalPathofDocument,
                PhysicalPath = ds.PhysicalFileLocaiton,
                Id = ds.DocumentSubmission_ID
            });

            foreach (var item in docList)
            {
                documentList.Add(Mapper.Map <DocumentPortalModel>(item));
            }
            return(documentList);
        }
        public List <PermissionParentModel> GetMenu(int moduleId, int userGroupId)
        {
            GEEDbContext objGEEDbContext = new GEEDbContext();
            var          navMenuList     = objGEEDbContext.NavigationMenu1.Where(a => a.NavigationMenuParentId == moduleId & a.NaviVisible == true);
            List <PermissionParentModel>  listGetMenuModel           = new List <PermissionParentModel>();
            List <PermissionMappingModel> listPermissionMappingModel = new List <PermissionMappingModel>();

            foreach (var item in navMenuList)
            {
                PermissionParentModel objPermissionParentModel = new PermissionParentModel();
                objPermissionParentModel.NavigationMenuId         = item.NavigationMenuId;
                objPermissionParentModel.NavigationMenuName       = item.NavigationMenuName;
                objPermissionParentModel.PermissionChildModelList = GeMenuPermission(userGroupId, item.NavigationMenuId);

                var navSecondMenuList = objGEEDbContext.NavigationMenu1.Where(a => a.NavigationMenuParentId == item.NavigationMenuId & a.NaviVisible == true);

                foreach (var item1 in navSecondMenuList)
                {
                    PermissionParentModel objPermissionParentModelSeondLevel = new PermissionParentModel();
                    objPermissionParentModelSeondLevel.NavigationMenuId         = item1.NavigationMenuId;
                    objPermissionParentModelSeondLevel.NavigationMenuName       = item1.NavigationMenuName;
                    objPermissionParentModelSeondLevel.PermissionChildModelList = GeMenuPermission(userGroupId, item1.NavigationMenuId);
                    objPermissionParentModel.PermissionParent = objPermissionParentModelSeondLevel;
                }

                listGetMenuModel.Add(objPermissionParentModel);
            }
            return(listGetMenuModel);
        }
        public List <StartAdmissionModel> UpdateStartAdmissionList(List <StartAdmissionModel> startAdmissionModels)
        {
            try
            {
                using (GEEDbContext context = new GEEDbContext())
                {
                    foreach (var item in startAdmissionModels)
                    {
                        AdmissionStatu admissionStatus = context.AdmissionStatus.Where(a => a.AdmissionStatus_id == item.AdmissionStatus_id).FirstOrDefault();
                        if (admissionStatus != null)
                        {
                            admissionStatus.AdmissionCode    = item.AdmissionCode;
                            admissionStatus.AdmissionStatus  = item.AdmissionStatus;
                            admissionStatus.Startdate        = item.Startdate;
                            admissionStatus.FromDOB          = item.FromDOB;
                            admissionStatus.TODOB            = item.TODOB;
                            admissionStatus.ApplicaitonFees  = item.ApplicaitonFees;
                            admissionStatus.RegistrationFees = item.RegistrationFees;

                            context.Entry(admissionStatus).State = EntityState.Modified;
                            context.SaveChanges();
                        }
                    }
                }
                return(null);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
        /// <summary>
        /// This is the generic methos to get data from StartAdmissionDetails and relevent table.
        /// Added by jiya
        /// Date: 07 Apr 2019
        /// </summary>
        /// <param name="SelectColumn"></param>
        /// <param name="SearchValue"></param>
        /// <param name="PageNo"></param>
        /// <param name="PageSize"></param>
        /// <param name="SortColumn"></param>
        /// <param name="SortOrder"></param>
        /// <returns></returns>
        public List <StartAdmissionModel> GetStartAdmissionDetailsWithPagingSorting(string SelectColumn, string SearchValue, int PageNo, int PageSize, string SortColumn, string SortOrder, int SchoolId, int GroupId)
        {
            List <StartAdmissionModel> StartAdmissionModelList = new List <StartAdmissionModel>();

            try
            {
                using (GEEDbContext context = new GEEDbContext())
                {
                    var P1 = new SqlParameter("@SelectColumn", SelectColumn);
                    var P2 = new SqlParameter("@SearchValue", SearchValue);
                    var P3 = new SqlParameter("@PageNo", PageNo);
                    var P4 = new SqlParameter("@PageSize", PageSize);
                    var P5 = new SqlParameter("@SortColumn", SortColumn);
                    var P6 = new SqlParameter("@SortOrder", SortOrder);
                    var P7 = new SqlParameter("@SchoolId", SchoolId);
                    var P8 = new SqlParameter("@GroupId", GroupId);
                    StartAdmissionModelList = context.Database.SqlQuery <StartAdmissionModel>("GetStartAdmissiondetails @SelectColumn, @SearchValue,@PageNo,@PageSize,@SortColumn,@SortOrder,@SchoolId,@GroupId", P1, P2, P3, P4, P5, P6, P7, P8).ToList();
                }
            }
            catch (Exception ex)
            {
                string str = ex.ToString();
            }
            return(StartAdmissionModelList);
        }
Example #5
0
        /// <summary>
        /// This method is used for get employee details with edution experince and ids data.
        /// Added by Jiya
        /// addedWehn 28 July 2019
        /// </summary>
        /// <param name="employeeMasterId"></param>
        /// <returns></returns>
        public EmployeeMasterModel GetEmployeeDetails(int employeeMasterId)
        {
            EmployeeMasterModel objEmployeeMasterModel = new EmployeeMasterModel();
            GEEDbContext        objGEEDbContext        = new GEEDbContext();
            var EmployeeData = objGEEDbContext.EmployeeMasters.Where(a => a.EmployeeMasterID == employeeMasterId).SingleOrDefault();

            objEmployeeMasterModel = Mapper.Map <EmployeeMasterModel>(EmployeeData);

            List <EmployeeEducationDetailModel> eduList = new List <EmployeeEducationDetailModel>();
            List <EmployeeExperienceModel>      expList = new List <EmployeeExperienceModel>();
            List <EmployeeIDdetailModel>        idList  = new List <EmployeeIDdetailModel>();
            var educationList = objGEEDbContext.EmployeeEducationDetails.Where(a => a.EmpCode == EmployeeData.EmployeeMasterID).ToList();

            foreach (var item in educationList)
            {
                eduList.Add(Mapper.Map <EmployeeEducationDetailModel>(item));
            }
            var experinceList = objGEEDbContext.EmployeeExperiences.Where(a => a.EmpCode == EmployeeData.EmployeeMasterID).ToList();

            foreach (var item2 in experinceList)
            {
                expList.Add(Mapper.Map <EmployeeExperienceModel>(item2));
            }

            var IdList = objGEEDbContext.EmployeeIDdetails.Where(a => a.EmpcodeID == EmployeeData.EmployeeMasterID).ToList();

            foreach (var item3 in IdList)
            {
                idList.Add(Mapper.Map <EmployeeIDdetailModel>(item3));
            }
            objEmployeeMasterModel.EmployeeEducationDetailModelList = eduList;
            objEmployeeMasterModel.EmployeeExperienceModelList      = expList;
            objEmployeeMasterModel.EmployeeIDdetailModelList        = idList;
            return(objEmployeeMasterModel);
        }
        public async Task <List <DocumentPortalModel> > FetchSelectedDocument(int category, int subCategory, int documentType, int userId, bool IsForAll)
        {
            List <DocumentPortalModel> documentList = new List <DocumentPortalModel>();
            GEEDbContext context = new GEEDbContext();

            var docList = (from ds in context.DocumentSubmissionDetails
                           join dt in context.DocumentTypes on ds.DocumentTypeID equals dt.DocumentTypeID
                           join ms in context.MasterTables on dt.DocumentCategoryID equals ms.MasterTable_id
                           join m in context.MasterTables on ms.Parent_id equals m.MasterTable_id
                           where  (m.MasterTable_id == category ||
                                   ms.MasterTable_id == subCategory ||
                                   dt.DocumentTypeID == documentType) && (IsForAll || ds.Enquiry_Id == userId)
                           select new
            {
                DocumentType = dt.DocumentTypeName,
                Subcategory = ms.Name,
                Category = m.Name,
                DigitalPath = ds.DigitalPathofDocument,
                PhysicalPath = ds.PhysicalFileLocaiton,
                Id = ds.DocumentSubmission_ID
            });

            foreach (var item in docList)
            {
                documentList.Add(Mapper.Map <DocumentPortalModel>(item));
            }
            return(documentList);
        }
        public async Task <CandidateDetailModel> GetCandidateDetailsByEnquiryId(int enquiryId)
        {
            GEEDbContext context          = new GEEDbContext();
            var          candidatedetails = context.CandidateDetails.Where(a => a.Enquiry_ID == enquiryId).FirstOrDefault();

            return(Mapper.Map <CandidateDetailModel>(candidatedetails));
        }
 /// <summary>
 /// This is for Update Application no and IsSubmited Prop
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 public ApplicationModel UpdateApplicationNo(ApplicationModel entity)
 {
     using (GEEDbContext context = new GEEDbContext())
     {
         Application application = context.Applications.Where(a => a.Enquiry_ID == entity.Enquiry_ID).FirstOrDefault();
         if (application != null)
         {
             //If isSubmitted false
             if (!entity.IsSubmitted)
             {
                 application.ApplicaitonNo       = entity.ApplicaitonNo;
                 application.ApplicationSoldDate = DateTime.Now;
             }
             else
             {
                 application.IsSubmitted = entity.IsSubmitted;
                 application.SubmitDate  = DateTime.Now;
             }
             context.Entry(application).State = EntityState.Modified;
             context.SaveChanges();
         }
     }
     return(new ApplicationModel {
         Application_ID = entity.Application_ID
     });
 }
        /// <summary>
        /// This method is used to get a data for popup and search text box auto lookup.
        /// </summary>
        /// <param name="objCandidateDetailModel"></param>
        /// <returns></returns>
        public List <CandidateDetailModel> GetPopupData(CandidateDetailModel objCandidateDetailModel)
        {
            GEEDbContext context       = new GEEDbContext();
            var          cadDetailList = (from candDet in context.CandidateDetails
                                          select candDet);

            //Sorting
            if (!(string.IsNullOrEmpty(objCandidateDetailModel.SortColumn) && string.IsNullOrEmpty(objCandidateDetailModel.SortOrder)))
            {
                cadDetailList = cadDetailList.OrderBy(objCandidateDetailModel.SortColumn + " " + objCandidateDetailModel.SortOrder);
            }
            //Search
            if (!string.IsNullOrEmpty(objCandidateDetailModel.SearchValue))
            {
                cadDetailList = cadDetailList.Where(m => m.FirstName.ToLower().Contains(objCandidateDetailModel.SearchValue.ToLower()) ||
                                                    m.Lastname.ToLower().Contains(objCandidateDetailModel.SearchValue.ToLower()) ||
                                                    m.FatheFirstName.ToLower().Contains(objCandidateDetailModel.SearchValue.ToLower()));
            }
            int recordsTotal = cadDetailList.Count();
            var data         = cadDetailList.Skip(objCandidateDetailModel.PageNo).Take(objCandidateDetailModel.PageSize).ToList();
            List <CandidateDetailModel> candidatedeModelList = new List <CandidateDetailModel>();

            foreach (var item in data)
            {
                candidatedeModelList.Add(Mapper.Map <CandidateDetailModel>(item));
            }
            if (candidatedeModelList.Count > 0)
            {
                candidatedeModelList[0].RowCount = recordsTotal;
            }
            return(candidatedeModelList);
        }
Example #10
0
        public int GetUserDetailByUserId(string id)
        {
            GEEDbContext objGEEDbContext = new GEEDbContext();
            var          UserData        = objGEEDbContext.AspNetUsers.Where(a => a.Id == id).FirstOrDefault();

            return(UserData.CUserId);
        }
Example #11
0
        /// <summary>
        /// Get user data based on cuser id.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public AspNetUserModel GetUserDetailById(int id)
        {
            GEEDbContext objGEEDbContext = new GEEDbContext();
            var          UserData        = objGEEDbContext.AspNetUsers.Where(a => a.CUserId == id).FirstOrDefault();

            return(Mapper.Map <AspNetUserModel>(UserData));
        }
        public List <NavigationMenuModel> GetMenuList(string userName, byte ActionID)
        {
            //GEEDbContext objGEEDbContext = new GEEDbContext();
            //var navMenuList = objGEEDbContext.NavigationMenu1.Where(a => a.NaviVisible == true);
            //List<NavigationMenuModel> listGetMenuModel = new List<NavigationMenuModel>();

            //using (GEEDbContext context = new GEEDbContext())
            //{
            //    var Param1 = new SqlParameter("@userName", userName);
            //    var Param2 = new SqlParameter("@ActionID", ActionID);
            //    listGetMenuModel = context.Database.SqlQuery<NavigationMenuModel>("GetMenu @userName, @ActionID", Param1, Param2).ToList();

            //}

            //return listGetMenuModel;
            GEEDbContext objGEEDbContext = new GEEDbContext();
            var          navMenuList     = objGEEDbContext.NavigationMenu1.Where(a => a.NaviVisible == true);
            List <NavigationMenuModel> listGetMenuModel = new List <NavigationMenuModel>();

            foreach (var item in navMenuList)
            {
                listGetMenuModel.Add(Mapper.Map <NavigationMenuModel>(item));
            }
            return(listGetMenuModel);
        }
Example #13
0
        /// <summary>
        /// Get All Subject Master Data
        /// </summary>
        /// <param name="objSubjectMasterTableModel"></param>
        /// <returns></returns>
        public List <SubjectMasterModel> GetAllSubjectMasterData(int pageNo, int pageSize, string sortOrder, string sortColumn)
        {
            List <SubjectMasterModel> getSubjectModelList = new List <SubjectMasterModel>();
            GEEDbContext context = new GEEDbContext();

            var masterTableData = (from subjectmstrTbl in context.SubjectMasters.Where(a => a.IsDeleted == false)
                                   select new
            {
                subjectmstrTbl.SubjectMaster_ID,
                subjectmstrTbl.SubjectType_Id,
                subjectmstrTbl.AssessmentStructure_ID,
                subjectmstrTbl.GradeStructure_ID,
                subjectmstrTbl.SubjectGroup_ID,
                subjectmstrTbl.Code,
                subjectmstrTbl.Name,
                subjectmstrTbl.Sessionyear,
                subjectmstrTbl.isOptional,
                subjectmstrTbl.IncludedInCGPA,
                subjectmstrTbl.ExculdedfromAtt,
                subjectmstrTbl.isScholastic
            });

            //Sorting
            if (!(string.IsNullOrEmpty(sortColumn) && string.IsNullOrEmpty(sortOrder)))
            {
                masterTableData = masterTableData.OrderBy(sortColumn + " " + sortOrder);
            }
            int recordsTotal = masterTableData.Count();
            var data         = masterTableData.Skip(pageNo).Take(pageSize).ToList();

            foreach (var item in data)
            {
                var master = context.MasterTables.Where(a => a.MasterTable_id == item.SubjectType_Id).FirstOrDefault();
                SubjectMasterModel objSubjectMasterModel = new SubjectMasterModel();
                objSubjectMasterModel.SubjectMaster_ID       = item.SubjectMaster_ID;
                objSubjectMasterModel.SubjectType_Id         = item.SubjectType_Id;
                objSubjectMasterModel.AssessmentStructure_ID = item.AssessmentStructure_ID;
                objSubjectMasterModel.GradeStructure_ID      = item.GradeStructure_ID;
                objSubjectMasterModel.SubjectType_Id         = item.SubjectType_Id;
                objSubjectMasterModel.Code                    = item.Code;
                objSubjectMasterModel.Name                    = item.Name;
                objSubjectMasterModel.IncludedInCGPA          = item.IncludedInCGPA;
                objSubjectMasterModel.ExculdedfromAtt         = item.ExculdedfromAtt;
                objSubjectMasterModel.isScholastic            = item.isScholastic;
                objSubjectMasterModel.isOptional              = item.isOptional;
                objSubjectMasterModel.AssessmentStructureName = item.AssessmentStructure_ID != null?context.MasterTables.Where(a => a.MasterTable_id == item.AssessmentStructure_ID).FirstOrDefault().Name : "";

                objSubjectMasterModel.GradeStructureName = item.GradeStructure_ID != null?context.MasterTables.Where(a => a.MasterTable_id == item.GradeStructure_ID).FirstOrDefault().Name : "";

                objSubjectMasterModel.SubjectTypeName = item.SubjectType_Id != null?context.MasterTables.Where(a => a.MasterTable_id == item.SubjectType_Id).FirstOrDefault().Name : "";

                objSubjectMasterModel.SubjectGroupName = item.SubjectGroup_ID != null?context.MasterTables.Where(a => a.MasterTable_id == item.GradeStructure_ID).FirstOrDefault().Name : "";

                getSubjectModelList.Add(objSubjectMasterModel);
            }
            getSubjectModelList[0].RowCount = recordsTotal;
            return(getSubjectModelList);
        }
        public async Task <List <DocumentPortalModel> > FetchPermittedDocument(int userId)
        {
            List <DocumentPortalModel>     documentList   = new List <DocumentPortalModel>();
            List <DocumentPermissionModel> permissionList = new List <DocumentPermissionModel>();
            List <int> categoryList     = new List <int>();
            List <int> subCategoryList  = new List <int>();
            List <int> documentTypeList = new List <int>();

            GEEDbContext context = new GEEDbContext();

            var permissions = (from dp in context.DocumentPermissions
                               where dp.IdType == userId
                               select dp);

            foreach (var item in permissions)
            {
                permissionList.Add(Mapper.Map <DocumentPermissionModel>(item));
            }
            foreach (var item in permissionList)
            {
                if (item.CategoryID.HasValue)
                {
                    categoryList.Add(item.CategoryID.Value);
                }
                if (item.SubCategoryID.HasValue)
                {
                    subCategoryList.Add(item.SubCategoryID.Value);
                }
                if (item.TypeID.HasValue)
                {
                    documentTypeList.Add(item.TypeID.Value);
                }
            }

            var docList = (from ds in context.DocumentSubmissionDetails
                           join dt in context.DocumentTypes on ds.DocumentTypeID equals dt.DocumentTypeID
                           join ms in context.MasterTables on dt.DocumentCategoryID equals ms.MasterTable_id
                           join m in context.MasterTables on ms.Parent_id equals m.MasterTable_id
                           where categoryList.Contains(m.MasterTable_id) ||
                           subCategoryList.Contains(ms.MasterTable_id) ||
                           categoryList.Contains(dt.DocumentTypeID)
                           select new
            {
                DocumentType = dt.DocumentTypeName,
                Subcategory = ms.Name,
                Category = m.Name,
                DigitalPath = ds.DigitalPathofDocument,
                PhysicalPath = ds.PhysicalFileLocaiton,
                Id = ds.DocumentSubmission_ID
            });

            foreach (var item in docList)
            {
                documentList.Add(Mapper.Map <DocumentPortalModel>(item));
            }
            return(documentList);
        }
Example #15
0
        /// <summary>
        /// This methoda is used for update is deleted column
        /// Added by Jiya
        /// addedWehn 28 July 2019
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>

        public int DeleteEmployeeDetails(EmployeeMasterModel entity)
        {
            GEEDbContext objGEEDbContext = new GEEDbContext();
            var          EmployeeData    = objGEEDbContext.EmployeeMasters.Where(a => a.EmployeeMasterID == entity.EmployeeMasterID).SingleOrDefault();

            EmployeeData.Modifiedby_ID = entity.ModifiedBy_ID;
            EmployeeData.ModifiedDate  = DateTime.Now;
            EmployeeData.IsDeleted     = true;
            objGEEDbContext.Entry(EmployeeData).State = System.Data.Entity.EntityState.Modified;
            return(objGEEDbContext.SaveChanges());
        }
        public List <IndexScreenDetailModel> GetAllIncludeSearch(int menuId)
        {
            GEEDbContext objGEEDbContext = new GEEDbContext();
            var          IndexScreenDetailDataAccessList             = objGEEDbContext.IndexScreenDetails.Where(a => a.Nav_menu_ID == menuId).OrderBy(a => a.Sequence);
            List <IndexScreenDetailModel> IndexScreenDetailModelList = new List <IndexScreenDetailModel>();

            foreach (var item in IndexScreenDetailDataAccessList)
            {
                IndexScreenDetailModelList.Add(Mapper.Map <IndexScreenDetailModel>(item));
            }
            return(IndexScreenDetailModelList);
        }
Example #17
0
        public List <GetMenuModel> GetMenuList(string userName, byte ActionID)
        {
            GEEDbContext        objGEEDbContext  = new GEEDbContext();
            var                 navMenuList      = objGEEDbContext.NavigationMenu1.Where(a => a.NaviVisible == true);
            List <GetMenuModel> listGetMenuModel = new List <GetMenuModel>();

            foreach (var item in navMenuList)
            {
                listGetMenuModel.Add(Mapper.Map <GetMenuModel>(item));
            }
            return(listGetMenuModel);
        }
Example #18
0
        /// <summary>
        /// This method is used to get Master data to bind datagrid table
        /// Added by Jiya
        /// Date: 30 April 2019
        /// </summary>
        /// <param name="pageNo"></param>
        /// <param name="pageSize"></param>
        /// <param name="sortOrder"></param>
        /// <param name="sortColumn"></param>
        /// <returns></returns>
        public List <MasterTableModel> GetAllMasterData(MasterTableModel objMasterTableModel)
        {
            List <MasterTableModel> getMasterTableModelList = new List <MasterTableModel>();

            GEEDbContext context = new GEEDbContext();


            var masterTableData = (from mstTbl in context.MasterTables
                                   join mng in context.MasterTables on mstTbl.Parent_id equals mng.MasterTable_id into tempJoin
                                   from t2 in tempJoin.DefaultIfEmpty()
                                   where mstTbl.ISDeleted != true && mstTbl.Mastertabletype_id == objMasterTableModel.Mastertabletype_id
                                   select new {
                mstTbl.MasterTable_id,
                mstTbl.Mastertabletype_id,
                mstTbl.Code,
                mstTbl.Name,
                mstTbl.Parent_id,
                mstTbl.Remark,
                mstTbl.Sessionyear,
                mstTbl.IsDefault,
                ParentName = (t2.Name == null ? String.Empty : t2.Name),
                DefaultValue = mstTbl.IsDefault == true ? "Yes" : "No"
            });


            //Sorting
            if (!(string.IsNullOrEmpty(objMasterTableModel.SortColumn) && string.IsNullOrEmpty(objMasterTableModel.SortOrder)))
            {
                masterTableData = masterTableData.OrderBy(objMasterTableModel.SortColumn + " " + objMasterTableModel.SortOrder);
            }
            int recordsTotal = masterTableData.Count();
            var data         = masterTableData.Skip(objMasterTableModel.PageNo).Take(objMasterTableModel.PageSize).ToList();

            foreach (var item in data)
            {
                MasterTableModel objMasterModel = new MasterTableModel();
                objMasterModel.MasterTable_id     = item.MasterTable_id;
                objMasterModel.Mastertabletype_id = item.Mastertabletype_id;
                objMasterModel.Code         = item.Code;
                objMasterModel.Name         = item.Name;
                objMasterModel.Parent_id    = item.Parent_id;
                objMasterModel.Remark       = item.Remark;
                objMasterModel.Sessionyear  = item.Sessionyear;
                objMasterModel.IsDefault    = item.IsDefault;
                objMasterModel.ParentName   = item.ParentName;
                objMasterModel.DefaultValue = item.DefaultValue;
                objMasterModel.RowCount     = recordsTotal;
                getMasterTableModelList.Add(objMasterModel);
            }

            return(getMasterTableModelList);
        }
        public async Task <List <DocumentPermissionModel> > GetDocumentPermission(int userId)
        {
            List <DocumentPermissionModel> permissionList = new List <DocumentPermissionModel>();
            GEEDbContext context = new GEEDbContext();

            var docList = (from dp in context.DocumentPermissions
                           where dp.IdType == userId
                           select dp);

            foreach (var item in docList)
            {
                permissionList.Add(Mapper.Map <DocumentPermissionModel>(item));
            }
            return(permissionList);
        }
Example #20
0
        /// <summary>
        /// Get All RoomMaster Data
        /// </summary>
        /// <param name="objBookMasterTableModel"></param>
        /// <returns></returns>
        public List <BookMasterViewModel> GetAllBookMasterData(BookMasterViewModel objBookMasterModel)
        {
            List <BookMasterViewModel> getRoomMasterTableModelList = new List <BookMasterViewModel>();

            GEEDbContext context = new GEEDbContext();


            var _roomMasterTableData = (from mstTbl in context.BookMasters
                                        where mstTbl.IsDeleted != true
                                        select new
            {
                mstTbl.BookMaster_Id,
                mstTbl.Code,
                mstTbl.name,
                mstTbl.Publisher,
                mstTbl.ISBN,
                mstTbl.MRP,
                mstTbl.Version,
                mstTbl.Discount
            });


            //Sorting
            if (!(string.IsNullOrEmpty(objBookMasterModel.SortColumn) && string.IsNullOrEmpty(objBookMasterModel.SortOrder)))
            {
                _roomMasterTableData = _roomMasterTableData.OrderBy(objBookMasterModel.SortColumn + " " + objBookMasterModel.SortOrder);
            }
            int recordsTotal = _roomMasterTableData.Count();
            var data         = _roomMasterTableData.Skip(objBookMasterModel.PageNo).Take(objBookMasterModel.PageSize).ToList();

            foreach (var item in data)
            {
                BookMasterViewModel objBookMaster = new BookMasterViewModel();
                objBookMaster.BookMaster_Id = item.BookMaster_Id;
                objBookMaster.Code          = item.Code;
                objBookMaster.name          = item.name;
                objBookMaster.Publisher     = item.Publisher;
                objBookMaster.ISBN          = item.ISBN;
                objBookMaster.MRP           = item.MRP;
                objBookMaster.Version       = item.Version;
                objBookMaster.Discount      = item.Discount;

                objBookMaster.RowCount = recordsTotal;
                getRoomMasterTableModelList.Add(objBookMaster);
            }

            return(getRoomMasterTableModelList);
        }
        public List <AssessmentStructureAssessmentTypeMappingModel> GetAllAssessmentStructureWithASId(int Id)
        {
            GEEDbContext context = new GEEDbContext();

            var _data = context.AssessmentStructureAssessmentTypeMappings.Where(w => w.AssessmentStructureID == Id && w.IsDeleted == false);
            List <AssessmentStructureAssessmentTypeMappingModel> AssessmentStructureAssessmentTypeMappingModellList = new List <AssessmentStructureAssessmentTypeMappingModel>();

            if (_data != null && _data.Count() > 0)
            {
                foreach (var item in _data)
                {
                    AssessmentStructureAssessmentTypeMappingModellList.Add(Mapper.Map <AssessmentStructureAssessmentTypeMappingModel>(item));
                }
            }
            return(AssessmentStructureAssessmentTypeMappingModellList);
        }
Example #22
0
        /// <summary>
        /// This methoda is used for sav the employee details with education experince and ids.
        /// Added by Jiya
        /// addedWehn 28 July 2019
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public int UpdateEmployeeDetails(EmployeeDetailsSaveSchemaModel entity)
        {
            int returnValue = 0;

            using (GEEDbContext context = new GEEDbContext())
            {
                var P1 = new SqlParameter("@EmployeeDetailsXML", entity.EmployeeDetailsXML);
                var P2 = new SqlParameter("@EducationItemXML", entity.EducationItemXML);
                var P3 = new SqlParameter("@ExperinceItemXML", entity.ExperinceItemXML);
                var P4 = new SqlParameter("@EmployeeIdItemXML", entity.EmployeeIdItemXML);
                var P5 = new SqlParameter("@modifiedBy", entity.ModifiedBy);
                var P6 = new SqlParameter("@EmployeeMasterID", entity.EmployeeMasterID);
                returnValue = context.Database.ExecuteSqlCommand("InsertEmployeeDetails @EmployeeDetailsXML, @EducationItemXML,@ExperinceItemXML,@EmployeeIdItemXML,@modifiedBy,EmployeeMasterID", P1, P2, P3, P4, P5, P6);
            }
            return(returnValue);
        }
 /// <summary>
 /// This is for Update Registration no and IsSubmitedDate Prop
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 public RegistrationModel UpdateRegistrationNo(RegistrationModel entity)
 {
     using (GEEDbContext context = new GEEDbContext())
     {
         Registration registration = context.Registrations.Where(a => a.Enquiry_ID == entity.Enquiry_ID).FirstOrDefault();
         if (registration != null)
         {
             registration.RegistrationNo = entity.RegistrationNo;
             registration.IsSubmitedDate = DateTime.Now;
         }
         context.Entry(registration).State = EntityState.Modified;
         context.SaveChanges();
         return(new RegistrationModel {
             Registration_ID = entity.Registration_ID
         });
     }
 }
        /// <summary>
        /// Get All AssessmentType Data
        /// </summary>
        /// <param name="objAssessmentTypeModel"></param>
        /// <returns></returns>
        public List <AssessmentTypeViewModel> GetAllAssessmentTypeData(AssessmentTypeViewModel objAssessmentTypeModel)
        {
            List <AssessmentTypeViewModel> getAssessmentTypeModelList = new List <AssessmentTypeViewModel>();

            GEEDbContext context = new GEEDbContext();


            var _assessmentTypeData = (from mstTbl in context.AssessmentTYPEs
                                       //join mng in context.MasterTables on mstTbl.AssessmentGroup_ID equals mng.MasterTable_id
                                       where mstTbl.IsDeleted != true
                                       select new
            {
                mstTbl.AssessmentType_Id,
                mstTbl.AssessmentType_code,
                mstTbl.AssessmentType_Name,
                mstTbl.MinMarks,
                mstTbl.MaxMarks,
                mstTbl.PassingMarks,
                mstTbl.Weightage
            });


            //Sorting
            if (!(string.IsNullOrEmpty(objAssessmentTypeModel.SortColumn) && string.IsNullOrEmpty(objAssessmentTypeModel.SortOrder)))
            {
                _assessmentTypeData = _assessmentTypeData.OrderBy(objAssessmentTypeModel.SortColumn + " " + objAssessmentTypeModel.SortOrder);
            }
            int recordsTotal = _assessmentTypeData.Count();
            var data         = _assessmentTypeData.Skip(objAssessmentTypeModel.PageNo).Take(objAssessmentTypeModel.PageSize).ToList();

            foreach (var item in data)
            {
                AssessmentTypeViewModel objMasterModel = new AssessmentTypeViewModel();
                objMasterModel.AssessmentType_Id   = item.AssessmentType_Id;
                objMasterModel.AssessmentType_code = item.AssessmentType_code;
                objMasterModel.AssessmentType_Name = item.AssessmentType_Name;
                objMasterModel.MinMarks            = item.MinMarks;
                objMasterModel.MaxMarks            = item.MaxMarks;
                objMasterModel.PassingMarks        = item.PassingMarks;
                objMasterModel.Weightage           = item.Weightage;
                objMasterModel.RowCount            = recordsTotal;
                getAssessmentTypeModelList.Add(objMasterModel);
            }

            return(getAssessmentTypeModelList);
        }
        /// <summary>
        /// Get All stop Master Data
        /// </summary>
        /// <param name="objStopMasterTableModel"></param>
        /// <returns></returns>
        public List <StopMasterModel> GetAllStopMasterData(int pageNo, int pageSize, string sortOrder, string sortColumn)
        {
            List <StopMasterModel> getstopModelList = new List <StopMasterModel>();
            GEEDbContext           context          = new GEEDbContext();

            var masterTableData = (from stopmstrTbl in context.StopMasters.Where(a => a.IsDeleted == false)
                                   select new
            {
                stopmstrTbl.StopMasterID,
                stopmstrTbl.StopCode,
                stopmstrTbl.StopName,
                stopmstrTbl.Locality,
                stopmstrTbl.StopAddress,
                stopmstrTbl.PinCode,
                stopmstrTbl.GeoCoordinates,
                stopmstrTbl.Sessionyear,
            });

            //Sorting
            if (!(string.IsNullOrEmpty(sortColumn) && string.IsNullOrEmpty(sortOrder)))
            {
                masterTableData = masterTableData.OrderBy(sortColumn + " " + sortOrder);
            }
            int recordsTotal = masterTableData.Count();
            var data         = masterTableData.Skip(pageNo).Take(pageSize).ToList();

            foreach (var item in data)
            {
                StopMasterModel stopmstrTbl = new StopMasterModel();
                stopmstrTbl.StopMasterID   = item.StopMasterID;
                stopmstrTbl.StopCode       = item.StopCode;
                stopmstrTbl.StopName       = item.StopName;
                stopmstrTbl.Locality       = item.Locality;
                stopmstrTbl.StopAddress    = item.StopAddress;
                stopmstrTbl.PinCode        = item.PinCode;
                stopmstrTbl.GeoCoordinates = item.GeoCoordinates;
                stopmstrTbl.Sessionyear    = item.Sessionyear;
                getstopModelList.Add(stopmstrTbl);
            }
            if (getstopModelList.Count > 0)
            {
                getstopModelList[0].RowCount = recordsTotal;
            }
            return(getstopModelList);
        }
        /// <summary>
        /// Get All ClassMaster Data
        /// </summary>
        /// <param name="objClassMasterTableModel"></param>
        /// <returns></returns>
        public List <ClassMasterViewModel> GetAllClassMasterData(ClassMasterViewModel objClassMasterTableModel)
        {
            List <ClassMasterViewModel> getClassMasterTableModelList = new List <ClassMasterViewModel>();

            GEEDbContext context = new GEEDbContext();


            var _classMasterTableData = (from mstTbl in context.ClassMasters
                                         join mng in context.MasterTables on mstTbl.ClassClassification_Id equals mng.MasterTable_id
                                         where mstTbl.IsDeleted != true
                                         select new
            {
                mstTbl.ClassMaster_ID,
                mstTbl.Code,
                mstTbl.Name,
                mstTbl.Sequence,
                mstTbl.TotalSections,
                ClassClassification = mng.Name
            });


            //Sorting
            if (!(string.IsNullOrEmpty(objClassMasterTableModel.SortColumn) && string.IsNullOrEmpty(objClassMasterTableModel.SortOrder)))
            {
                _classMasterTableData = _classMasterTableData.OrderBy(objClassMasterTableModel.SortColumn + " " + objClassMasterTableModel.SortOrder);
            }
            int recordsTotal = _classMasterTableData.Count();
            var data         = _classMasterTableData.Skip(objClassMasterTableModel.PageNo).Take(objClassMasterTableModel.PageSize).ToList();

            foreach (var item in data)
            {
                ClassMasterViewModel objMasterModel = new ClassMasterViewModel();
                objMasterModel.ClassMaster_ID      = item.ClassMaster_ID;
                objMasterModel.ClassClassification = item.ClassClassification;
                objMasterModel.Code          = item.Code;
                objMasterModel.Name          = item.Name;
                objMasterModel.Sequence      = item.Sequence;
                objMasterModel.TotalSections = item.TotalSections;
                objMasterModel.RowCount      = recordsTotal;
                getClassMasterTableModelList.Add(objMasterModel);
            }

            return(getClassMasterTableModelList);
        }
Example #27
0
        public CityStateCountryModel GetStateByCity(int CityId)
        {
            CityStateCountryModel stateCountryModel = new CityStateCountryModel();

            try
            {
                using (GEEDbContext context = new GEEDbContext())
                {
                    var P1 = new SqlParameter("@CityId", CityId);

                    stateCountryModel = context.Database.SqlQuery <CityStateCountryModel>("GetStateCountyByCity @CityId", P1).FirstOrDefault();
                }
            }
            catch (Exception ex)
            {
                string str = ex.ToString();
            }
            return(stateCountryModel);
        }
        /// <summary>
        /// This method is used for get user permission to user.
        /// </summary>
        /// <param name="userID"></param>
        /// <param name="menuId"></param>
        /// <returns></returns>
        public List <NavigationPermissionModel> GetNavigationPermission(int userGroupId, int menuId)
        {
            List <NavigationPermissionModel> getNavigationPermissionModelList = new List <NavigationPermissionModel>();

            try
            {
                using (GEEDbContext context = new GEEDbContext())
                {
                    var UId = new SqlParameter("@UserGroupID", userGroupId);
                    var MId = new SqlParameter("@NavigationId", menuId);

                    getNavigationPermissionModelList = context.Database.SqlQuery <NavigationPermissionModel>("GetNavigationPermission @UserGroupID, @NavigationId", UId, MId).ToList();
                }
            }
            catch (Exception ex)
            {
                string str = ex.ToString();
            }
            return(getNavigationPermissionModelList);
        }
        /// <summary>
        /// check application is sold = true against EnquiryId
        /// </summary>
        /// <param name="enquiryId"></param>
        /// <returns></returns>
        public bool GetIsApplicationSold(int enquiryId)
        {
            bool isAppSoldResult = false;

            try
            {
                using (GEEDbContext context = new GEEDbContext())
                {
                    var objApplication = context.Applications.Where(a => a.Enquiry_ID == enquiryId).FirstOrDefault();
                    if (objApplication != null)
                    {
                        isAppSoldResult = (bool)objApplication.Applicationsold;
                    }
                }
            }
            catch (Exception ex)
            {
                string str = ex.ToString();
            }
            return(isAppSoldResult);
        }
        /// <summary>
        /// Delete
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool DeActivate(int id)
        {
            bool isDelete = false;

            try
            {
                GEEDbContext objGEEDbContext = new GEEDbContext();
                var          UserData        = objGEEDbContext.AssessmentStructureAssessmentTypeMappings.Where(a => a.AssessmentStructureAssessmentTypeMapping_Id == id).FirstOrDefault();
                UserData.IsDeleted = true;
                objGEEDbContext.Entry(UserData).State = System.Data.Entity.EntityState.Modified;
                //objGEEDbContext.Entry(UserData).Property(x => x.CUserId).IsModified = false;
                if (objGEEDbContext.SaveChanges() > 0)
                {
                    isDelete = true;
                }
            }
            catch (Exception)
            {
                isDelete = false;
            }
            return(isDelete);
        }