Ejemplo n.º 1
0
        public int AddEditFeeStructureHead(FeeStructure entity)
        {
            int i = 0;

            User objUser = null;
            if (eSchoolSession.IsInSession(SessionKeys.CurrentUser))
                objUser = (User)eSchoolSession.GetDirectValue(SessionKeys.CurrentUser);

            if (entity != null && string.IsNullOrEmpty(entity.SchoolID))
            {
                if (objUser != null && !string.IsNullOrEmpty(objUser.SchoolID))
                    entity.SchoolID = objUser.SchoolID;
            }

            if (string.IsNullOrEmpty(entity.FeeStructureHeadID))
            {
                entity.FeeStructureHeadID = Utility.GeneratorUniqueId(ID_PREFIX_CONSTANTS.FEE_STRUCTURE_HEAD_ID_PREFIX);

                if (objUser != null && !string.IsNullOrEmpty(objUser.UserID))
                {
                    entity.CreatedByID = objUser.UserID;
                    entity.ModifiedByID = objUser.UserID;
                }
                else
                {
                    entity.CreatedByID = "1";
                    entity.ModifiedByID = "1";
                }
            }
            else
            {
                if (objUser != null && !string.IsNullOrEmpty(objUser.UserID))
                    entity.ModifiedByID = objUser.UserID;
                else
                    entity.ModifiedByID = "1";
            }

            string[] addParams = { FeeStructure_Constant.FEE_STRUCTURE_HEAD_ID,
                                    FeeStructure_Constant.FEE_STRUCTURE_ID,
                                    FeeStructure_Constant.FEE_HEAD_ID,
                                    FeeStructure_Constant.INSTALLMENT_AMOUNT,
                                    FeeStructure_Constant.NO_OF_INSTALLMENT,
                                    FeeStructure_Constant.FIRST_INSTALLMENT_STARTS_FROM,
                                    FeeStructure_Constant.TOTAL_FEES,
                                    FeeStructure_Constant.CREATED_BY_ID,
                                    FeeStructure_Constant.MODIFIED_BY_ID
                                    };

            i = _FeeStructureRepository.ExecuteNonQuery(entity, addParams, FeeStructure_Constant.SPROC_FEE_STRUCTURE_HEADS_UPS);

            return i;
        }
Ejemplo n.º 2
0
        public FeeStructure GetFeeStructureHeadsDetailServiceTaxAmount(FeeStructure entity)
        {
            User objUser = null;
            if (eSchoolSession.IsInSession(SessionKeys.CurrentUser))
                objUser = (User)eSchoolSession.GetDirectValue(SessionKeys.CurrentUser);

            if (entity != null && string.IsNullOrEmpty(entity.SchoolID))
            {
                if (objUser != null && !string.IsNullOrEmpty(objUser.SchoolID))
                    entity.SchoolID = objUser.SchoolID;
            }

            string[] addParams = { FeeStructure_Constant.SCHOOL_ID, FeeStructure_Constant.AY_ID, FeeStructure_Constant.CLASS_ID, FeeStructure_Constant.FEE_STRUCTURE_HEAD_DETAIL_IDs };
            return _FeeStructureRepository.Get(entity, addParams, FeeStructure_Constant.SPROC_FEE_STRUCTURE_HEADS_DETAIL_CALCULATE_SERVICE_TAX);
        }
Ejemplo n.º 3
0
 public object GetScalar(FeeStructure entity)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 4
0
 public IEnumerable<FeeStructure> GetFeeStructureHeadInstallmentsUpToDate(FeeStructure entity)
 {
     string[] addParams = { FeeStructure_Constant.AY_ID, FeeStructure_Constant.CLASS_ID, FeeStructure_Constant.STUDENT_ID, FeeStructure_Constant.FEE_UP_TO };
     return _FeeStructureRepository.GetAll(entity, addParams, FeeStructure_Constant.SPROC_FEE_STRUCTURE_HEADS_DETAIL_SEL_BY_FEE_UP_TO);
 }
Ejemplo n.º 5
0
 public FeeStructure GetFeeStructureHeadsDetail(FeeStructure entity)
 {
     string[] addParams = { FeeStructure_Constant.FEE_STRUCTURE_HEAD_DETAIL_ID };
     return _FeeStructureRepository.Get(entity, addParams, FeeStructure_Constant.SPROC_FEE_STRUCTURE_HEADS_DETAIL_SEL);
 }
Ejemplo n.º 6
0
        public FeeStructure GetFeeHeadOptionalEntryDueAmount(FeeStructure entity)
        {
            User objUser = null;
            if (eSchoolSession.IsInSession(SessionKeys.CurrentUser))
                objUser = (User)eSchoolSession.GetDirectValue(SessionKeys.CurrentUser);

            if (entity != null && string.IsNullOrEmpty(entity.SchoolID))
            {
                if (objUser != null && !string.IsNullOrEmpty(objUser.SchoolID))
                    entity.SchoolID = objUser.SchoolID;
            }

            string[] addParams = { FeeStructure_Constant.SCHOOL_ID, FeeStructure_Constant.STUDENT_ID, FeeStructure_Constant.AY_ID, FeeStructure_Constant.CLASS_ID, FeeStructure_Constant.FEE_HEAD_OPTIONAL_ENTRY_IDS };
            return _FeeStructureRepository.Get(entity, addParams, FeeStructure_Constant.SPROC_FEE_HEAD_OPTIONAL_ENTRY_CALCULATE_DUES);
        }
