コード例 #1
0
        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);
            }
        }
コード例 #2
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         db.Dispose();
     }
     base.Dispose(disposing);
 }
コード例 #3
0
        public void Dispose()
        {
            dbcontext.Dispose();
            if (response != null)
            {
                response.Dispose();
            }

            GC.SuppressFinalize(this);
        }
コード例 #4
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;
             }
         }
     }
 }
コード例 #5
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;
             }
         }
     }
 }
コード例 #6
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);
            }
        }
コード例 #7
0
        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);
            }
        }
コード例 #8
0
        /// <summary>
        /// This method is used to delete particular farmer detail
        /// </summary>
        /// <param name="AssetId">Unique id of asset</param>
        /// <returns>Response</returns>
        public object DeleteFeeCollectionDetail(FeeCollectionCustomModel objModel)
        {
            object objClassResult = new object();

            using (response = new Response())
            {
                using (dbcontext = new SchoolManagementEntities())
                {
                    try
                    {
                        var rs = dbcontext.tblFeeCollections.FirstOrDefault(x => x.FeeCollectionId == objModel.FeeCollectionId);

                        if (rs != null)
                        {
                            dbcontext.Delete_Fee_Collection(objModel.FeeCollectionId, objModel.ModifiedBy);
                            //rs.IsDeleted = true;
                            //rs.ModifiedDate = DateTime.Now;
                            //rs.ModifiedBy = objModel.ModifiedBy;

                            //dbcontext.SaveChanges();
                            objClassResult = true;
                        }
                        else
                        {
                            objClassResult = false;
                        }
                    }
                    catch (Exception ex)
                    {
                        dbcontext.Dispose();
                        objClassResult = null;
                        throw ex;
                    }
                }
                return(objClassResult);
            }
        }
コード例 #9
0
        /// <summary>
        /// This method is used to delete particular farmer detail
        /// </summary>
        /// <param name="AssetId">Unique id of asset</param>
        /// <returns>Response</returns>
        public object DeleteSchoolRegistrationDetail(SchoolMasterCustomModel objSchoolRegistrationModel)
        {
            object objSchoolResult = new object();

            using (response = new Response())
            {
                using (dbcontext = new SchoolManagementEntities())
                {
                    try
                    {
                        var rs = dbcontext.tblSchools.FirstOrDefault(x => x.SchoolId == objSchoolRegistrationModel.SchoolId);

                        if (rs != null)
                        {
                            rs.IsDeleted    = true;
                            rs.ModifiedDate = DateTime.Now;
                            rs.ModifiedBy   = objSchoolRegistrationModel.ModifiedBy;

                            dbcontext.SaveChanges();
                            objSchoolResult = true;
                        }
                        else
                        {
                            objSchoolResult = false;
                        }
                    }
                    catch (Exception ex)
                    {
                        dbcontext.Dispose();
                        objSchoolResult = null;
                        throw ex;
                    }
                }
                return(objSchoolResult);
            }
        }
コード例 #10
0
        public object SetActiveEnquiryDetail(EnquiryDetailCustomModel objEnquiryDetailModel)
        {
            object objClassResult = new object();

            using (response = new Response())
            {
                using (dbcontext = new SchoolManagementEntities())
                {
                    try
                    {
                        var rs = dbcontext.tblEnquiryDetails.FirstOrDefault(x => x.EnquiryId == objEnquiryDetailModel.EnquiryId);

                        if (rs != null)
                        {
                            rs.IsActive     = rs.IsActive == true ? false : true;
                            rs.ModifiedDate = DateTime.Now;
                            rs.ModifiedBy   = objEnquiryDetailModel.ModifiedBy;

                            dbcontext.SaveChanges();
                            objClassResult = true;
                        }
                        else
                        {
                            objClassResult = false;
                        }
                    }
                    catch (Exception ex)
                    {
                        dbcontext.Dispose();
                        objClassResult = null;
                        throw ex;
                    }
                }
                return(objClassResult);
            }
        }
コード例 #11
0
        /// <summary>
        /// This method is used to Activate particular farmer detail
        /// </summary>
        /// <param name="AssetId">Unique id of Farmer</param>
        /// <returns>Response</returns>
        public object SetActiveEventRegistrationDetail(EventMasterCustomModel objEventRegistrationModel)
        {
            object objEmployeeResult = new object();

            using (response = new Response())
            {
                using (dbcontext = new SchoolManagementEntities())
                {
                    try
                    {
                        var rs = dbcontext.tblEvents.FirstOrDefault(x => x.EventId == objEventRegistrationModel.EventId);

                        if (rs != null)
                        {
                            rs.IsActive = rs.IsActive == true ? false : true;
                            //rs.ModifiedDate = DateTime.Now;
                            //rs.ModifiedBy = objEventRegistrationModel.ModifiedBy;

                            dbcontext.SaveChanges();
                            objEmployeeResult = true;
                        }
                        else
                        {
                            objEmployeeResult = false;
                        }
                    }
                    catch (Exception ex)
                    {
                        dbcontext.Dispose();
                        objEmployeeResult = null;
                        throw ex;
                    }
                }
                return(objEmployeeResult);
            }
        }