public Response Update_tbAttendance(AttendanceCustomModel objModel)
        {
            DateTime DateCheck = objModel.AttendanceDate.Add(new TimeSpan(5, 30, 0));

            using (response = new Response())
            {
                using (dbcontext = new SchoolManagementEntities())
                {
                    try
                    {
                        tblAttendance cmd = dbcontext.tblAttendances.FirstOrDefault(x =>
                                                                                    x.IsDeleted == false && x.AdmissionId == objModel.AdmissionId &&
                                                                                    x.AttendanceDate.Year == DateCheck.Year &&
                                                                                    x.AttendanceDate.Month == DateCheck.Month &&
                                                                                    x.AttendanceDate.Day == DateCheck.Day &&
                                                                                    x.SectionId == objModel.SectionId
                                                                                    );
                        if (cmd != null)
                        {
                            cmd.Attendance = objModel.Attendance;
                            dbcontext.SaveChanges();
                            response.message = "Record Updated Successfully!!";
                        }
                        return(response);
                    }
                    catch (Exception ex)
                    {
                        response.success = false;
                        response.message = ex.Message;
                        return(response);
                    }
                }
            }
        }
 public Response GetAttendanceListing(AttendanceCustomModel objModel)
 {
     using (response = new Response())
     {
         using (dbcontext = new SchoolManagementEntities())
         {
             try
             {
                 response.success = true;
                 var rs = dbcontext.USP_GetAttendanceDetail(objModel.SectionId, objModel.AttendanceDate).ToList();
                 if (rs.Count > 0)
                 {
                     //return rs;
                     response.message      = "Update";
                     response.responseData = rs;
                 }
                 else
                 {
                     var rs2 = dbcontext.USP_BindStudentWithClassAndSection(objModel.SessionId, objModel.ClassId, objModel.SectionId, "").ToList();
                     //return rs2;
                     response.message      = "Insert";
                     response.responseData = rs2;
                 }
                 return(response);
             }
             catch (Exception ex)
             {
                 response.success = false;
                 response.message = ex.Message;
                 return(response);
             }
         }
         //return response;
     }
 }
        public object BindSessionClassEnquiry(int?SessionId, int?ClassId, int?SectionId, string StudentName)
        {
            List <EnquiryDetailCustomModel> objListModel = new List <EnquiryDetailCustomModel>();

            using (response = new Response())
            {
                using (dbcontext = new SchoolManagementEntities())
                {
                    try
                    {
                        response.success = true;
                        //  -------------- Main -----------------
                        objListModel = (from P in dbcontext.tblPromoteToClasses
                                        join A in dbcontext.tblAdmissions on P.AdmissionId equals A.AdmissionId
                                        join E in dbcontext.tblEnquiryDetails on A.EnquiryId equals E.EnquiryId
                                        where E.IsDeleted == false && E.Status == "Registered" &&
                                        P.IsActive == true &&
                                        (SessionId == null || SessionId == 0 || P.SessionId == SessionId) &&
                                        (ClassId == null || ClassId == 0 || P.ClassId == ClassId) &&
                                        (SectionId == null || SectionId == 0 || P.SectionId == SectionId)
                                        select new EnquiryDetailCustomModel
                        {
                            SessionId = P.SessionId,
                            SessionName = P.SessionId != null ? P.tblSession.Session : "",
                            ClassId = P.ClassId,
                            ClassName = P.ClassId != null ? P.tblClass.Title : "",
                            SectionId = P.SectionId,
                            SectionName = P.SectionId != null ? P.tblSection.Title : "",
                            //AdmissionId = P.AdmissionId,
                            AdmissionModel = dbcontext.tblAdmissions.Where(a => a.EnquiryId == E.EnquiryId).Select(s => new AdmissionCustomModel
                            {
                                AdmissionId = s.AdmissionId,
                                AdmissionDate = s.AdmissionDate,
                                TotalFees = s.TotalFees,
                                RegistrationFees = s.RegistrationFees,
                                DiscountType = s.DiscountType,
                                DiscountAmount = s.DiscountAmount,
                                FeeIncharge = s.FeeIncharge,
                                BalanceAmountDue = s.BalanceAmountDue,
                                PaymentMode = s.PaymentMode
                            }).FirstOrDefault(),

                            FName = E.FName,
                            LName = E.LName,
                            MobileNo = E.MobileNo,
                            EmailId = E.EmailId,
                        }).ToList();
                        // -------------- Main End -----------------

                        return(objListModel);
                    }
                    catch (Exception ex)
                    {
                        response.success = false;
                        response.message = ex.Message;
                        return(response);
                    }
                }
            }
        }
        public object GetEnquiryId(int AdmissionId)
        {
            StudentCommonDetail objResult = new StudentCommonDetail();

            using (response = new Response())
            {
                using (dbcontext = new SchoolManagementEntities())
                {
                    try
                    {
                        objResult = dbcontext.GetEnquiryIdFromAdmissionId(AdmissionId)
                                    .Select(x => new StudentCommonDetail
                        {
                            EnquiryId = x.EnquiryId,
                            SessionId = x.SessionId,
                            ClassId   = x.ClassId,
                            SectionId = x.SectionId
                        }).FirstOrDefault();
                    }
                    catch (Exception ex)
                    {
                        dbcontext.Dispose();
                        throw ex;
                    }
                }
                return(objResult);
            }
        }
