/// <summary> /// 安排地接 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool AddTravel(LocalTravelAgencyInfo model) { string id = Guid.NewGuid().ToString(); model.ID = id; model.TotalAmount = model.Settlement; if (dal.RanguageTravel(model)) { //添加支出明细 AddStatAllOut(model); //重新计算团队支出 EyouSoft.BLL.UtilityStructure.Utility u = new EyouSoft.BLL.UtilityStructure.Utility(); IList <EyouSoft.Model.StatisticStructure.ItemIdAndType> iList = new List <EyouSoft.Model.StatisticStructure.ItemIdAndType>(); iList.Add(new EyouSoft.Model.StatisticStructure.ItemIdAndType() { ItemId = model.ID, ItemType = EyouSoft.Model.EnumType.StatisticStructure.PaidType.地接支出 }); //价格维护 u.CalculationTourOut(model.TourId, iList); //加日志 //AddSysLog("新增"); //维护地接社交易数量 if (model.TravelAgencyID > 0) { u.ServerTradeCount(model.TravelAgencyID); } u.CalculationTourSettleStatus(model.TourId); #region LGWR EyouSoft.Model.EnumType.TourStructure.TourType? tourType = new EyouSoft.BLL.TourStructure.Tour().GetTourType(model.TourId); Model.EnumType.CompanyStructure.SysPermissionClass mokuai = EyouSoft.Model.EnumType.CompanyStructure.SysPermissionClass.散拼计划_散拼计划; if (tourType != null && tourType == EyouSoft.Model.EnumType.TourStructure.TourType.团队计划) { mokuai = EyouSoft.Model.EnumType.CompanyStructure.SysPermissionClass.团队计划_团队计划; } EyouSoft.Model.CompanyStructure.SysHandleLogs logInfo = new EyouSoft.Model.CompanyStructure.SysHandleLogs(); logInfo.CompanyId = 0; logInfo.DepatId = 0; logInfo.EventCode = EyouSoft.Model.CompanyStructure.SysHandleLogsNO.EventCode; logInfo.EventIp = string.Empty; logInfo.EventMessage = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "{0}在" + mokuai.ToString() + "新增了地接安排,安排编号:" + model.ID + ",计划编号为:" + model.TourId; logInfo.EventTime = DateTime.Now; logInfo.EventTitle = "新增地接安排"; logInfo.ModuleId = mokuai; logInfo.OperatorId = 0; this.Logwr(logInfo); #endregion return(true); } return(false); }
/// <summary> /// 删除地接 /// </summary> /// <param name="TravelId">安排地接编号</param> /// <returns></returns> public bool DelTravelAgency(string TravelId) { EyouSoft.Model.PlanStructure.LocalTravelAgencyInfo modelTravel = GetTravelModel(TravelId); if (dal.DeletTravelModel(TravelId)) { //加日志 //AddSysLog("删除"); //维护地接社交易数量 if (modelTravel != null) { EyouSoft.BLL.CompanyStructure.CompanySupplier bllSuplier = new EyouSoft.BLL.CompanyStructure.CompanySupplier();// EyouSoft.BLL.CompanyStructure.CompanySupplier(); EyouSoft.Model.CompanyStructure.CompanySupplier Model = bllSuplier.GetModel(modelTravel.TravelAgencyID, modelTravel.CompanyId); if (Model != null && Model.Id > 0) { EyouSoft.BLL.UtilityStructure.Utility idal = new EyouSoft.BLL.UtilityStructure.Utility(); idal.ServerTradeCount(new int[] { Model.Id }); } //重新计算团队支出 EyouSoft.BLL.UtilityStructure.Utility u = new EyouSoft.BLL.UtilityStructure.Utility(); //价格维护 u.CalculationTourOut(modelTravel.TourId, null); #region LGWR EyouSoft.Model.EnumType.TourStructure.TourType? tourType = new EyouSoft.BLL.TourStructure.Tour().GetTourType(modelTravel.TourId); Model.EnumType.CompanyStructure.SysPermissionClass mokuai = EyouSoft.Model.EnumType.CompanyStructure.SysPermissionClass.散拼计划_散拼计划; if (tourType != null && tourType == EyouSoft.Model.EnumType.TourStructure.TourType.团队计划) { mokuai = EyouSoft.Model.EnumType.CompanyStructure.SysPermissionClass.团队计划_团队计划; } EyouSoft.Model.CompanyStructure.SysHandleLogs logInfo = new EyouSoft.Model.CompanyStructure.SysHandleLogs(); logInfo.CompanyId = 0; logInfo.DepatId = 0; logInfo.EventCode = EyouSoft.Model.CompanyStructure.SysHandleLogsNO.EventCode; logInfo.EventIp = string.Empty; logInfo.EventMessage = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "{0}在" + mokuai.ToString() + "删除了地接安排,安排编号:" + modelTravel.ID + ",计划编号为:" + modelTravel.TourId; logInfo.EventTime = DateTime.Now; logInfo.EventTitle = "删除地接安排"; logInfo.ModuleId = mokuai; logInfo.OperatorId = 0; this.Logwr(logInfo); #endregion return(true); } } return(false); }
/*/// <summary> * /// 修改机票地接社支出金额 * /// </summary> * /// <param name="TravelId">团队编号</param> * /// <returns></returns> * public bool UpdateSettle(PaymentList Model) * { * if (dal.UpdateSettle(Model)) * { //加日志 * AddSysLog("修改机票地接社支出金额"); * return true; * } * return false; * }*/ /// <summary> /// 修改机票地接社支出金额 /// </summary> /// <param name="ModelList">更改实体</param> /// <param name="TourId">团队编号</param> /// <returns></returns> public bool UpdateSettle(IList <PaymentList> ModelList, string TourId) { foreach (PaymentList model in ModelList) { dal.UpdateSettle(model); } //加日志 //AddSysLog("修改机票地接社支出金额"); EyouSoft.BLL.UtilityStructure.Utility u = new EyouSoft.BLL.UtilityStructure.Utility(); u.CalculationTourOut(TourId, null); u.CalculationTourSettleStatus(TourId); EyouSoft.Model.EnumType.TourStructure.TourType? tourType = new EyouSoft.BLL.TourStructure.Tour().GetTourType(TourId); Model.EnumType.CompanyStructure.SysPermissionClass mokuai = EyouSoft.Model.EnumType.CompanyStructure.SysPermissionClass.散拼计划_散拼计划; if (tourType != null && tourType == EyouSoft.Model.EnumType.TourStructure.TourType.团队计划) { mokuai = EyouSoft.Model.EnumType.CompanyStructure.SysPermissionClass.团队计划_团队计划; } foreach (var item in ModelList) { EyouSoft.Model.CompanyStructure.SysHandleLogs logInfo = new EyouSoft.Model.CompanyStructure.SysHandleLogs(); logInfo.CompanyId = 0; logInfo.DepatId = 0; logInfo.EventCode = EyouSoft.Model.CompanyStructure.SysHandleLogsNO.EventCode; logInfo.EventIp = string.Empty; logInfo.EventMessage = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "{0}在" + mokuai.ToString() + "团队核算修改了" + item.SupplierType.ToString() + "支出金额,支出项目编号为:" + item.Id + ",计划编号为:" + TourId; logInfo.EventTime = DateTime.Now; logInfo.EventTitle = "团队核算修改支出金额"; logInfo.ModuleId = mokuai; logInfo.OperatorId = 0; this.Logwr(logInfo); } return(true); }
/// <summary> /// 修改地接 /// </summary> /// <param name="Model"></param> /// <returns></returns> public bool UpdateTravelAgency(EyouSoft.Model.PlanStructure.LocalTravelAgencyInfo Model) { if (dal.UpdateTravelModel(Model)) { //重新计算团队支出 EyouSoft.BLL.UtilityStructure.Utility u = new EyouSoft.BLL.UtilityStructure.Utility(); IList <EyouSoft.Model.StatisticStructure.ItemIdAndType> iList = new List <EyouSoft.Model.StatisticStructure.ItemIdAndType>(); iList.Add(new EyouSoft.Model.StatisticStructure.ItemIdAndType() { ItemId = Model.ID, ItemType = EyouSoft.Model.EnumType.StatisticStructure.PaidType.地接支出 }); //价格维护 u.CalculationTourOut(Model.TourId, iList); //加日志 //AddSysLog("修改"); //维护地接社交易数量 if (Model.TravelAgencyID > 0) { EyouSoft.Model.PlanStructure.LocalTravelAgencyInfo tempModel = GetTravelModel(Model.ID); if (tempModel != null) { u.ServerTradeCount(new int[] { Model.TravelAgencyID, tempModel.TravelAgencyID }); } } u.CalculationTourSettleStatus(Model.TourId); #region LGWR EyouSoft.Model.EnumType.TourStructure.TourType? tourType = new EyouSoft.BLL.TourStructure.Tour().GetTourType(Model.TourId); Model.EnumType.CompanyStructure.SysPermissionClass mokuai = EyouSoft.Model.EnumType.CompanyStructure.SysPermissionClass.散拼计划_散拼计划; if (tourType != null && tourType == EyouSoft.Model.EnumType.TourStructure.TourType.团队计划) { mokuai = EyouSoft.Model.EnumType.CompanyStructure.SysPermissionClass.团队计划_团队计划; } EyouSoft.Model.CompanyStructure.SysHandleLogs logInfo = new EyouSoft.Model.CompanyStructure.SysHandleLogs(); logInfo.CompanyId = 0; logInfo.DepatId = 0; logInfo.EventCode = EyouSoft.Model.CompanyStructure.SysHandleLogsNO.EventCode; logInfo.EventIp = string.Empty; logInfo.EventMessage = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "{0}在" + mokuai.ToString() + "修改了地接安排,安排编号:" + Model.ID + ",计划编号为:" + Model.TourId; logInfo.EventTime = DateTime.Now; logInfo.EventTitle = "修改地接安排"; logInfo.ModuleId = mokuai; logInfo.OperatorId = 0; this.Logwr(logInfo); #endregion return(true); } return(false); }