public virtual void CopyHomePlan(HomePlan copyPlan, string id)
        {
            if (copyPlan.IsDefault)
            {
                var defaultPlan = homePlanDao.QueryDefaultHomePlan(copyPlan.ID.ToString(), string.Empty, copyPlan.Format);
                defaultPlan.ForEach((x) => { x.IsDefault = false; });
                homePlanDao.UpdateList(defaultPlan);
            }
            IList<HomePlanDesign> designs = homePlanDesignDao.QueryHomePlanDesign(id);

            homePlanDao.Insert(copyPlan);
            designs.ForEach(x =>
            {
                x.PlanID = copyPlan.ID;
            });
            homePlanDesignDao.InsertList(designs);
        }
 public virtual void UpdateHomePlan(HomePlan homePlan)
 {
     if (homePlan.IsDefault)
     {
         var defaultPlan = homePlanDao.QueryDefaultHomePlan(homePlan.ID.ToString(), string.Empty, homePlan.Format);
         defaultPlan.ForEach((x) => { x.IsDefault = false; });
         homePlanDao.UpdateList(defaultPlan);
     }
     homePlanDao.Update(homePlan);
 }
 public JsonResult EditHomePlan(HomePlan plan)
 {
     JsonReturnMessages data = new JsonReturnMessages() { IsSuccess = true, Msg = "操作成功" };
     try
     {
         plan.UpdateTime = DateTime.Now;
         plan.UpdateUid = CurrentUser.UserUId;
         if (plan.ID <= 0)
         {//新增
             plan.CreateTime = DateTime.Now;
             plan.CreateUid = CurrentUser.UserUId;
             BoFactory.GetVersionTrackBo.InsertHomePlan(plan);
         }
         else
         {//修改
             BoFactory.GetVersionTrackBo.UpdateHomePlan(plan);
         }
     }
     catch (Exception ex)
     {
         Log4NetHelper.Error(ex);
         data.Msg = ex.Message;
         data.IsSuccess = false;
     }
     return Json(data);
 }
 public JsonResult CopyHomePlan(HomePlan copyPlan, string id)
 {
     JsonReturnMessages data = new JsonReturnMessages() { IsSuccess = true, Msg = "操作成功" };
     try
     {
         copyPlan.CreateTime = DateTime.Now;
         copyPlan.UpdateTime = DateTime.Now;
         copyPlan.CreateUid = CurrentUser.UserUId;
         copyPlan.UpdateUid = CurrentUser.UserUId;
         BoFactory.GetVersionTrackBo.CopyHomePlan(copyPlan, id);
     }
     catch (Exception ex)
     {
         Log4NetHelper.Error(ex);
         data.Msg = ex.Message;
         data.IsSuccess = false;
     }
     return Json(data);
 }
 public ActionResult EditHomePlan(string id)
 {
     HomePlan plan;
     if (string.IsNullOrEmpty(id))
     {//新增
         plan = new HomePlan();
     }
     else
     {//修改
         plan = BoFactory.GetVersionTrackBo.GetHomePlan(id);
     }
     return View(plan);
 }