コード例 #1
0
        public bool Modify(iPow.Infrastructure.Data.DataSys.Sys_TourPlanDetail entity, iPow.Infrastructure.Data.DataSys.Sys_AdminUser operUser)
        {
            var res = false;

            if (entity != null && entity.PlanDetailID > 0)
            {
                try
                {
                    tourPlanDetailRepository.Modify(entity);
                    res = true;
                }
                catch (Exception ex)
                {
                }
            }
            return(res);
        }
コード例 #2
0
        public ViewResult Create(int id, iPow.Presentation.account.Models.TourPlanDetailDto data)
        {
            if (data != null && ModelState.IsValid && id > 0)
            {
                var model = new iPow.Infrastructure.Data.DataSys.Sys_TourPlanDetail();
                model.AddTime      = System.DateTime.Now;
                model.CurrentPrice = data.CurrentPrice;
                model.DayID        = data.DayID;
                model.IsDelete     = 0;
                model.Remark       = data.Remark;
                model.VisitCount   = 0;

                model.PlanID = id;
                //model.PlanDetailID
                model.DetailType = data.DetailTypeName;//sight hotel other
                //data.TargetName 景区或酒店名字
                var sightOrHotelId = 0;
                if (string.Compare(data.DetailTypeName, "sight", false) == 0)
                {
                    var temp = sightInfoRepository.GetList(e => e.Title == data.TargetName).FirstOrDefault();
                    if (temp != null)
                    {
                        sightOrHotelId = temp.ParkID;
                    }
                }
                else if (string.Compare(data.DetailTypeName, "hotel", false) == 0)
                {
                    var temp = hotelPropertyInfoRepository.GetList(e => e.HotelName == data.TargetName).FirstOrDefault();
                    if (temp != null)
                    {
                        sightOrHotelId = (int)temp.HotelID;
                    }
                }
                else
                {
                }
                model.SightIDOrHotelID = sightOrHotelId;
                tourPlanDetailRepository.Add(model);
                tourPlanDetailRepository.Uow.Commit();
            }
            else
            {
                base.AddModelStateError();
            }
            return(View(data));
        }
コード例 #3
0
        public bool DeleteTrue(iPow.Infrastructure.Data.DataSys.Sys_TourPlanDetail entity, iPow.Infrastructure.Data.DataSys.Sys_AdminUser operUser)
        {
            var res = false;

            if (entity != null)
            {
                try
                {
                    tourPlanDetailRepository.Delete(entity);
                    tourPlanDetailRepository.Uow.Commit();
                    res = true;
                }
                catch (Exception ex)
                {
                }
            }
            return(res);
        }
コード例 #4
0
 public static iPow.Application.account.Dto.TourPlanDetailDto ToDto(this iPow.Infrastructure.Data.DataSys.Sys_TourPlanDetail entity)
 {
     return(EmitMapper.ObjectMapperManager.DefaultInstance
            .GetMapper <iPow.Infrastructure.Data.DataSys.Sys_TourPlanDetail, iPow.Application.account.Dto.TourPlanDetailDto>().Map(entity));
 }
コード例 #5
0
 public bool Delete(iPow.Infrastructure.Data.DataSys.Sys_TourPlanDetail entity, iPow.Infrastructure.Data.DataSys.Sys_AdminUser operUser)
 {
     throw new NotImplementedException();
 }
コード例 #6
0
        public ViewResult Create(int id, iPow.Presentation.account.Models.TourPlanDetailDto data)
        {
            if (data != null && ModelState.IsValid && id > 0)
            {
                var model = new iPow.Infrastructure.Data.DataSys.Sys_TourPlanDetail();
                model.AddTime = System.DateTime.Now;
                model.CurrentPrice = data.CurrentPrice;
                model.DayID = data.DayID;
                model.IsDelete = 0;
                model.Remark = data.Remark;
                model.VisitCount = 0;

                model.PlanID = id;
                //model.PlanDetailID
                model.DetailType = data.DetailTypeName;//sight hotel other
                //data.TargetName 景区或酒店名字
                var sightOrHotelId = 0;
                if (string.Compare(data.DetailTypeName, "sight", false) == 0)
                {
                    var temp = sightInfoRepository.GetList(e => e.Title == data.TargetName).FirstOrDefault();
                    if (temp != null)
                    {
                        sightOrHotelId = temp.ParkID;
                    }
                }
                else if (string.Compare(data.DetailTypeName, "hotel", false) == 0)
                {
                    var temp = hotelPropertyInfoRepository.GetList(e => e.HotelName == data.TargetName).FirstOrDefault();
                    if (temp != null)
                    {
                        sightOrHotelId = (int)temp.HotelID;
                    }
                }
                else { }
                model.SightIDOrHotelID = sightOrHotelId;
                tourPlanDetailRepository.Add(model);
                tourPlanDetailRepository.Uow.Commit();
            }
            else
            {
                base.AddModelStateError();
            }
            return View(data);
        }