Esempio n. 1
0
        public ActionResult CreatePlan(FormCollection tour)
        {
            var    tp        = new Sys_TourPlan();
            var    tt        = new Infrastructure.Data.DataSys.Sys_TourPlan();
            string AddTime   = string.Empty;
            string Days      = string.Empty;
            string PlanTitle = string.Empty;
            string City      = string.Empty;

            if (tour != null)
            {
                if (tour["AddTime"] != null)
                {
                    tt.AddTime = Convert.ToDateTime(tour["AddTime"]);
                }
                if (tour["Days"] != null)
                {
                    tt.Days = Convert.ToInt32(tour["Days"]);
                }
                if (tour["City"] != null && tour["City"] != "输入目的地" && tour["City"] != "null")
                {
                    tt.Destination = tour["City"].ToString();
                }
                if (tour["PlanTitle"] != null && tour["PlanTitle"] != "输入行程名称" && tour["PlanTitle"] != "null")
                {
                    tt.PlanTitle = tour["PlanTitle"].ToString();
                    tt.Remark    = tour["PlanTitle"].ToString();
                }

                tt.IsDelete           = 0;
                tt.IsTop              = 0;
                tt.PlanClass          = null;
                tt.TempDataCreateHtml = null;
                tt.TopReason          = "";
                tt.TopTime            = null;
                tt.UserId             = 1;
                tt.UserName           = "******";
                tt.VisitCount         = 0;
                // checkTourPlanDetailIsExist() 是否用tourName 来验证单一
                tp = tourPlanService.AddTourPlan(tt);
                if (tt.PlanID < 0)
                {
                }
            }
            else
            {
            }
            return(RedirectToAction("plan", new { id = 1, PlanID = tp.PlanID }));
        }
Esempio n. 2
0
        public ActionResult Edit(FormCollection tour)
        {
            var    tp        = new Sys_TourPlan();
            var    tt        = new Infrastructure.Data.DataSys.Sys_TourPlan();
            string AddTime   = string.Empty;
            string Days      = string.Empty;
            string PlanTitle = string.Empty;
            string City      = string.Empty;
            string id        = string.Empty;

            if (tour != null)
            {
                #region 赋值一
                if (tour["AddTime"] != null)
                {
                    tt.AddTime = Convert.ToDateTime(tour["AddTime"]);
                }
                if (tour["Days"] != null)
                {
                    tt.Days = Convert.ToInt32(tour["Days"]);
                }
                if (tour["City"] != null)
                {
                    tt.Destination = tour["City"].ToString();
                }
                if (tour["PlanTitle"] != null)
                {
                    tt.PlanTitle = tour["PlanTitle"].ToString();
                    tt.Remark    = tour["PlanTitle"].ToString();
                }
                if (tour["id"] != null)
                {
                    tt.PlanID = Convert.ToInt32(tour["id"]);
                }
                tt.IsDelete  = 0;
                tt.IsTop     = 0;
                tt.TopReason = "";

                #endregion

                var model = tourPlanService.GetTourPlanByID(tt.PlanID);

                #region 赋值二
                model.PlanID             = tt.PlanID;
                model.AddTime            = tt.AddTime;
                model.Days               = tt.Days;
                model.Destination        = tt.Destination;
                model.IsDelete           = 0;
                model.IsTop              = 0;
                model.PlanClass          = null;
                model.PlanTitle          = tt.PlanTitle;
                model.Remark             = tt.PlanTitle;
                model.TempDataCreateHtml = null;
                model.TopReason          = "";
                model.TopTime            = null;
                model.UserId             = 1;      //这里  默认为1
                model.UserName           = "******"; //测试研发阶段
                model.VisitCount         = 0;
                #endregion

                tp = tourPlanService.UpdateTourPlan(model);
            }
            return(RedirectToAction("plan", new { id = 1, PlanID = tp.PlanID }));
        }
Esempio n. 3
0
        public ActionResult Edit(FormCollection tour)
        {
            var tp = new Sys_TourPlan();
            var tt = new Infrastructure.Data.DataSys.Sys_TourPlan();
            string AddTime = string.Empty;
            string Days = string.Empty;
            string PlanTitle = string.Empty;
            string City = string.Empty;
            string id = string.Empty;
            if (tour != null)
            {

                #region 赋值一
                if (tour["AddTime"] != null)
                {
                    tt.AddTime = Convert.ToDateTime(tour["AddTime"]);
                }
                if (tour["Days"] != null)
                {
                    tt.Days = Convert.ToInt32(tour["Days"]);
                }
                if (tour["City"] != null)
                {
                    tt.Destination = tour["City"].ToString();
                }
                if (tour["PlanTitle"] != null)
                {
                    tt.PlanTitle = tour["PlanTitle"].ToString();
                    tt.Remark = tour["PlanTitle"].ToString();
                }
                if (tour["id"] != null)
                {
                    tt.PlanID = Convert.ToInt32(tour["id"]);
                }
                tt.IsDelete = 0;
                tt.IsTop = 0;
                tt.TopReason = "";

                #endregion

                var model = tourPlanService.GetTourPlanByID(tt.PlanID);

                #region 赋值二
                model.PlanID = tt.PlanID;
                model.AddTime = tt.AddTime;
                model.Days = tt.Days;
                model.Destination = tt.Destination;
                model.IsDelete = 0;
                model.IsTop = 0;
                model.PlanClass = null;
                model.PlanTitle = tt.PlanTitle;
                model.Remark = tt.PlanTitle;
                model.TempDataCreateHtml = null;
                model.TopReason = "";
                model.TopTime = null;
                model.UserId = 1;    //这里  默认为1
                model.UserName = "******";   //测试研发阶段
                model.VisitCount = 0;
                #endregion

                tp = tourPlanService.UpdateTourPlan(model);
            }
            return RedirectToAction("plan", new { id = 1, PlanID = tp.PlanID });
        }
Esempio n. 4
0
        public ActionResult CreatePlan(FormCollection tour)
        {
            var tp = new Sys_TourPlan();
            var tt = new Infrastructure.Data.DataSys.Sys_TourPlan();
            string AddTime = string.Empty;
            string Days = string.Empty;
            string PlanTitle = string.Empty;
            string City = string.Empty;
            if (tour != null)
            {
                if (tour["AddTime"] != null)
                {
                    tt.AddTime = Convert.ToDateTime(tour["AddTime"]);
                }
                if (tour["Days"] != null)
                {
                    tt.Days = Convert.ToInt32(tour["Days"]);
                }
                if (tour["City"] != null && tour["City"] != "输入目的地" && tour["City"] != "null")
                {
                    tt.Destination = tour["City"].ToString();
                }
                if (tour["PlanTitle"] != null && tour["PlanTitle"] != "输入行程名称" && tour["PlanTitle"] != "null")
                {
                    tt.PlanTitle = tour["PlanTitle"].ToString();
                    tt.Remark = tour["PlanTitle"].ToString();
                }

                tt.IsDelete = 0;
                tt.IsTop = 0;
                tt.PlanClass = null;
                tt.TempDataCreateHtml = null;
                tt.TopReason = "";
                tt.TopTime = null;
                tt.UserId = 1;
                tt.UserName = "******";
                tt.VisitCount = 0;
                // checkTourPlanDetailIsExist() 是否用tourName 来验证单一
                tp = tourPlanService.AddTourPlan(tt);
                if (tt.PlanID < 0)
                { }
            }
            else
            { }
            return RedirectToAction("plan", new { id = 1, PlanID = tp.PlanID });
        }