/// <summary>
 /// 在线路中添加景点
 /// </summary>
 /// <param name="tour"></param>
 /// <returns></returns>
 public int AddTourPlanDetail(Sys_TourPlanDetail tour)
 {
     int count = 0;
     if (tour != null)
     {
         tourPlanDetailRepository.Add(tour);
         tourPlanDetailRepository.Uow.Commit();
         if (tour.PlanID > 0)
         {
             count = 1;
         }
     }
     return count;
 }
Exemple #2
0
 public JsonResult ClickAddSight(int ParkID, int PlanID, int Days)
 {
     //GetToutByName
     //Sys_TourPlanDto TourPlan = tourPlanService.GetTourPlanByName(Name);
     var data = SightInfo.GetSightByParkID(ParkID);
     Sys_TourPlanDetail tpd = new Sys_TourPlanDetail();
     tpd.SightIDOrHotelID = data.ParkID;
     tpd.CurrentPrice = data.Ticket;
     tpd.Remark = data.Title;
     tpd.VisitCount = data.VouchCount;
     tpd.AddTime = DateTime.Now;
     tpd.DayID = Days;
     tpd.DetailType = "sight";
     tpd.PlanID = PlanID;
     var IsExist = tourPlanDetailService.CheckTourPlanDetailIsExist(Convert.ToInt32(tpd.PlanID), Convert.ToInt32(tpd.SightIDOrHotelID), tpd.Remark);
     if (IsExist)
     {
         return Json(data, JsonRequestBehavior.AllowGet);
     }
     else
     {
         int count = tourPlanDetailService.AddTourPlanDetail(tpd);
         if (count < 0)
         {
             return Json(data, JsonRequestBehavior.AllowGet);
         }
         else
         {
             //success
         }
     }
     return Json(data, JsonRequestBehavior.AllowGet);
 }
 /// <summary>
 /// 创建新的 Sys_TourPlanDetail 对象。
 /// </summary>
 /// <param name="planDetailID">PlanDetailID 属性的初始值。</param>
 public static Sys_TourPlanDetail CreateSys_TourPlanDetail(global::System.Int32 planDetailID)
 {
     Sys_TourPlanDetail sys_TourPlanDetail = new Sys_TourPlanDetail();
     sys_TourPlanDetail.PlanDetailID = planDetailID;
     return sys_TourPlanDetail;
 }
 /// <summary>
 /// 用于向 Sys_TourPlanDetail EntitySet 添加新对象的方法,已弃用。请考虑改用关联的 ObjectSet&lt;T&gt; 属性的 .Add 方法。
 /// </summary>
 public void AddToSys_TourPlanDetail(Sys_TourPlanDetail sys_TourPlanDetail)
 {
     base.AddObject("Sys_TourPlanDetail", sys_TourPlanDetail);
 }