Esempio n. 1
0
        /// <summary>
        /// 获取Person列表
        /// </summary>
        public string GetPersonListData()
        {
            var    service = new MarketPersonBLL(CurrentUserInfo);
            string content = string.Empty;

            string key = string.Empty;

            if (Request("MarketEventID") != null && Request("MarketEventID") != string.Empty)
            {
                key = Request("MarketEventID").ToString().Trim();
            }

            var queryEntity = new MarketPersonEntity();

            queryEntity.MarketEventID = key;
            int pageIndex = Utils.GetIntVal(FormatParamValue(Request("page"))) - 1;

            var data           = service.GetList(queryEntity, pageIndex, 1000);
            var dataTotalCount = service.GetListCount(queryEntity);

            content = string.Format("{{\"totalCount\":{1},\"topics\":{0}}}",
                                    data.ToJSON(),
                                    dataTotalCount);
            return(content);
        }
Esempio n. 2
0
        /// <summary>
        /// 保存EventPerson
        /// </summary>
        public string SaveEventPersonData()
        {
            var    service           = new MarketEventBLL(CurrentUserInfo);
            var    marketWaveBandBLL = new MarketWaveBandBLL(CurrentUserInfo);
            var    marketPersonBLL   = new MarketPersonBLL(CurrentUserInfo);
            var    obj          = new MarketPersonEntity();
            var    eventObj     = new MarketEventEntity();
            string content      = string.Empty;
            string error        = "";
            var    responseData = new ResponseData();

            string key           = string.Empty;
            string MarketEventID = string.Empty;

            if (Request("data") != null && Request("data") != string.Empty)
            {
                key = Request("data").ToString().Trim();
            }
            if (Request("MarketEventID") != null && Request("MarketEventID") != string.Empty)
            {
                MarketEventID = Request("MarketEventID").ToString().Trim();
            }

            obj = key.DeserializeJSONTo <MarketPersonEntity>();

            if (obj.MarketEventID == null || obj.MarketEventID.Trim().Length == 0 ||
                obj.MarketEventID == "null" || obj.MarketEventID == "undefined")
            {
                responseData.success = false;
                responseData.msg     = "活动标示不能为空";
                return(responseData.ToJSON());
            }

            marketPersonBLL.WebDelete(new MarketPersonEntity()
            {
                MarketEventID = obj.MarketEventID
            });
            if (obj.MarketPersonInfoList != null)
            {
                foreach (var item in obj.MarketPersonInfoList)
                {
                    //item.MarketPersonID = Utils.NewGuid();
                    item.MarketEventID = MarketEventID;
                    marketPersonBLL.Create(item);
                }
            }

            eventObj.MarketEventID = MarketEventID;
            eventObj.PersonCount   = obj.MarketPersonInfoList.Count;
            service.Update(eventObj, false);

            responseData.success = true;
            responseData.msg     = error;

            content = responseData.ToJSON();
            return(content);
        }
Esempio n. 3
0
        /// <summary>
        /// GetList
        /// </summary>
        /// <param name="entity">entity</param>
        /// <param name="Page">分页页码。从0开始</param>
        /// <param name="PageSize">每页的数量。未指定时默认为15</param>
        /// <returns></returns>
        public IList <MarketPersonEntity> GetList(MarketPersonEntity entity, int Page, int PageSize)
        {
            if (PageSize <= 0)
            {
                PageSize = 15;
            }

            IList <MarketPersonEntity> list = new List <MarketPersonEntity>();
            DataSet ds = new DataSet();

            ds = _currentDAO.GetList(entity, Page, PageSize);
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                list = DataTableToObject.ConvertToList <MarketPersonEntity>(ds.Tables[0]);
            }
            return(list);
        }
Esempio n. 4
0
        public MarketPersonEntity GetMarketPersonByEventID(string EventID, int Page, int PageSize)
        {
            MarketPersonEntity marketPersonInfo = new MarketPersonEntity();

            try
            {
                DataSet ds = new DataSet();
                ds = _currentDAO.GetMarketPersonByEventID(EventID, Page, PageSize);
                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                {
                    marketPersonInfo.vipInfoList = DataTableToObject.ConvertToList <VipEntity>(ds.Tables[0]);
                    marketPersonInfo.ICount      = _currentDAO.GetMarketPersonByEventIDCount(EventID);
                }
                return(marketPersonInfo);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }
Esempio n. 5
0
 public void Update(MarketPersonEntity pEntity, bool pIsUpdateNullField, IDbTransaction pTran)
 {
     _currentDAO.Update(pEntity, pIsUpdateNullField, pTran);
 }
Esempio n. 6
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 /// <param name="pTran">事务实例,可为null,如果为null,则不使用事务来更新</param>
 public void Update(MarketPersonEntity pEntity, IDbTransaction pTran)
 {
     Update(pEntity, true, pTran);
 }
Esempio n. 7
0
 /// <summary>
 /// 在事务内创建一个新实例
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 /// <param name="pTran">事务实例,可为null,如果为null,则不使用事务来更新</param>
 public void Create(MarketPersonEntity pEntity, IDbTransaction pTran)
 {
     _currentDAO.Create(pEntity, pTran);
 }
Esempio n. 8
0
 /// <summary>
 /// 创建一个新实例
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 public void Create(MarketPersonEntity pEntity)
 {
     _currentDAO.Create(pEntity);
 }
Esempio n. 9
0
 /// <summary>
 /// 分页根据实体条件查询实体
 /// </summary>
 /// <param name="pQueryEntity">以实体形式传入的参数</param>
 /// <param name="pOrderBys">排序组合</param>
 /// <returns>符合条件的实体集</returns>
 public PagedQueryResult <MarketPersonEntity> PagedQueryByEntity(MarketPersonEntity pQueryEntity, OrderBy[] pOrderBys, int pPageSize, int pCurrentPageIndex)
 {
     return(_currentDAO.PagedQueryByEntity(pQueryEntity, pOrderBys, pPageSize, pCurrentPageIndex));
 }
Esempio n. 10
0
 /// <summary>
 /// 根据实体条件查询实体
 /// </summary>
 /// <param name="pQueryEntity">以实体形式传入的参数</param>
 /// <param name="pOrderBys">排序组合</param>
 /// <returns>符合条件的实体集</returns>
 public MarketPersonEntity[] QueryByEntity(MarketPersonEntity pQueryEntity, OrderBy[] pOrderBys)
 {
     return(_currentDAO.QueryByEntity(pQueryEntity, pOrderBys));
 }
Esempio n. 11
0
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="pEntity"></param>
 public void Delete(MarketPersonEntity pEntity)
 {
     _currentDAO.Delete(pEntity);
 }
Esempio n. 12
0
 public void Update(MarketPersonEntity pEntity, bool pIsUpdateNullField)
 {
     _currentDAO.Update(pEntity, pIsUpdateNullField);
 }
Esempio n. 13
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 public void Update(MarketPersonEntity pEntity)
 {
     Update(pEntity, true);
 }
Esempio n. 14
0
 public void WebDelete(MarketPersonEntity entity)
 {
     _currentDAO.WebDelete(entity);
 }
Esempio n. 15
0
 /// <summary>
 /// GetListCount
 /// </summary>
 /// <param name="entity">entity</param>
 public int GetListCount(MarketPersonEntity entity)
 {
     return(_currentDAO.GetListCount(entity));
 }