示例#1
0
        public JsonResult EditPlan(iPow.Domain.Dto.Sys_TourPlanDto tour)
        {
            try
            {
                if (tour != null && tour.PlanID > 0)
                {
                    var model = this.SysSingleTourPlan(tour.PlanID);
                    model.PlanTitle   = tour.PlanTitle;
                    model.PlanClass   = tour.PlanClass;
                    model.Days        = tour.Days;
                    model.Destination = tour.Destination;
                    model.Remark      = tour.Remark;
                    tourPlanRepository.Uow.Commit();
                }
            }
            catch
            {
            }
            var dto  = this.CurrentUserTourPlan().ToDto().OrderByDescending(e => e.AddTime);
            var data = new GridModel <iPow.Domain.Dto.Sys_TourPlanDto>
            {
                Data  = dto,
                Total = dto.Count()
            };

            return(new JsonResult {
                Data = data, JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
示例#2
0
        public ViewResult CreatePlan(iPow.Domain.Dto.Sys_TourPlanDto tour)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(View(tour));
                }
                else
                {
                    var data = new iPow.Infrastructure.Data.DataSys.Sys_TourPlan();
                    data.AddTime            = System.DateTime.Now;
                    data.Days               = tour.Days;
                    data.Destination        = tour.Destination;
                    data.IsDelete           = 0;
                    data.IsTop              = 0;
                    data.PlanClass          = tour.PlanClass;
                    data.PlanTitle          = tour.PlanTitle;
                    data.Remark             = tour.Remark;
                    data.TempDataCreateHtml = tour.TempDataCreateHtml;
                    data.TopReason          = "";
                    data.TopTime            = null;
                    data.UserId             = tour.UserId;
                    data.UserName           = tour.UserName;
                    data.VisitCount         = 0;
                    tourPlanRepository.Add(data);
                    tourPlanRepository.Uow.Commit();
                }



                return(View(new GridModel(this.CurrentUserTourPlan())));
            }
            catch
            {
                return(View(tour));
            }
        }