Exemplo n.º 5
0
        public int GetTotalStudentInSection(int?SessionId, int?ClassId, int?SectionId)
        {
            int TotalStudent = 0;

            using (response = new Response())
            {
                using (dbcontext = new SchoolManagementEntities())
                {
                    try
                    {
                        response.success = true;
                        TotalStudent     = dbcontext.tblPromoteToClasses.Where(x => x.IsDeleted == false &&
                                                                               (SessionId == null || SessionId == 0 || x.SessionId == SessionId) &&
                                                                               (ClassId == null || ClassId == 0 || x.ClassId == ClassId) &&
                                                                               (SectionId == null || SectionId == 0 || x.SectionId == SectionId)
                                                                               ).Count();
                    }
                    catch (Exception ex)
                    {
                        response.success = false;
                        response.message = ex.Message;
                        TotalStudent     = 0;
                    }
                }
            }
            return(TotalStudent);
        }
Exemplo n.º 6
0
        public int CancelAllocatedStudentSection(int Id)
        {
            int Result = 0;

            using (response = new Response())
            {
                using (dbcontext = new SchoolManagementEntities())
                {
                    try
                    {
                        response.success = true;
                        var rs = dbcontext.tblPromoteToClasses.FirstOrDefault(x => x.PromoteToClassId == Id);
                        if (rs != null)
                        {
                            rs.SectionId = null;
                            rs.RollNo    = null;
                            rs.Status    = null;
                        }
                        dbcontext.SaveChanges();
                        Result = 1;
                    }
                    catch (Exception ex)
                    {
                        response.success = false;
                        response.message = ex.Message;
                        Result           = 0;
                    }
                }
            }
            return(Result);
        }
Exemplo n.º 7
0
        public EmployeeMasterCustomModel GetById(int Id)
        {
            EmployeeMasterCustomModel objListModel = new EmployeeMasterCustomModel();

            using (response = new Response())
            {
                using (dbcontext = new SchoolManagementEntities())
                {
                    try
                    {
                        response.success = true;
                        objListModel     = dbcontext.tblEmployees.Where(x => x.IsDeleted == false && x.EmployeeId == Id)
                                           .Select(x => new EmployeeMasterCustomModel
                        {
                            EmployeeId    = x.EmployeeId,
                            FName         = x.FName,
                            LName         = x.LName,
                            EmailId       = x.EmailId,
                            MobileNo      = x.MobileNo,
                            City          = x.City,
                            State         = x.State,
                            Country       = x.Country,
                            Address       = x.Address,
                            Address2      = x.Address2,
                            BloodGroup    = x.BloodGroup,
                            DateOfBirth   = x.DateOfBirth,
                            DateOfJoining = x.DateOfJoining,
                            Designation   = x.Designation,
                            Experience    = x.Experience,
                            Qualification = x.Qualification,
                            SchoolId      = x.SchoolId,
                            DDate         = x.DDate,
                            Image         = x.Image,
                            IsActive      = x.IsActive,
                            IsDeleted     = x.IsDeleted,
                            CreatedBy     = x.CreatedBy,
                            CreatedDate   = x.CreatedDate,
                            ModifiedBy    = x.ModifiedBy,
                            ModifiedDate  = x.ModifiedDate
                        }).SingleOrDefault();
                    }
                    catch (Exception ex)
                    {
                        response.success = false;
                        response.message = ex.Message;
                        objListModel     = null;
                    }
                }
            }
            return(objListModel);
        }
