/// <summary> /// 绑定数据源 /// </summary> private void BindSource(string tourId) { pageIndex = Utils.GetInt(Utils.GetQueryStringValue("Page"), 1); EyouSoft.Model.TourStructure.MSearchSupplierOrder search = new EyouSoft.Model.TourStructure.MSearchSupplierOrder(); search.CompanyId = SiteUserInfo.CompanyId; search.SourceId = SiteUserInfo.SourceCompanyInfo.CompanyId; search.TourId = tourId; search.OrderCode = Utils.GetQueryStringValue("txtOrderCode"); search.RouteName = Utils.GetQueryStringValue("txtRouteName"); search.AreaId = Utils.GetInt(Utils.GetQueryStringValue("ddlArea"), 0); search.BeginIssueTime = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("txtBeginIssueTime")); search.EndIssueTime = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("txtEndIssueTime")); search.BeginLDate = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("txtBeginLDate")); search.EndLDate = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("txtEndLDate")); search.Status = !string.IsNullOrEmpty(Utils.GetQueryStringValue("ddlOrderStatus")) ? (EyouSoft.Model.EnumType.TourStructure.OrderStatus?)Utils.GetInt(Utils.GetQueryStringValue("ddlOrderStatus")) : null; EyouSoft.BLL.TourStructure.BTourOrder bOrder = new EyouSoft.BLL.TourStructure.BTourOrder(); IList <EyouSoft.Model.TourStructure.MSupplierOrder> list = bOrder.GetOrderList(search, pageSize, pageIndex, ref recordCount); this.RpOrder.DataSource = list; this.RpOrder.DataBind(); BindPage(); }
/// <summary> /// 取消确认合同金额 /// </summary> void QuXiaoQueRenHeTongJinE() { if (!CheckGrant(EyouSoft.Model.EnumType.PrivsStructure.Privs.销售中心_销售收款_取消确认合同金额)) { RCWE(UtilsCommons.AjaxReturnJson("0", "你没有操作权限")); } string orderId = Utils.GetQueryStringValue("orderid"); int bllRetCode = new EyouSoft.BLL.TourStructure.BTourOrder().QuXiaoQueRenHeTongJinE(CurrentUserCompanyID, SiteUserInfo.UserId, orderId); if (bllRetCode == 1) { RCWE(UtilsCommons.AjaxReturnJson("1", "取消确认合同金额成功!")); } else if (bllRetCode == -99) { RCWE(UtilsCommons.AjaxReturnJson("0", "未确认合同金额或订单信息不存在!")); } else if (bllRetCode == -98) { RCWE(UtilsCommons.AjaxReturnJson("0", "计划已核算结束,不能取消确认合同金额!")); } else { RCWE(UtilsCommons.AjaxReturnJson("0", "操作失败")); } }
/// <summary> /// 保存 /// </summary> protected string PageSave() { string setMsg = string.Empty; //变更增加费用 备注 decimal addMoney = Utils.GetDecimal(Utils.GetFormValue(this.txtChangeAddMoney.UniqueID)); string addMoneyRemark = Utils.GetFormValue(this.txtChangeRemark.UniqueID); //变更减少费用 备注 decimal lessenMoney = Utils.GetDecimal(Utils.GetFormValue(this.txtChangelessonMoney.UniqueID)); string lessenRemark = Utils.GetFormValue(this.txtChangeRemarks.UniqueID); //确认金额 decimal comfirmMoney = Utils.GetDecimal(Utils.GetFormValue(this.hidComfirmMoney.UniqueID)); //金额变更说明 string changeEsplain = Utils.GetFormValue(this.txtchangeEsplain.UniqueID); //已支付金额 尚欠款金额 decimal payMoney = Utils.GetDecimal(Utils.GetFormValue(this.hidPayMoney.UniqueID)); decimal bedtMoney = Utils.GetDecimal(Utils.GetFormValue(this.txtDebtMoney.UniqueID)); //财务信息 string AccountId = Utils.GetFormValue("txt_AccountId"); //结算人 string settlementName = Utils.GetFormValue(this.txtSettlementName.UniqueID); EyouSoft.Model.TourStructure.MOrderSaleBase saleBase = new EyouSoft.Model.TourStructure.MOrderSaleBase(); saleBase.CheckMoney = payMoney; saleBase.CompanyId = this.SiteUserInfo.CompanyId; saleBase.ConfirmMoney = comfirmMoney; saleBase.ConfirmMoneyStatus = Utils.GetQueryStringValue("confirm") == "1"; saleBase.ConfirmPeople = this.SiteUserInfo.Name; saleBase.ConfirmPeopleId = this.SiteUserInfo.UserId; saleBase.ConfirmRemark = changeEsplain; saleBase.DeptId = this.SiteUserInfo.DeptId; saleBase.OrderId = Utils.GetQueryStringValue("OrderId"); saleBase.PayMentAccountId = Utils.GetInt(AccountId); //增加 减少的费用 备注 saleBase.SumPriceAddCost = addMoney; saleBase.SumPriceAddCostRemark = addMoneyRemark; saleBase.SumPriceReduceCost = lessenMoney; saleBase.SumPriceReduceCostRemark = lessenRemark; saleBase.TourId = Utils.GetQueryStringValue("tourId"); saleBase.SumPrice = Utils.GetDecimal(Utils.GetFormValue(this.hidAccountPrices.UniqueID)); EyouSoft.Model.TourStructure.MTourOrderChange orderChange = new EyouSoft.Model.TourStructure.MTourOrderChange(); orderChange.TourId = Utils.GetQueryStringValue("tourId"); orderChange.OrderId = Utils.GetQueryStringValue("OrderId"); orderChange.CompanyId = this.SiteUserInfo.CompanyId; bool result = new EyouSoft.BLL.TourStructure.BTourOrder().UpdateOrderSettlement(saleBase, orderChange); if (result) { setMsg = UtilsCommons.AjaxReturnJson("1", "合同金额确认成功!"); } else { setMsg = UtilsCommons.AjaxReturnJson("0", "合同金额确认失败!"); } return(setMsg); }
/// <summary> /// 初始化界面 /// </summary> /// <param name="orderId"></param> private void PageInit(string orderId) { EyouSoft.BLL.TourStructure.BTourOrder bOrder = new EyouSoft.BLL.TourStructure.BTourOrder(); EyouSoft.Model.TourStructure.MTourOrderExpand order = bOrder.GetTourOrderExpandByOrderId(orderId); if (order != null) { this.LtOrderCode.Text = order.OrderCode; this.LtSellerName.Text = order.SellerName; this.LtOperator.Text = order.Operator; this.LtAdults.Text = order.Adults.ToString(); this.LtChilds.Text = order.Childs.ToString(); this.LtAdultPrice.Text = EyouSoft.Common.UtilsCommons.GetMoneyString(order.AdultPrice, this.ProviderToMoney); this.LtChildPrice.Text = EyouSoft.Common.UtilsCommons.GetMoneyString(order.ChildPrice, this.ProviderToMoney); this.LtSaleAddCost.Text = EyouSoft.Common.UtilsCommons.GetMoneyString(order.SaleAddCost, this.ProviderToMoney); this.LtSaleAddCostRemark.Text = order.SaleAddCostRemark; this.LtSaleReduceCost.Text = EyouSoft.Common.UtilsCommons.GetMoneyString(order.SaleReduceCost, this.ProviderToMoney); this.LtSaleReduceCostRemark.Text = order.SaleReduceCostRemark; this.LtSumPrice.Text = EyouSoft.Common.UtilsCommons.GetMoneyString(order.SumPrice, this.ProviderToMoney); this.LtGuideIncome.Text = EyouSoft.Common.UtilsCommons.GetMoneyString(order.GuideIncome, this.ProviderToMoney); this.LtSalerIncome.Text = EyouSoft.Common.UtilsCommons.GetMoneyString(order.SalerIncome, this.ProviderToMoney); this.txtSaveSeatDate.Text = order.SaveSeatDate.HasValue ? order.SaveSeatDate.Value.ToString() : string.Empty; this.LtOrderRemark.Text = order.OrderRemark; if (order.MTourOrderTravellerList != null && order.MTourOrderTravellerList.Count != 0) { this.RpTravller.DataSource = order.MTourOrderTravellerList; this.RpTravller.DataBind(); } else { this.phTraveller.Visible = false; } switch (order.OrderStatus) { case EyouSoft.Model.EnumType.TourStructure.OrderStatus.未处理: case EyouSoft.Model.EnumType.TourStructure.OrderStatus.已留位: this.PhDo.Visible = true; break; default: this.PhDo.Visible = false; break; } //写入计调信息的TourId this.hfTourId.Value = order.TourId; this.hfAdults.Value = order.Adults.ToString(); this.hfChilds.Value = order.Childs.ToString(); this.hfConfirmSettlementMoney.Value = order.ConfirmSettlementMoney.ToString(); } }
private void PageInit(string orderId) { EyouSoft.BLL.TourStructure.BTourOrder bOrder = new EyouSoft.BLL.TourStructure.BTourOrder(); IList <EyouSoft.Model.TourStructure.MTourOrderSales> list = bOrder.GetTourOrderSalesListByOrderId(orderId, EyouSoft.Model.EnumType.TourStructure.CollectionRefundState.收款); this.RpIncome.DataSource = list; this.RpIncome.DataBind(); EyouSoft.Model.TourStructure.OrderMoney order = bOrder.GetOrderMoney(orderId); this.LtTotalReceived.Text = UtilsCommons.GetMoneyString(order.ConfirmMoney, this.ProviderToMoney); this.LtTotalSumPrice.Text = UtilsCommons.GetMoneyString(order.CheckMoney, this.ProviderToMoney); this.LtTotalUnReceived.Text = UtilsCommons.GetMoneyString(order.ConfirmMoney - order.CheckMoney + order.ReturnMoney, this.ProviderToMoney); }
/// <summary> /// 验证 /// </summary> /// <param name="sales"></param> /// <param name="msg"></param> /// <returns></returns> private bool ValidateForm(ref EyouSoft.Model.TourStructure.MTourOrderSales sales, ref string msg) { string id = EyouSoft.Common.Utils.GetFormValue("id"); if (!string.IsNullOrEmpty(id)) { EyouSoft.BLL.TourStructure.BTourOrder bOrder = new EyouSoft.BLL.TourStructure.BTourOrder(); sales = bOrder.GetTourOrderSalesById(id); } else { sales.OrderId = Utils.GetFormValue("OrderId"); } sales.CollectionRefundOperatorID = SiteUserInfo.UserId; sales.CollectionRefundOperator = SiteUserInfo.Name; sales.OperatorId = SiteUserInfo.UserId; sales.Operator = SiteUserInfo.Name; DateTime?collectionRefundDate = Utils.GetDateTimeNullable(Utils.GetFormValue("txt_collectionRefundDate")); if (!collectionRefundDate.HasValue) { msg += "付款时间格式不正确!<br/>"; } decimal collectionRefundAmount = Utils.GetDecimal(Utils.GetFormValue("txt_collectionRefundAmount")); if (collectionRefundAmount <= 0) { msg += "付款金额格式不正确!<br/>"; } int collectionRefundMode = Utils.GetInt(Utils.GetFormValue("ddl_CollectionRefundMode")); if (collectionRefundMode <= 0) { msg += "请选择付款方式!"; } sales.CollectionRefundDate = (collectionRefundDate); sales.CollectionRefundAmount = collectionRefundAmount; sales.CollectionRefundMode = collectionRefundMode; sales.CollectionRefundState = EyouSoft.Model.EnumType.TourStructure.CollectionRefundState.收款; sales.Memo = Utils.GetFormValue("txt_Memo"); sales.IsCheck = false; return(msg.Length <= 0); }
/// <summary> /// to xls /// </summary> void ToXls() { int toXlsRecordCount = UtilsCommons.GetToXlsRecordCount(); if (toXlsRecordCount < 1) { ResponseToXls(string.Empty); } MOrderSum orderSum = new MOrderSum(); IList <EyouSoft.Model.TourStructure.MTourOrder> items = null; if (!string.IsNullOrEmpty(Utils.GetQueryStringValue("plan")))//计调订单查询的订单为已成交订单 { items = new EyouSoft.BLL.TourStructure.BTourOrder().GetTourOrderListById(ref orderSum, TourId); } else { items = new EyouSoft.BLL.TourStructure.BTourOrder().GetTourOrderListById(TourId, ref orderSum); } if (items == null || items.Count == 0) { ResponseToXls(string.Empty); } StringBuilder s = new StringBuilder(); s.Append("订单号\t下单人\t销售员\t客源单位\t人数\t合计金额\t状态\t下单时间\t订单备注\n"); foreach (var item in items) { s.Append(item.OrderCode + "\t"); s.Append(item.Operator + "\t"); s.Append(item.SellerName + "\t"); s.Append(item.BuyCompanyName + "\t"); s.Append(item.Adults + "+" + item.Childs + "\t"); s.Append(item.ConfirmMoney.ToString("F2") + "\t"); s.Append(item.OrderStatus + "\t"); s.Append(item.IssueTime.Value.ToString("yyyy-MM-dd HH:mm") + "\t"); s.Append(item.OrderRemark.Replace("\t", " ").Replace("\r\n", " ") + "\n"); } ResponseToXls(s.ToString()); }
/// <summary> /// init rpt /// </summary> void InitRpt() { MOrderSum orderSum = new MOrderSum(); IList <EyouSoft.Model.TourStructure.MTourOrder> list = null; var model = new EyouSoft.BLL.TourStructure.BTour().GetTourInfo(Convert.ToString(TourId)); if (model != null) { tourtype = model.TourType == TourType.组团散拼短线 ? "短线" : ""; } if (!string.IsNullOrEmpty(Utils.GetQueryStringValue("plan")))//计调订单查询的订单为已成交订单 { list = new EyouSoft.BLL.TourStructure.BTourOrder().GetTourOrderListById(ref orderSum, TourId); } else { list = new EyouSoft.BLL.TourStructure.BTourOrder().GetTourOrderListById(TourId, ref orderSum); } if (list != null && list.Count > 0) { RecordCount = list.Count; this.rptList.DataSource = list; this.rptList.DataBind(); this.litMsg.Visible = false; } else { this.litMsg.Visible = true; if (tourtype == "短线") { this.litMsg.Text = "<tr><td align='center' colspan='11'>没有订单!</td></tr>"; } else { this.litMsg.Text = "<tr><td align='center' colspan='10'>没有订单!</td></tr>"; this.phUnset.Visible = false; } } list = null; orderSum = null; }
/// <summary> /// 导游收款 订单列表 /// </summary> /// <param name="tourID">团号</param> protected void GetOrderListBytourID(string tourID) { if (!string.IsNullOrEmpty(tourID)) { EyouSoft.Model.TourStructure.MOrderSum sum = new EyouSoft.Model.TourStructure.MOrderSum(); IList <EyouSoft.Model.TourStructure.MTourOrder> orders = new EyouSoft.BLL.TourStructure.BTourOrder().GetTourOrderListById(ref sum, tourID); if (orders != null && orders.Count > 0) { this.litsumPrices.Text = UtilsCommons.GetMoneyString(orders.Sum(p => p.GuideIncome), ProviderToMoney); this.repGuidPayment.DataSource = orders; this.repGuidPayment.DataBind(); } else { this.tabGuidPaymentView.Visible = false; } } }
/// <summary> /// 获取某个团下面的订单数 /// </summary> /// <param name="tourID">团号</param> protected void BindOrderList(string tourID) { EyouSoft.Model.TourStructure.MOrderSum orders = new EyouSoft.Model.TourStructure.MOrderSum(); IList <EyouSoft.Model.TourStructure.MTourOrder> items = new EyouSoft.BLL.TourStructure.BTourOrder().GetTourOrderListById(tourID, ref orders); if (items != null && items.Count > 0) { items = items.Where(c => c.OrderStatus == EyouSoft.Model.EnumType.TourStructure.OrderStatus.已成交).ToList(); } if (items != null && items.Count > 0) { phEmptyDingDan.Visible = false; repTourOrderList.DataSource = items; repTourOrderList.DataBind(); } else { phEmptyDingDan.Visible = true; } }
/// <summary> /// 修改订单状态 /// </summary> /// <param name="orderId"></param> /// <param name="status"></param> /// <returns></returns> private string DoUpdate(string orderId) { string msg = string.Empty; string strStatus = EyouSoft.Common.Utils.GetQueryStringValue("Status"); if (string.IsNullOrEmpty(strStatus)) { msg = EyouSoft.Common.UtilsCommons.AjaxReturnJson("0", "订单修改 失败!"); } else { EyouSoft.BLL.TourStructure.BTourOrder bOrder = new EyouSoft.BLL.TourStructure.BTourOrder(); if (bOrder.UpdateTourOrderExpand(orderId, (EyouSoft.Model.EnumType.TourStructure.OrderStatus) int.Parse(strStatus), null) == 1) { msg = EyouSoft.Common.UtilsCommons.AjaxReturnJson("1", "订单修改 成功!"); } else { msg = EyouSoft.Common.UtilsCommons.AjaxReturnJson("0", "订单修改 失败!"); } } return(msg); }
/// <summary> /// 初始化界面 /// </summary> /// <param name="orderId"></param> private void PageInit(string orderId, string type) { EyouSoft.BLL.TourStructure.BTourOrder bOrder = new EyouSoft.BLL.TourStructure.BTourOrder(); EyouSoft.Model.TourStructure.MTourOrderExpand order = bOrder.GetTourOrderExpandByOrderId(orderId); if (order != null) { this.LtOrderCode.Text = order.OrderCode; this.LtDCompanyName.Text = order.DCompanyName; this.LtDContactName.Text = order.DContactName; this.LtDContactTel.Text = order.DContactTel; this.LtSellerName.Text = order.SellerName; this.LtOperator.Text = order.Operator; this.LtAdults.Text = order.Adults.ToString(); this.LtChilds.Text = order.Childs.ToString(); this.LtAdultPrice.Text = EyouSoft.Common.UtilsCommons.GetMoneyString(order.AdultPrice, this.ProviderToMoney); this.LtChildPrice.Text = EyouSoft.Common.UtilsCommons.GetMoneyString(order.ChildPrice, this.ProviderToMoney); this.LtSaleAddCost.Text = EyouSoft.Common.UtilsCommons.GetMoneyString(order.SaleAddCost, this.ProviderToMoney); this.LtSaleAddCostRemark.Text = order.SaleAddCostRemark; this.LtSaleReduceCost.Text = EyouSoft.Common.UtilsCommons.GetMoneyString(order.SaleReduceCost, this.ProviderToMoney); this.LtSaleReduceCostRemark.Text = order.SaleReduceCostRemark; this.LtSumPrice.Text = EyouSoft.Common.UtilsCommons.GetMoneyString(order.SumPrice, this.ProviderToMoney); this.LtGuideIncome.Text = EyouSoft.Common.UtilsCommons.GetMoneyString(order.GuideIncome, this.ProviderToMoney); this.LtSalerIncome.Text = EyouSoft.Common.UtilsCommons.GetMoneyString(order.SalerIncome, this.ProviderToMoney); this.LtSaveSeatDate.Text = order.SaveSeatDate.HasValue ? order.SaveSeatDate.Value.ToString() : string.Empty; this.LtOrderRemark.Text = order.OrderRemark; EyouSoft.BLL.TourStructure.BTour bll = new EyouSoft.BLL.TourStructure.BTour(); EyouSoft.Model.TourStructure.MTourBaseInfo model = bll.GetTourInfo(Convert.ToString(tourID)); if (model.TourType == EyouSoft.Model.EnumType.TourStructure.TourType.组团散拼短线) { string CarLocation = string.Empty; if (order.TourOrderCarLocation != null) { CarLocation = order.TourOrderCarLocation.Location; } if (!string.IsNullOrEmpty(CarLocation)) { this.setCarLocation.Text = CarLocation; } else { this.setCarLocation.Text = "<font class='fontred'>未设置上车地点</font>"; } string carInfo = string.Empty; if (order.TourCarTypeList != null && order.TourCarTypeList.Count > 0) { for (int i = 0; i < order.TourCarTypeList.Count; i++) { if (i == order.TourCarTypeList.Count - 1) { carInfo += order.TourCarTypeList[i].CarTypeName; } else { carInfo += order.TourCarTypeList[i].CarTypeName + "、"; } } } if (!string.IsNullOrEmpty(carInfo)) { this.carInfo.Text = carInfo; } else { this.carInfo.Text = "<font class='fontred'>未设置车型</font>"; } } else { this.PhCarLocation.Visible = false; } if (order.MTourOrderTravellerList != null && order.MTourOrderTravellerList.Count != 0) { this.RpTravller.DataSource = order.MTourOrderTravellerList; this.RpTravller.DataBind(); } else { this.phTraveller.Visible = false; } } }