Ejemplo n.º 1
0
        /// <summary>
        /// 根据City  Create User DIY Tour
        /// </summary>
        /// <param name="tour"></param>
        public iPow.Infrastructure.Data.DataSys.Sys_TourPlan AddTourPlan(iPow.Infrastructure.Data.DataSys.Sys_TourPlan tour)
        {
            var data = new iPow.Infrastructure.Data.DataSys.Sys_TourPlan();

            data.AddTime            = tour.AddTime;
            data.Days               = tour.Days;
            data.Destination        = tour.Destination;
            data.IsDelete           = 0;
            data.IsTop              = 0;
            data.PlanClass          = null;
            data.PlanTitle          = tour.PlanTitle;
            data.Remark             = tour.PlanTitle;
            data.TempDataCreateHtml = null;
            data.TopReason          = "";
            data.TopTime            = null;
            data.UserId             = tour.UserId;
            data.UserName           = tour.UserName;
            data.VisitCount         = 0;
            try
            {
                tourPlanRepository.Add(data);
                tourPlanRepository.Uow.Commit();
            }
            catch (Exception)
            {
                throw new ArgumentException("添加失败!");
            }
            iPow.Infrastructure.Data.DataSys.Sys_TourPlan res = tourPlanRepository.GetList(e => e.PlanTitle == tour.PlanTitle).First();
            return(res);
        }
Ejemplo n.º 2
0
        public bool Add(iPow.Infrastructure.Data.DataSys.Sys_TourPlan enitty, iPow.Infrastructure.Data.DataSys.Sys_AdminUser operUser)
        {
            var res = false;

            if (enitty != null)
            {
                try
                {
                    tourPlanRepository.Add(enitty);
                    tourPlanRepository.Uow.Commit();
                    res = true;
                }
                catch (Exception ex)
                {
                }
            }
            return(res);
        }
Ejemplo n.º 3
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));
            }
        }