示例#1
0
        public int AddEdit(FeeHeads 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.FeeHeadID))
            {
                entity.FeeHeadID = Utility.GeneratorUniqueId(ID_PREFIX_CONSTANTS.FEE_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 = { FeeHead_Constant.FEE_HEAD_ID,
                                    FeeHead_Constant.SCHOOL_ID,
                                    FeeHead_Constant.FEE_HEAD,
                                    FeeHead_Constant.FEE_HEAD_DESC,
                                    FeeHead_Constant.ORDER_NO,
                                    FeeHead_Constant.FEE_HEAD_FOR,
                                    FeeHead_Constant.SERVICE_TAX_PERCENT,
                                    FeeHead_Constant.IS_OPTIONAL_FEE_HEAD,
                                    FeeHead_Constant.CREATED_BY_ID,
                                    FeeHead_Constant.MODIFIED_BY_ID
                                    };

            i = _FeeHeadRepository.ExecuteNonQuery(entity, addParams, FeeHead_Constant.SPROC_FEE_HEADS_UPS);

            return i;
        }
 private SelectList GetAllFeeHead()
 {
     FeeHeads obj = new FeeHeads();
     obj.IsOptionalFeeHead = false;
     SelectList retList = null;
     List<FeeHeads> ObjList = _FeeHeadService.GetAllForLookup(obj).ToList();
     if (retList == null)
         retList = new SelectList(ObjList, FeeHead_Constant.FEE_HEAD_ID, FeeHead_Constant.FEE_HEAD);
     return retList;
 }
示例#3
0
 public FeeHeads Get(FeeHeads entity)
 {
     string[] addParams = { FeeHead_Constant.FEE_HEAD_ID };
     return _FeeHeadRepository.Get(entity, addParams, FeeHead_Constant.SPROC_FEE_HEADS_SEL);
 }
示例#4
0
        public int Delete(FeeHeads entity)
        {
            int i = 0;

            string[] addParams = { FeeHead_Constant.FEE_HEAD_ID };
            i = _FeeHeadRepository.ExecuteNonQuery(entity, addParams, FeeHead_Constant.SPROC_FEE_HEADS_DEL);

            return i;
        }
示例#5
0
 public object GetScalar(FeeHeads entity)
 {
     throw new NotImplementedException();
 }
示例#6
0
 public IEnumerable<FeeHeads> GetAllForLookup(FeeHeads 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 = { FeeHead_Constant.SCHOOL_ID, FeeHead_Constant.IS_OPTIONAL_FEE_HEAD };
     return _FeeHeadRepository.GetAll(entity, addParams, FeeHead_Constant.SPROC_FEEHEADS_LSTALL_FOR_LOOKUP);
 }
示例#7
0
        public IEnumerable<FeeHeads> GetAll(FeeHeads 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, FeeHead_Constant.SCHOOL_ID };
            return _FeeHeadRepository.GetAll(entity, addParams, FeeHead_Constant.SPROC_FEE_HEADS_LSTALL);
        }