/// <summary> /// 修改散拼计划 /// </summary> /// <param name="item">散拼实体</param> /// <returns></returns> public bool UpdatePowder(MPowderList item) { bool result = false; if (item != null) { item.StartCityName = BRoute.GetCityName(item.StartCity); item.EndCityName = BRoute.GetCityName(item.EndCity); item.ComeBackDate = item.LeaveDate.AddDays(item.Day); if (dal.UpdatePowder(item) > 0) { result = true; } } return(result); }
/// <summary> /// 添加散拼计划 /// </summary> /// <param name="item">散拼实体</param> /// <returns></returns> public bool AddPowder(MPowderList item) { bool result = false; if (item != null) { item.TourId = Guid.NewGuid().ToString(); item.StartCityName = BRoute.GetCityName(item.StartCity); item.EndCityName = BRoute.GetCityName(item.EndCity); item.ComeBackDate = item.LeaveDate.AddDays(item.Day); if (dal.AddPowder(item) > 0) { result = true; } } return(result); }