Exemplo n.º 8
0
        public List <EmployeeMasterModel> GetEmployeeMaster()
        {
            using (dbcontext = new SchoolManagementEntities())
            {
                var rs = dbcontext.tblEmployees.Where(x => x.IsActive == true &&
                                                      x.IsDeleted == false).OrderBy(y => y.FName)
                         .Select(x => new EmployeeMasterModel
                {
                    EmployeeId   = x.EmployeeId,
                    EmployeeName = x.FName + " " + x.LName,
                }).ToList();

                return(rs);
            }
        }
Exemplo n.º 9
0
        public object GetFeeCollectionListing(FeeCollectionCustomModel objModel)
        {
            IList <FeeCollectionCustomModel>      FeeListModel  = new List <FeeCollectionCustomModel>();
            IQueryable <FeeCollectionCustomModel> FeeListDetail = null;
            int TotalRec = 0;

            using (response = new Response())
            {
                using (dbcontext = new SchoolManagementEntities())
                {
                    try
                    {
                        response.success = true;
                        FeeListDetail    = dbcontext.tblFeeCollections.Where(x => x.IsDeleted == false)
                                           .Select(x => new FeeCollectionCustomModel
                        {
                            FeeCollectionId = x.FeeCollectionId,
                            SchoolId        = x.SchoolId,
                            EnquiryId       = x.EnquiryId,
                            AdmissionId     = x.AdmissionId,
                            AmountPaid      = x.AmountPaid,
                            FeeMode         = x.FeeMode,
                            FeeDate         = x.FeeDate,
                            FeeInCharge     = x.FeeInCharge,
                            FeeType         = x.FeeType,

                            IsActive     = x.IsActive,
                            IsDeleted    = x.IsDeleted,
                            CreatedBy    = x.CreatedBy,
                            CreatedDate  = x.CreatedDate,
                            ModifiedBy   = x.ModifiedBy,
                            ModifiedDate = x.ModifiedDate
                        }).OrderByDescending(x => x.FeeCollectionId);

                        TotalRec     = FeeListDetail.Count();
                        FeeListModel = FeeListDetail.ToList() as IList <FeeCollectionCustomModel>;

                        return(FeeListModel);
                    }
                    catch (Exception ex)
                    {
                        response.success = false;
                        response.message = ex.Message;
                        return(response);
                    }
                }
            }
        }
Exemplo n.º 10
0
        public int InsertStudentSectionAllocation(int SessionId, int ClassId, int EnquiryId, int AdmissionId, int SectionId, bool isactive, string status)
        {
            int TotalStudent = 0;

            using (response = new Response())
            {
                using (dbcontext = new SchoolManagementEntities())
                {
                    try
                    {
                        response.success = true;
                        tblPromoteToClass obj = new tblPromoteToClass();
                        if (obj != null)
                        {
                            obj.AdmissionId = AdmissionId;
                            obj.SectionId   = SectionId;
                            obj.IsActive    = isactive;
                            obj.Status      = status;
                            dbcontext.tblPromoteToClasses.Add(obj);
                            dbcontext.SaveChanges();

                            tblEnquiryDetail obj1 = dbcontext.tblEnquiryDetails.Where(x => x.EnquiryId == EnquiryId).FirstOrDefault();
                            if (obj1 != null)
                            {
                                obj1.SectionId = SectionId;
                                dbcontext.SaveChanges();
                            }

                            tblAdmission obj2 = dbcontext.tblAdmissions.Where(x => x.AdmissionId == AdmissionId).FirstOrDefault();
                            if (obj2 != null)
                            {
                                obj2.InSectionStatus = status;
                                dbcontext.SaveChanges();
                            }
                        }

                        TotalStudent = 1;
                    }
                    catch (Exception ex)
                    {
                        response.success = false;
                        response.message = ex.Message;
                        TotalStudent     = 0;
                    }
                }
            }
            return(TotalStudent);
        }
