public ActionResult Edit(FormCollection tour) { var tp = new Sys_TourPlan(); var tt = new Miaow.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 }); }
/// <summary> /// 创建新的 Sys_TourPlan 对象。 /// </summary> /// <param name="planID">PlanID 属性的初始值。</param> public static Sys_TourPlan CreateSys_TourPlan(global::System.Int32 planID) { Sys_TourPlan sys_TourPlan = new Sys_TourPlan(); sys_TourPlan.PlanID = planID; return sys_TourPlan; }
public ActionResult CreatePlan(FormCollection tour) { var tp = new Sys_TourPlan(); var tt = new Miaow.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 }); }
/// <summary> /// 用于向 Sys_TourPlan EntitySet 添加新对象的方法,已弃用。请考虑改用关联的 ObjectSet<T> 属性的 .Add 方法。 /// </summary> public void AddToSys_TourPlan(Sys_TourPlan sys_TourPlan) { base.AddObject("Sys_TourPlan", sys_TourPlan); }