Ejemplo n.º 1
0
        public int Delete(Board entity)
        {
            int i = 0;

            string[] addParams = { Board_Constant.BOARD_ID };
            i = _BoardRepository.ExecuteNonQuery(entity, addParams, Board_Constant.SPROC_BOARDMST_DEL);

            return i;
        }
Ejemplo n.º 2
0
        public int AddEdit(Board entity)
        {
            int i = 0;

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

            if (string.IsNullOrEmpty(entity.BoardID))
            {
                entity.BoardID = Utility.GeneratorUniqueId(ID_PREFIX_CONSTANTS.BOARD_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";
            }

            ////Upload Image to DB
            //if (entity.BoardLogoFile != null && !string.IsNullOrEmpty(entity.BoardLogoFile.FileName)
            //    && Utility.IsImage(entity.BoardLogoFile))
            //{
            //    using (MemoryStream ms = new MemoryStream())
            //    {
            //        entity.BoardLogoFile.InputStream.CopyTo(ms);
            //        byte[] array = ms.GetBuffer();
            //        entity.BoardLogo = array;
            //    }
            //}

            string[] addParams = {  Board_Constant.BOARD_ID,
                                    Board_Constant.BOARD_NAME ,
                                    Board_Constant.BOARD_CODE ,
                                    Board_Constant.BOARD_ADDRESS,
                                    Board_Constant.BOARD_CONTACT_NO ,
                                    Board_Constant.BOARD_FAX_NO ,
                                    Board_Constant.BOARD_EMAIL_ADDRESS ,
                                    Board_Constant.BOARD_CONTACT_PERSON_NAME ,
                                    Board_Constant.BOARD_CONTACT_PERSON_DESIGNATION ,
                                    Board_Constant.BOARD_CONTACT_PERSON_CONTACTNO ,
                                    Board_Constant.BOARD_CONTACT_PERSON_CELL_NO ,
                                    Board_Constant.BOARD_CONTACT_PERSON_EMAIL_ADDRESS ,
                                    Board_Constant.BOARD_LOGO ,
                                   Board_Constant.CREATED_BY_ID,
                                   Board_Constant.MODIFIED_BY_ID
                                 };

            i = _BoardRepository.ExecuteNonQuery(entity, addParams, Board_Constant.SPROC_BOARDMST_UPS);

            return i;
        }
Ejemplo n.º 3
0
        public int UpdateLogo(Board entity)
        {
            int i = 0;

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

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

            string[] addParams = {  Board_Constant.BOARD_ID,
                                    Board_Constant.BOARD_LOGO ,
                                   Board_Constant.CREATED_BY_ID,
                                   Board_Constant.MODIFIED_BY_ID
                                 };

            i = _BoardRepository.ExecuteNonQuery(entity, addParams, Board_Constant.SPROC_BOARDMST_UPS_LOGO);

            return i;
        }
Ejemplo n.º 4
0
 public object GetScalar(Board entity)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 5
0
 public IEnumerable<Board> GetAll(Board entity)
 {
     string[] addParams = { Constants.PAGEINDEX, Constants.PAGESIZE, Constants.SORTEXP };
     return _BoardRepository.GetAll(entity, addParams, Board_Constant.SPROC_BOARDMST_LSTALL);
 }
Ejemplo n.º 6
0
 public Board Get(Board entity)
 {
     string[] addParams = { Board_Constant.BOARD_ID };
     return _BoardRepository.Get(entity, addParams, Board_Constant.SPROC_BOARDMST_SEL);
 }