Esempio n. 1
0
        public int AddEdit(Batch 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.BatchID))
            {
                entity.BatchID = Utility.GeneratorUniqueId(ID_PREFIX_CONSTANTS.BATCH_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 = { Batch_Constant.BATCH_ID,
                                     Batch_Constant.SCHOOL_ID,
                                    Batch_Constant.BATCH_NAME,
                                    Batch_Constant.BATCH_CODE,
                                    Batch_Constant.START_TIME_HR,
                                    Batch_Constant.START_TIME_MIN,
                                    Batch_Constant.END_TIME_HR,
                                    Batch_Constant.END_TIME_MIN,
                                    Batch_Constant.IS_ACTIVE,
                                    Batch_Constant.CREATED_BY_ID,
                                    Batch_Constant.MODIFIED_BY_ID
                                    };

            i = _BatchRepository.ExecuteNonQuery(entity, addParams, Batch_Constant.SPROC_BATCHMST_UPS);

            return i;
        }
 private SelectList GetAllBatch()
 {
     Batch obj = new Batch();
     SelectList retList = null;
     List<Batch> ObjList = _BatchService.GetAllForLookup(obj).ToList();
     if (retList == null)
         retList = new SelectList(ObjList, Batch_Constant.BATCH_ID, Batch_Constant.BATCH_NAME);
     return retList;
 }
Esempio n. 3
0
 public Batch Get(Batch entity)
 {
     string[] addParams = { Batch_Constant.BATCH_ID };
     return _BatchRepository.Get(entity, addParams, Batch_Constant.SPROC_BATCHMST_SEL);
 }
Esempio n. 4
0
        public int Delete(Batch entity)
        {
            int i = 0;

            string[] addParams = { Batch_Constant.BATCH_ID };
            i = _BatchRepository.ExecuteNonQuery(entity, addParams, Batch_Constant.SPROC_BATCHMST_DEL);

            return i;
        }
Esempio n. 5
0
 public object GetScalar(Batch entity)
 {
     throw new NotImplementedException();
 }
Esempio n. 6
0
 public Batch GetByName(Batch entity)
 {
     string[] addParams = { Batch_Constant.BATCH_NAME };
     return _BatchRepository.Get(entity, addParams, Batch_Constant.SPROC_BATCHMST_SEL_BY_NAME);
 }
Esempio n. 7
0
        public IEnumerable<Batch> GetAllForLookup(Batch 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 = { Batch_Constant.SCHOOL_ID };

            return _BatchRepository.GetAll(entity, addParams, Batch_Constant.SPROC_BATCHMST_LSTALL_FOR_LOOKUP);
        }