Exemplo n.º 11
0
        public List <ClassMasterModel> BindSessionClass(int SessionId)
        {
            using (dbcontext = new SchoolManagementEntities())
            {
                var rs = dbcontext.tblClasses.Where(x => x.IsActive == true &&
                                                    x.IsDeleted == false &&
                                                    (SessionId == 0 || x.SessionId == SessionId)).OrderBy(y => y.Title)
                         .Select(x => new ClassMasterModel
                {
                    ClassId = x.ClassId,
                    Title   = x.Title,
                }).ToList();

                return(rs);
            }
        }
Exemplo n.º 12
0
        public List <SectionMasterModel> BindClassSection(int ClassId)
        {
            using (dbcontext = new SchoolManagementEntities())
            {
                var rs = dbcontext.tblSections.Where(x => x.IsActive == true &&
                                                     x.IsDeleted == false &&
                                                     (ClassId == 0 || x.ClassId == ClassId)).OrderBy(y => y.Title)
                         .Select(x => new SectionMasterModel
                {
                    SectionId = x.SectionId,
                    Title     = x.Title,
                }).ToList();

                return(rs);
            }
        }
        public Response UpdatePassword(ChangePasswordCustomModel objModel)
        {
            using (response = new Response())
            {
                using (dbcontext = new SchoolManagementEntities())
                {
                    try
                    {
                        response.success = true;
                        var rs = dbcontext.tblUserLogins.FirstOrDefault(x => x.IsDeleted == false && x.UserName == objModel.UserName);
                        if (rs != null)
                        {
                            var objUpdate = dbcontext.tblUserLogins.FirstOrDefault(m => m.IsDeleted == false && m.Password == objModel.Password);
                            if (objUpdate != null)
                            {
                                objUpdate.Password = objModel.NewPassword;

                                objUpdate.ModifiedBy   = objModel.ModifiedBy;
                                objUpdate.ModifiedDate = DateTime.Now;
                                dbcontext.SaveChanges();
                                response.responseData = new { SectionId = objUpdate.Id };
                                response.success      = true;
                                response.message      = "1";
                            }
                            else
                            {
                                response.success = false;
                                response.message = "2";
                            }
                        }
                        else
                        {
                            response.success = false;
                            response.message = "3";
                        }

                        return(response);
                    }
                    catch (Exception ex)
                    {
                        response.success = false;
                        response.message = ex.Message;
                        return(response);
                    }
                }
            }
        }
Exemplo n.º 14
0
        public int?GetSessionID()
        {
            int?intSessionId = null;

            using (dbcontext = new SchoolManagementEntities())
            {
                try
                {
                    intSessionId = (from obj in dbcontext.tblSessions.Where(x => x.IsActive == true && x.IsDefault == true)
                                    select obj.SessionId).Take(1).SingleOrDefault();
                }
                catch (Exception ex)
                {
                }
                return(intSessionId);
            }
        }
Exemplo n.º 15
0
 public object GetFeeCollectionReceiptDetail(int ReceiptId, int?AdmissionId)
 {
     using (response = new Response())
     {
         using (dbcontext = new SchoolManagementEntities())
         {
             try
             {
                 return(dbcontext.USP_FeeCollectionReceipt(ReceiptId, AdmissionId).FirstOrDefault());
             }
             catch (Exception ex)
             {
                 dbcontext.Dispose();
                 throw ex;
             }
         }
     }
 }
