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); } }
protected override void Dispose(bool disposing) { if (disposing) { db.Dispose(); } base.Dispose(disposing); }
public void Dispose() { dbcontext.Dispose(); if (response != null) { response.Dispose(); } GC.SuppressFinalize(this); }
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; } } } }
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; } } } }
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); } }
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); } }
/// <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); } }
/// <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); } }
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); } }
/// <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); } }