예제 #1
0
        private string cancelReservation()
        {
            var respObj = new RespData();

            try
            {
                string reqContent = Request["ReqContent"];
                var    reqObj     = reqContent.DeserializeJSONTo <ReqContent>();
                var    service    = new ReservationServiceScheduleBLL(Default.GetLoggingSession());
                ReservationServiceScheduleEntity entity = service.GetByID(reqObj.Special.ReservationServiceScheduleID);
                if (entity != null && entity.VIPID.Equals(reqObj.Common.userId))
                {
                    //TODO:取消时的状态转换
                    entity.StatusID = 0;
                }
                service.Update(entity);
                respObj.code        = "200";
                respObj.description = "操作成功";
                ValidLogin(reqObj, respObj);
            }
            catch (Exception ex)
            {
                //throw ex;
                respObj.code        = "103";
                respObj.description = "数据库操作错误";
            }
            string content = respObj.ToJSON();

            return(content);
        }
예제 #2
0
        private string submitReservation()
        {
            var respObj = new RespData();

            try
            {
                string reqContent = Request["ReqContent"];
                var    reqObj     = reqContent.DeserializeJSONTo <ReqContent>();
                var    service    = new ReservationServiceScheduleBLL(Default.GetLoggingSession());
                ReservationServiceScheduleEntity entity = new ReservationServiceScheduleEntity();

                entity.ReserveDate = DateTime.Parse(reqObj.Special.currentDate);
                entity.ReservationServiceBigClassTermID   = int.Parse(reqObj.Special.reservationBigClassTermId);
                entity.ReservationServiceSmallClassTermID = int.Parse(reqObj.Special.reservationSmallClassTermId);
                entity.ReservationServiceID = int.Parse(reqObj.Special.reservationServiceId);
                entity.VIPID = reqObj.Common.userId;
                entity.ReservationServiceScheduleID = Guid.NewGuid().ToString().Replace("-", "");

                service.Create(entity);
                respObj.code        = "200";
                respObj.description = "操作成功";
                ValidLogin(reqObj, respObj);
            }
            catch (Exception ex)
            {
                //throw ex;
                respObj.code        = "103";
                respObj.description = "数据库操作错误";
            }
            string content = respObj.ToJSON();

            return(content);
        }
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 /// <param name="pTran">事务实例,可为null,如果为null,则不使用事务来更新</param>
 public void Update(ReservationServiceScheduleEntity pEntity, IDbTransaction pTran)
 {
     Update(pEntity, true, pTran);
 }
 public void Update(ReservationServiceScheduleEntity pEntity, bool pIsUpdateNullField, IDbTransaction pTran)
 {
     _currentDAO.Update(pEntity, pIsUpdateNullField, pTran);
 }
 /// <summary>
 /// 创建一个新实例
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 public void Create(ReservationServiceScheduleEntity pEntity)
 {
     _currentDAO.Create(pEntity);
 }
 /// <summary>
 /// 在事务内创建一个新实例
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 /// <param name="pTran">事务实例,可为null,如果为null,则不使用事务来更新</param>
 public void Create(ReservationServiceScheduleEntity pEntity, IDbTransaction pTran)
 {
     _currentDAO.Create(pEntity, pTran);
 }
 /// <summary>
 /// 分页根据实体条件查询实体
 /// </summary>
 /// <param name="pQueryEntity">以实体形式传入的参数</param>
 /// <param name="pOrderBys">排序组合</param>
 /// <returns>符合条件的实体集</returns>
 public PagedQueryResult <ReservationServiceScheduleEntity> PagedQueryByEntity(ReservationServiceScheduleEntity pQueryEntity, OrderBy[] pOrderBys, int pPageSize, int pCurrentPageIndex)
 {
     return(_currentDAO.PagedQueryByEntity(pQueryEntity, pOrderBys, pPageSize, pCurrentPageIndex));
 }
 /// <summary>
 /// 根据实体条件查询实体
 /// </summary>
 /// <param name="pQueryEntity">以实体形式传入的参数</param>
 /// <param name="pOrderBys">排序组合</param>
 /// <returns>符合条件的实体集</returns>
 public ReservationServiceScheduleEntity[] QueryByEntity(ReservationServiceScheduleEntity pQueryEntity, OrderBy[] pOrderBys)
 {
     return(_currentDAO.QueryByEntity(pQueryEntity, pOrderBys));
 }
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="pEntity"></param>
 public void Delete(ReservationServiceScheduleEntity pEntity)
 {
     _currentDAO.Delete(pEntity);
 }
 public void Update(ReservationServiceScheduleEntity pEntity, bool pIsUpdateNullField)
 {
     _currentDAO.Update(pEntity, pIsUpdateNullField);
 }
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 public void Update(ReservationServiceScheduleEntity pEntity)
 {
     Update(pEntity, true);
 }