Exemplo n.º 16
0
 public object GetStudentFeeDetail(int AdmissionId, int?ClassId, int?SectionId)
 {
     using (response = new Response())
     {
         using (dbcontext = new SchoolManagementEntities())
         {
             try
             {
                 return(dbcontext.USP_GetFeeCollectionDetail(AdmissionId, ClassId, SectionId).ToList());
             }
             catch (Exception ex)
             {
                 dbcontext.Dispose();
                 throw ex;
             }
         }
     }
 }
Exemplo n.º 17
0
        public FeeCollectionCustomModel GetById(int Id)
        {
            FeeCollectionCustomModel objListModel = new FeeCollectionCustomModel();

            using (response = new Response())
            {
                using (dbcontext = new SchoolManagementEntities())
                {
                    try
                    {
                        response.success = true;
                        objListModel     = dbcontext.tblFeeCollections.Where(x => x.IsDeleted == false && x.FeeCollectionId == Id)
                                           .Select(x => new FeeCollectionCustomModel
                        {
                            FeeCollectionId = x.FeeCollectionId,
                            SchoolId        = x.SchoolId,
                            EnquiryId       = x.EnquiryId,
                            AdmissionId     = x.AdmissionId,
                            ClassId         = x.ClassId,
                            SectionId       = x.SectionId,
                            AmountPaid      = x.AmountPaid,
                            FeeMode         = x.FeeMode,
                            FeeDate         = x.FeeDate,
                            FeeInCharge     = x.FeeInCharge,
                            FeeType         = x.FeeType,

                            IsActive     = x.IsActive,
                            IsDeleted    = x.IsDeleted,
                            CreatedBy    = x.CreatedBy,
                            CreatedDate  = x.CreatedDate,
                            ModifiedBy   = x.ModifiedBy,
                            ModifiedDate = x.ModifiedDate
                        }).SingleOrDefault();
                    }
                    catch (Exception ex)
                    {
                        response.success = false;
                        response.message = ex.Message;
                        objListModel     = null;
                    }
                }
            }
            return(objListModel);
        }
