public object DeleteFeeCollectionDetail(FeeCollectionCustomModel objModel)
 {
     using (objDAL = new FeeCollectionRepo())
     {
         return(objDAL.DeleteFeeCollectionDetail(objModel));
     }
 }
 public object GetFeeCollectionListing(FeeCollectionCustomModel objModel)
 {
     using (objDAL = new FeeCollectionRepo())
     {
         return(objDAL.GetFeeCollectionListing(objModel));
     }
 }
 public Response SaveFeeCollectionMasterDetails(FeeCollectionCustomModel objModel)
 {
     using (objDAL = new FeeCollectionRepo())
     {
         return(objDAL.SaveFeeCollectionMasterDetails(objModel));
     }
 }
Exemplo n.º 4
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.º 5
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.º 6
0
        public ActionResult DeleteStatus(string id)
        {
            objBDC = new FeeCollectionBusiness();
            int  Id      = Convert.ToInt32(id);
            bool _Result = objBDC.FindById(Id);

            if (_Result == true)
            {
                _Result = false;
            }
            else
            {
                _Result = true;
            }

            FeeCollectionCustomModel objModel = new FeeCollectionCustomModel();

            objModel.FeeCollectionId = Id;
            objBDC.DeleteFeeCollectionDetail(objModel);

            return(RedirectToAction("Index"));
        }
Exemplo n.º 7
0
        // GET: FeeCollection/Create
        public ActionResult Create(int id = 0, int Aid = 0)
        {
            FeeCollectionCustomModel objFeeModel      = new FeeCollectionCustomModel();
            EnquiryDetailCustomModel objModel         = new EnquiryDetailCustomModel();
            EmployeeMasterModel      objEmployeeModel = new EmployeeMasterModel();

            objBDCCommon = new CommonMasterDataBusiness();
            objBDCENQ    = new EnquiryDetailBusiness();

            var EmployeeType = objBDCCommon.GetEmployeeMaster();

            objEmployeeModel.EmployeeList = new SelectList(EmployeeType, "EmployeeId", "EmployeeName");
            ViewBag.EmployeeInfo          = objEmployeeModel.EmployeeList;

            StudentCommonDetail objRes = new StudentCommonDetail();

            var rs        = objBDCENQ.GetEnquiryId(Aid);
            int Eid       = ((School.Shared.CustomModels.StudentCommonDetail)rs).EnquiryId;
            int?ClassId   = ((School.Shared.CustomModels.StudentCommonDetail)rs).ClassId;
            int?SectionId = ((School.Shared.CustomModels.StudentCommonDetail)rs).SectionId;

            if (Eid != 0)
            {
                ViewBag.StudentAdmissionDate = objBDCENQ.GetById(Eid);

                objBDC = new FeeCollectionBusiness();
                ViewBag.FeeCollection = objBDC.GetStudentFeeDetail(Aid, ClassId, SectionId);
            }

            if (id != 0)
            {
                objBDC      = new FeeCollectionBusiness();
                objFeeModel = objBDC.GetById(id);
            }

            return(View(objFeeModel));
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 9
0
        public ActionResult Create(FeeCollectionCustomModel objModel, int Aid = 0)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    // TODO: Add insert logic here
                    objBDC    = new FeeCollectionBusiness();
                    objBDCENQ = new EnquiryDetailBusiness();
                    StudentCommonDetail objResult = new StudentCommonDetail();

                    var rs        = objBDCENQ.GetEnquiryId(Aid);
                    int Eid       = ((School.Shared.CustomModels.StudentCommonDetail)rs).EnquiryId;
                    int?ClassId   = ((School.Shared.CustomModels.StudentCommonDetail)rs).ClassId;
                    int?SectionId = ((School.Shared.CustomModels.StudentCommonDetail)rs).SectionId;

                    if (Eid > 0 && Aid > 0)
                    {
                        objModel.EnquiryId   = Eid;
                        objModel.AdmissionId = Aid;
                        objModel.ClassId     = ClassId;
                        objModel.SectionId   = SectionId;
                        objModel.CreatedBy   = ((School.Shared.CustomModels.UserLoginCustomModel)(Session[CommonStrings.UserSession])).Id;
                        objModel.ModifiedBy  = ((School.Shared.CustomModels.UserLoginCustomModel)(Session[CommonStrings.UserSession])).Id;
                        objBDC.SaveFeeCollectionMasterDetails(objModel);

                        return(RedirectToAction("Create", new { id = 0, AId = Aid }));
                    }
                    else
                    {
                        return(RedirectToAction("Index"));
                    }
                }
                else
                {
                    objBDCENQ = new EnquiryDetailBusiness();
                    EmployeeMasterModel objEmployeeModel = new EmployeeMasterModel();
                    objBDCCommon = new CommonMasterDataBusiness();

                    var EmployeeType = objBDCCommon.GetEmployeeMaster();
                    objEmployeeModel.EmployeeList = new SelectList(EmployeeType, "EmployeeId", "EmployeeName");
                    ViewBag.EmployeeInfo          = objEmployeeModel.EmployeeList;

                    var rs        = objBDCENQ.GetEnquiryId(Aid);
                    int Eid       = ((School.Shared.CustomModels.StudentCommonDetail)rs).EnquiryId;
                    int?ClassId   = ((School.Shared.CustomModels.StudentCommonDetail)rs).ClassId;
                    int?SectionId = ((School.Shared.CustomModels.StudentCommonDetail)rs).SectionId;

                    if (Eid != 0)
                    {
                        ViewBag.StudentAdmissionDate = objBDCENQ.GetById(Eid);

                        objBDC = new FeeCollectionBusiness();
                        ViewBag.FeeCollection = objBDC.GetStudentFeeDetail(Aid, ClassId, SectionId);
                    }

                    return(View());
                }
            }
            catch
            {
                return(View());
            }
        }