Ejemplo n.º 7
0
        public IEnumerable<FeeStructure> GetFeeStructureByClass(FeeStructure entity)
        {
            User objUser = null;
            if (eSchoolSession.IsInSession(SessionKeys.CurrentUser))
                objUser = (User)eSchoolSession.GetDirectValue(SessionKeys.CurrentUser);

            if (objUser != null && !string.IsNullOrEmpty(objUser.SchoolID))
                entity.SchoolID = objUser.SchoolID;

            string[] addParams = { FeeStructure_Constant.SCHOOL_ID, FeeStructure_Constant.AY_ID, FeeStructure_Constant.CLASS_ID };
            return _FeeStructureRepository.GetAll(entity, addParams, FeeStructure_Constant.SPROC_FEE_STRUCTURE_HEADS_DETAIL_SEL_BY_CLASS);
        }
Ejemplo n.º 8
0
        public IEnumerable<FeeStructure> GetAllFeeStructureHeadsDetail(FeeStructure entity)
        {
            User objUser = null;
            if (eSchoolSession.IsInSession(SessionKeys.CurrentUser))
                objUser = (User)eSchoolSession.GetDirectValue(SessionKeys.CurrentUser);

            if (objUser != null && !string.IsNullOrEmpty(objUser.SchoolID))
                entity.SchoolID = objUser.SchoolID;

            string[] addParams = { Constants.PAGEINDEX, Constants.PAGESIZE, Constants.SORTEXP, FeeStructure_Constant.FEE_STRUCTURE_HEAD_ID };
            return _FeeStructureRepository.GetAll(entity, addParams, FeeStructure_Constant.SPROC_FEE_STRUCTURE_HEADS_DETAIL_LSTALL);
        }
Ejemplo n.º 9
0
 public FeeStructure Get(FeeStructure entity)
 {
     string[] addParams = { FeeStructure_Constant.FEE_STRUCTURE_ID };
     return _FeeStructureRepository.Get(entity, addParams, FeeStructure_Constant.SPROC_FEE_STRUCTURE_SEL);
 }
Ejemplo n.º 10
0
        public int DeleteFeeStructureHeadsDetail(FeeStructure entity)
        {
            int i = 0;

            string[] addParams = { FeeStructure_Constant.FEE_STRUCTURE_HEAD_DETAIL_ID };
            i = _FeeStructureRepository.ExecuteNonQuery(entity, addParams, FeeStructure_Constant.SPROC_FEE_STRUCTURE_HEADS_DETAIL_DEL);

            return i;
        }
Ejemplo n.º 11
0
        public ActionResult AddEditFeeStructureHead(FeeListViewModel model)
        {
            FillDDForFeeStructureHeads();

            string strSuccessMsg = string.Empty;
            string strErrorMsg = string.Empty;

            if (model != null && model.FeeStructure != null)
            {
                if (string.IsNullOrEmpty(model.FeeStructure.FeeStructureHeadID))
                {
                    strSuccessMsg = FeeRes.MsgAddSuccess;
                    strErrorMsg = FeeRes.MsgAddError;
                }
                else
                {
                    strSuccessMsg = FeeRes.MsgEditSuccess;
                    strErrorMsg = FeeRes.MsgEditError;
                }

                int i = _FeeStructureService.AddEditFeeStructureHead(model.FeeStructure);

                if( i > 0)
                {
                    #region Add Fee Installments

                    if (!string.IsNullOrEmpty(model.FeeStructure.FeeStructureHeadID))
                    {
                        _FeeStructureService.DeleteByFSHID(model.FeeStructure);

                        DateTime dtFirstInstallmentDate = DateTime.Now.Date;

                        if( !string.IsNullOrEmpty( Convert.ToString(model.FeeStructure.FirstInstallmentStartsFrom)))
                            dtFirstInstallmentDate = model.FeeStructure.FirstInstallmentStartsFrom;

                        for (int j = 1; j <= model.FeeStructure.NoOfInstallment; j++)
                        {
                            FeeStructure objFeeInstallment = new FeeStructure();
                            objFeeInstallment.FeeStructureHeadID = model.FeeStructure.FeeStructureHeadID;
                            objFeeInstallment.InstallmentNo = j;
                            objFeeInstallment.InstallmentDate = Convert.ToDateTime(dtFirstInstallmentDate.ToShortDateString());
                            objFeeInstallment.Amount = model.FeeStructure.InstallmentAmount;

                            dtFirstInstallmentDate = dtFirstInstallmentDate.AddMonths(6);

                            int k = _FeeStructureService.AddEditFeeStructureHeadsDetail(objFeeInstallment);
                        }
                    }

                    #endregion
                }

                if (i <= 0)
                {
                    TempData["err"] = strErrorMsg;
                }
                else
                {
                    TempData["msg"] = strSuccessMsg;
                }
            }

            return RedirectToAction("ManageFeeStructureHeads", "FeeStructure", new { pFeeStructureID = model.FeeStructure.FeeStructureID });
        }
Ejemplo n.º 12
0
 public IEnumerable<FeeStructure> GetAllFeeReceiptHeadDue(FeeStructure entity)
 {
     string[] addParams = { Constants.PAGEINDEX, Constants.PAGESIZE, Constants.SORTEXP, FeeReceipt_Constant.FEE_RECEIPT_ID };
     return _FeeStructureRepository.GetAll(entity, addParams, FeeReceipt_Constant.SPROC_FEE_RECEIPTS_HEADS_DUES_LSTALL);
 }