Exemplo n.º 18
0
        /// <summary>
        /// Authenticate the Login User
        /// </summary>
        /// <param name="_userName"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        public UserLoginCustomModel Authenticate(string UserName, string Password)
        {
            UserLoginCustomModel objModel = new UserLoginCustomModel();
            string IsSuccess = "false";

            using (response = new Response())
            {
                using (dbcontext = new SchoolManagementEntities())
                {
                    try
                    {
                        response.success = true;
                        {
                            if (UserName.Contains("@"))
                            {
                                var UserDetails = dbcontext.tblUserLogins.Where(x => x.UserName == UserName && x.Password == Password).FirstOrDefault();
                                if (UserDetails != null)
                                {
                                    objModel.Id       = UserDetails.Id;
                                    objModel.FName    = UserDetails.FName;
                                    objModel.LName    = UserDetails.LName;
                                    objModel.EmailId  = UserDetails.EmailId;
                                    objModel.UserName = UserDetails.UserName;
                                    objModel.Password = UserDetails.Password;

                                    IsSuccess = "true";
                                }
                                else
                                {
                                    IsSuccess = "false";
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        response.success = false;
                        response.message = ex.Message;
                        objModel         = null;
                    }
                }
            }
            return(objModel);
        }
Exemplo n.º 19
0
        public object SetDefaultSessionRegistrationDetail(SessionMasterCustomModel objModel)
        {
            object objClassResult = new object();

            using (response = new Response())
            {
                using (dbcontext = new SchoolManagementEntities())
                {
                    try
                    {
                        var CheckActive = dbcontext.tblSessions.FirstOrDefault(x => x.IsDefault == true && x.SessionId != objModel.SessionId);
                        if (CheckActive == null)
                        {
                            var rs = dbcontext.tblSessions.FirstOrDefault(x => x.SessionId == objModel.SessionId);
                            if (rs != null)
                            {
                                rs.IsDefault    = rs.IsDefault == true ? false : true;
                                rs.ModifiedDate = DateTime.Now;
                                rs.ModifiedBy   = objModel.ModifiedBy;

                                dbcontext.SaveChanges();
                                objClassResult = true;
                            }
                            else
                            {
                                objClassResult = false;
                            }
                        }
                        else
                        {
                            objClassResult = false;
                        }
                    }
                    catch (Exception ex)
                    {
                        dbcontext.Dispose();
                        objClassResult = null;
                        throw ex;
                    }
                }
                return(objClassResult);
            }
        }
Exemplo n.º 20
0
        public AdmissionFeeMasterCustomModel GetById(int Id)
        {
            AdmissionFeeMasterCustomModel objListModel = new AdmissionFeeMasterCustomModel();

            using (response = new Response())
            {
                using (dbcontext = new SchoolManagementEntities())
                {
                    try
                    {
                        response.success = true;
                        objListModel     = dbcontext.tblAdmissionFees.Where(x => x.IsDeleted == false && x.AdmissionFeeId == Id)
                                           .Select(x => new AdmissionFeeMasterCustomModel
                        {
                            AdmissionFeeId  = x.AdmissionFeeId,
                            SchoolId        = x.SchoolId,
                            SchoolName      = x.SchoolId != null ? x.tblSchool.Name : "",
                            ClassId         = x.ClassId,
                            ClassName       = x.ClassId != null ? x.tblClass.Title : "",
                            SessionId       = x.SessionId,
                            SessionName     = x.SessionId != null ? x.tblSession.Session : "",
                            AdmissionFee    = x.AdmissionFee,
                            Discount        = x.Discount,
                            NetAdmissionFee = x.NetAdmissionFee,

                            IsActive     = x.IsActive,
                            IsDeleted    = x.IsDeleted,
                            CreatedBy    = x.CreatedBy,
                            CreatedDate  = x.CreatedDate,
                            ModifiedBy   = x.ModifiedBy,
                            ModifiedDate = x.ModifiedDate
                        }).SingleOrDefault();
                    }
                    catch (Exception ex)
                    {
                        response.success = false;
                        response.message = ex.Message;
                        objListModel     = null;
                    }
                }
            }
            return(objListModel);
        }
        public SectionMasterCustomModel GetById(int Id)
        {
            SectionMasterCustomModel SectionListModel = new SectionMasterCustomModel();

            using (response = new Response())
            {
                using (dbcontext = new SchoolManagementEntities())
                {
                    try
                    {
                        response.success = true;

                        SectionListModel = dbcontext.tblSections.Where(x => x.IsDeleted == false && x.SectionId == Id)
                                           .Select(x => new SectionMasterCustomModel
                        {
                            SectionId        = x.SectionId,
                            SchoolId         = x.SchoolId,
                            SchoolName       = x.SchoolId != null ? x.tblSchool.Name : "",
                            SessionId        = x.ClassId != null ? x.tblClass.SessionId : 0,
                            ClassId          = x.ClassId,
                            ClassName        = x.ClassId != null ? x.tblClass.Title : "",
                            Title            = x.Title,
                            Image            = x.Image,
                            DDate            = x.DDate,
                            ShortDescription = x.ShortDescription,
                            IsActive         = x.IsActive,
                            IsDeleted        = x.IsDeleted,
                            CreatedBy        = x.CreatedBy,
                            CreatedDate      = x.CreatedDate,
                            ModifiedBy       = x.ModifiedBy,
                            ModifiedDate     = x.ModifiedDate
                        }).SingleOrDefault();
                    }
                    catch (Exception ex)
                    {
                        response.success = false;
                        response.message = ex.Message;
                        SectionListModel = null;
                    }
                }
            }
            return(SectionListModel);
        }
        // ****************************** Start Reporting Section Code **********************************

        public object BindEnquiryReport(DateTime?FromDate, DateTime?ToDate, int?SessionId, int?ClassId, int?SectionId, string EnquiryStatus, string StudentName)
        {
            using (response = new Response())
            {
                using (dbcontext = new SchoolManagementEntities())
                {
                    try
                    {
                        response.success = true;

                        var rs = dbcontext.USP_BindEnquiryReport(FromDate, ToDate, SessionId, ClassId, SectionId, EnquiryStatus, StudentName)
                                 .Select(x => new EnquiryDetailCustomModel
                        {
                            EnquiryId    = x.EnquiryId,
                            SessionId    = x.SessionId,
                            SessionName  = x.Session,
                            ClassId      = x.ClassId,
                            ClassName    = x.Title,
                            SectionId    = x.SectionId,
                            FName        = x.StudentName,
                            MobileNo     = x.MobileNo,
                            EmailId      = x.EmailId,
                            FatherName   = x.FatherName,
                            MotherName   = x.MotherName,
                            Village      = x.Village,
                            Address      = x.Address,
                            AadharNumber = x.AadharNumber,
                            EnquiryDate  = x.EnquiryDate,
                            Status       = x.Status,
                        }).ToList();

                        return(rs);
                    }
                    catch (Exception ex)
                    {
                        response.success = false;
                        response.message = ex.Message;
                        return(response);
                    }
                }
            }
        }
Exemplo n.º 23
0
        public ProfileCustomModel GetById(int Id)
        {
            ProfileCustomModel objListModel = new ProfileCustomModel();

            using (response = new Response())
            {
                using (dbcontext = new SchoolManagementEntities())
                {
                    try
                    {
                        response.success = true;
                        objListModel     = dbcontext.tblUserLogins.Where(x => x.IsDeleted == false && x.Id == Id)
                                           .Select(x => new ProfileCustomModel
                        {
                            Id         = x.Id,
                            UserTypeId = x.UserTypeId,
                            EmployeeId = x.EmployeeId,
                            FName      = x.FName,
                            LName      = x.LName,
                            EmailId    = x.EmailId,
                            Mobile     = x.Mobile,
                            UserName   = x.UserName,
                            Password   = x.Password,

                            IsActive     = x.IsActive,
                            IsDeleted    = x.IsDeleted,
                            CreatedBy    = x.CreatedBy,
                            CreatedDate  = x.CreatedDate,
                            ModifiedBy   = x.ModifiedBy,
                            ModifiedDate = x.ModifiedDate
                        }).SingleOrDefault();
                    }
                    catch (Exception ex)
                    {
                        response.success = false;
                        response.message = ex.Message;
                        objListModel     = null;
                    }
                }
            }
            return(objListModel);
        }
Exemplo n.º 24
0
        public dynamic login(string email, string pwd)
        {
            string emailID  = email;
            string password = pwd;

            using (SchoolManagementEntities db = new SchoolManagementEntities())
            {
                var user = db.Logins.Where(i => i.EmailID == emailID && i.Password == password).FirstOrDefault();

                if (user != null)
                {
                    string      token = Convert.ToBase64String(Guid.NewGuid().ToByteArray());
                    MemoryCache mc    = MemoryCache.Default;
                    mc.Add("token", token, DateTimeOffset.UtcNow.AddDays(1));
                    return(token);
                }

                return("Please enter correct email and password");
            }
        }
Exemplo n.º 25
0
        public List <SessionMasterModel> GetSessionMaster()
        {
            List <SessionMasterModel>       SessionListModel  = new List <SessionMasterModel>();
            IQueryable <SessionMasterModel> SessionListDetail = null;

            using (dbcontext = new SchoolManagementEntities())
            {
                SessionListDetail = dbcontext.tblSessions.Where(x => x.IsActive == true &&
                                                                x.IsDeleted == false).OrderBy(y => y.Session)
                                    .Select(x => new SessionMasterModel
                {
                    SessionId = x.SessionId,
                    Title     = x.Session,
                });

                SessionListModel = SessionListDetail.ToList();

                return(SessionListModel);
            }
        }
Exemplo n.º 26
0
        public BusChargesMasterCustomModel GetById(int Id)
        {
            BusChargesMasterCustomModel objListModel = new BusChargesMasterCustomModel();

            using (response = new Response())
            {
                using (dbcontext = new SchoolManagementEntities())
                {
                    try
                    {
                        response.success = true;
                        objListModel     = dbcontext.tblBusChargesMasters.Where(x => x.IsDeleted == false && x.BusChargesMasterId == Id)
                                           .Select(x => new BusChargesMasterCustomModel
                        {
                            BusChargesMasterId = x.BusChargesMasterId,
                            SchoolId           = x.SchoolId,
                            SchoolName         = x.tblSchool != null ? x.tblSchool.Name : "",
                            SessionId          = x.SessionId,
                            SessionName        = x.SessionId != null ? x.tblSession.Session : "",
                            StartPoint         = x.StartPoint,
                            EndPoint           = x.EndPoint,
                            Amount             = x.Amount,

                            IsActive     = x.IsActive,
                            IsDeleted    = x.IsDeleted,
                            CreatedBy    = x.CreatedBy,
                            CreatedDate  = x.CreatedDate,
                            ModifiedBy   = x.ModifiedBy,
                            ModifiedDate = x.ModifiedDate
                        }).SingleOrDefault();
                    }
                    catch (Exception ex)
                    {
                        response.success = false;
                        response.message = ex.Message;
                        objListModel     = null;
                    }
                }
            }
            return(objListModel);
        }
        public bool FindById(int Id)
        {
            bool ActiveResult = false;

            using (response = new Response())
            {
                using (dbcontext = new SchoolManagementEntities())
                {
                    try
                    {
                        ActiveResult = dbcontext.tblEnquiryDetails.FirstOrDefault(x => x.EnquiryId == Id).IsActive ?? false;
                    }
                    catch (Exception ex)
                    {
                        dbcontext.Dispose();
                        throw ex;
                    }
                }
                return(ActiveResult);
            }
        }
Exemplo n.º 28
0
        public object GetDashboardEnquiryCount(int?SessionId, int?ClassId)
        {
            List <USP_GetSchoolEnquiryAdmissionCount_Result> objListDashboard = new List <USP_GetSchoolEnquiryAdmissionCount_Result>();

            using (response = new Response())
            {
                using (dbcontext = new SchoolManagementEntities())
                {
                    try
                    {
                        objListDashboard = dbcontext.USP_GetSchoolEnquiryAdmissionCount(SessionId, ClassId).ToList();
                        return(objListDashboard);
                    }
                    catch (Exception ex)
                    {
                        response.success = false;
                        response.message = ex.Message;
                        return(response);
                    }
                }
            }
        }
Exemplo n.º 29
0
        public List <ClassMasterModel> GetClassMaster(int?SessionId)
        {
            List <ClassMasterModel>       ClassListModel  = new List <ClassMasterModel>();
            IQueryable <ClassMasterModel> ClassListDetail = null;

            using (dbcontext = new SchoolManagementEntities())
            {
                ClassListDetail = dbcontext.tblClasses.Where(x => x.IsActive == true &&
                                                             x.IsDeleted == false &&
                                                             (SessionId == 0 || SessionId == null || x.SessionId == SessionId)
                                                             ).OrderBy(y => y.Title)
                                  .Select(x => new ClassMasterModel
                {
                    ClassId = x.ClassId,
                    Title   = x.Title,
                });

                ClassListModel = ClassListDetail.ToList();

                return(ClassListModel);
            }
        }
Exemplo n.º 30
0
        public SessionMasterCustomModel GetById(int Id)
        {
            SessionMasterCustomModel objListModel = new SessionMasterCustomModel();

            using (response = new Response())
            {
                using (dbcontext = new SchoolManagementEntities())
                {
                    try
                    {
                        response.success = true;
                        objListModel     = dbcontext.tblSessions.Where(x => x.IsDeleted == false && x.SessionId == Id)
                                           .Select(x => new SessionMasterCustomModel
                        {
                            SessionId   = x.SessionId,
                            Session     = x.Session,
                            Description = x.Description,
                            DDate       = x.DDate,
                            IsDefault   = x.IsDefault,

                            IsActive     = x.IsActive,
                            IsDeleted    = x.IsDeleted,
                            CreatedBy    = x.CreatedBy,
                            CreatedDate  = x.CreatedDate,
                            ModifiedBy   = x.ModifiedBy,
                            ModifiedDate = x.ModifiedDate
                        }).SingleOrDefault();
                    }
                    catch (Exception ex)
                    {
                        response.success = false;
                        response.message = ex.Message;
                        objListModel     = null;
                    }
                }
            }
            return(objListModel);
        }