Exemplo n.º 10
0
        public Response SaveFeeCollectionMasterDetails(FeeCollectionCustomModel objModel)
        {
            using (response = new Response())
            {
                using (dbcontext = new SchoolManagementEntities())
                {
                    try
                    {
                        response.success = true;
                        if (objModel.FeeCollectionId == 0)
                        {
                            var rs = dbcontext.tblFeeCollections.FirstOrDefault(x => x.IsDeleted == false && x.AdmissionId == objModel.AdmissionId && x.FeeDate == objModel.FeeDate && x.FeeType == objModel.FeeType);
                            if (rs == null)
                            {
                                dbcontext.insert_fees_collection(objModel.EnquiryId, objModel.AdmissionId, objModel.ClassId, objModel.SectionId, objModel.FeeDate, objModel.FeeType, objModel.AmountPaid, objModel.FeeMode, 0, objModel.FeeInCharge, objModel.CreatedBy, objModel.ModifiedBy);

                                //tblFeeCollection objAddNew = new tblFeeCollection
                                //{
                                //    SchoolId = Convert.ToInt32(CommonHelper.TaskSchoolId.SchoolId),
                                //    EnquiryId = objModel.SessionId,
                                //    Title = objModel.Title,
                                //    ShortDescription = objModel.ShortDescription,
                                //    DDate = objModel.DDate,

                                //    IsActive = true,
                                //    IsDeleted = false,
                                //    CreatedBy = objModel.CreatedBy,
                                //    CreatedDate = DateTime.Now,
                                //    ModifiedBy = objModel.ModifiedBy,
                                //    ModifiedDate = DateTime.Now
                                //};

                                //dbcontext.tblClasses.Add(objAddNew);
                                //dbcontext.SaveChanges();
                                //response.responseData = new { ClassId = objAddNew.ClassId, Title = objAddNew.Title };
                                response.message = "Record Added Successfully!";
                            }
                            else
                            {
                                response.success = false;
                                response.message = "Record Already Exists!";
                            }
                        }
                        else
                        {
                            var rs = dbcontext.tblFeeCollections.FirstOrDefault(x => x.IsDeleted == false && x.AdmissionId == objModel.AdmissionId && x.FeeDate == objModel.FeeDate && x.FeeType == objModel.FeeType && x.FeeCollectionId != objModel.FeeCollectionId);
                            if (rs == null)
                            {
                                var objUpdate = dbcontext.tblFeeCollections.FirstOrDefault(m => m.FeeCollectionId == objModel.FeeCollectionId);
                                if (objUpdate != null)
                                {
                                    dbcontext.update_fees_collection(objModel.FeeCollectionId, objModel.EnquiryId, objModel.AdmissionId, objModel.ClassId, objModel.SectionId, objModel.FeeDate, objModel.FeeType, objModel.AmountPaid, objModel.FeeMode, 0, objModel.FeeInCharge);

                                    //objUpdate.SessionId = objModel.SessionId;
                                    //objUpdate.Title = objModel.Title;
                                    //objUpdate.ShortDescription = objModel.ShortDescription;
                                    //objUpdate.DDate = objModel.DDate;

                                    //objUpdate.ModifiedBy = objModel.ModifiedBy;
                                    //objUpdate.ModifiedDate = DateTime.Now;
                                    //dbcontext.SaveChanges();
                                    //response.responseData = new { ClassId = objUpdate.ClassId, Title = objUpdate.Title };
                                    response.message = "Record Updated Successfully!";
                                }
                            }
                            else
                            {
                                response.success = false;
                                response.message = "Record Already Exists!";
                            }
                        }
                        return(response);
                    }
                    catch (Exception ex)
                    {
                        response.success = false;
                        response.message = ex.Message;
                        return(response);
                    }
                }
            }
        }