/// <summary> /// 根据团队编号获取其他列表 /// </summary> /// <param name="TourId">团队编号</param> /// <param name="CompanyId">公司ID</param> /// <returns>true:成功,false:失败</returns> public IList <EyouSoft.Model.PlanStructure.MPlanBaseInfo> GetOtherList(string TourId, string CompanyId) { StringBuilder strSql = new StringBuilder(); strSql.Append(" select PlanId,TourId,SourceId,SourceName,PlanCost,PaymentType,Status"); strSql.Append(" from tbl_Plan"); strSql.Append(" where [Type]=13 and TourId=@TourId and CompanyId=@CompanyId"); DbCommand cmd = db.GetSqlStringCommand(strSql.ToString()); db.AddInParameter(cmd, "TourId", DbType.String, TourId); db.AddInParameter(cmd, "CompanyId", DbType.String, CompanyId); IList <EyouSoft.Model.PlanStructure.MPlanBaseInfo> list = new List <EyouSoft.Model.PlanStructure.MPlanBaseInfo>(); EyouSoft.Model.PlanStructure.MPlanBaseInfo model = null; using (IDataReader reader = DbHelper.ExecuteReader(cmd, db)) { while (reader.Read()) { model = new EyouSoft.Model.PlanStructure.MPlanBaseInfo() { PlanId = reader["PlanId"].ToString(), TourId = reader.IsDBNull(reader.GetOrdinal("TourId")) ? string.Empty : reader["TourId"].ToString(), SourceId = reader.IsDBNull(reader.GetOrdinal("SourceId")) ? string.Empty : reader["SourceId"].ToString(), SourceName = reader.IsDBNull(reader.GetOrdinal("SourceName")) ? string.Empty : reader["SourceName"].ToString(), PlanCost = reader.GetDecimal(reader.GetOrdinal("PlanCost")), PaymentType = (EyouSoft.Model.EnumType.PlanStructure.Payment)reader.GetByte(reader.GetOrdinal("PaymentType")), Status = (EyouSoft.Model.EnumType.PlanStructure.PlanState)reader.GetByte(reader.GetOrdinal("Status")), }; list.Add(model); model = null; } reader.Close(); } return(list); }
/// <summary> /// init info /// </summary> void InitInfo() { var info = new EyouSoft.BLL.TourStructure.BSingleService().GetSingleServiceExtendByTourId(TourId); if (info == null) { Utils.RCWE("异常请求"); } if (info.CompanyId != SiteUserInfo.CompanyId) { Utils.RCWE("异常请求"); } if (info.PlanBaseInfoList == null || info.PlanBaseInfoList.Count == 0) { Utils.RCWE("异常请求:不存在的供应商安排"); } txtCompanyName.Text = SiteUserInfo.CompanyName; txtXiaoShouYuanName.Text = info.SellerName; var xiaoShouYuanInfo = new EyouSoft.BLL.ComStructure.BComUser().GetModel(info.SellerId, SiteUserInfo.CompanyId); if (xiaoShouYuanInfo != null) { txtXiaoShouYuanTelephone.Text = xiaoShouYuanInfo.ContactTel; txtXiaoShouYuanFax.Text = xiaoShouYuanInfo.ContactFax; } ltrTourCode.Text = info.TourCode; EyouSoft.Model.PlanStructure.MPlanBaseInfo anPaiInfo = null; foreach (var item in info.PlanBaseInfoList) { if (item.PlanId == AnPaiId) { anPaiInfo = item; break; } } if (anPaiInfo == null) { Utils.RCWE("异常请求:不存在的供应商安排"); } ltrJuTiAnPai.Text = Utils.TextareaToHTML(anPaiInfo.GuideNotes); ltrFeiYongMingXi.Text = Utils.TextareaToHTML(anPaiInfo.CostDetail); ltrShuLiang.Text = anPaiInfo.Num.ToString(); ltrZhiFuFangShi.Text = anPaiInfo.PaymentType.ToString(); ltrJieSuanJinE.Text = anPaiInfo.Confirmation.ToString("C2"); txtGysName.Text = anPaiInfo.SourceName; txtGysLxr.Text = anPaiInfo.ContactName; txtGysTelephone.Text = anPaiInfo.ContactPhone; txtGysFax.Text = anPaiInfo.ContactFax; ltrQianFaRiQi.Text = DateTime.Now.ToString("yyyy-MM-dd"); }
/// <summary> /// 根据计调ID获取其他实体 /// </summary> /// <param name="PlanID">计调ID</param> /// <returns>返回其他实体</returns> public EyouSoft.Model.PlanStructure.MPlanBaseInfo GetOtherModel(string PlanID) { StringBuilder strSql = new StringBuilder(); strSql.Append(" select " + strPlan + ""); strSql.Append(" from tbl_Plan"); strSql.Append(" where [Type]=13 and PlanId=@PlanId"); EyouSoft.Model.PlanStructure.MPlanBaseInfo model = null; DbCommand cmd = db.GetSqlStringCommand(strSql.ToString()); db.AddInParameter(cmd, "PlanID", DbType.String, PlanID); using (IDataReader reader = DbHelper.ExecuteReader(cmd, db)) { while (reader.Read()) { model = new EyouSoft.Model.PlanStructure.MPlanBaseInfo() { CompanyId = reader["CompanyId"].ToString(), Confirmation = reader.GetDecimal(reader.GetOrdinal("Confirmation")), CostId = reader.IsDBNull(reader.GetOrdinal("CostId")) ? string.Empty : reader["CostId"].ToString(), CostRemarks = reader.IsDBNull(reader.GetOrdinal("CostRemarks")) ? string.Empty : reader["CostRemarks"].ToString(), CostTime = reader.IsDBNull(reader.GetOrdinal("CostTime")) ? DateTime.MinValue : reader.GetDateTime(reader.GetOrdinal("CostTime")), FinRemark = reader.IsDBNull(reader.GetOrdinal("FinRemark")) ? string.Empty : reader["FinRemark"].ToString(), GuideCut = reader.GetDecimal(reader.GetOrdinal("GuideCut")), GuideNotes = reader.IsDBNull(reader.GetOrdinal("GuideNotes")) ? string.Empty : reader["GuideNotes"].ToString(), GuidePlus = reader.GetDecimal(reader.GetOrdinal("GuidePlus")), IsOut = reader["IsOut"].ToString() == "1" ? true : false, IsRebate = reader["IsRebate"].ToString() == "1" ? true : false, OperatorID = reader.IsDBNull(reader.GetOrdinal("OperatorID")) ? string.Empty : reader["OperatorID"].ToString(), OperatorName = reader.IsDBNull(reader.GetOrdinal("OperatorName")) ? string.Empty : reader["OperatorName"].ToString(), PaymentType = (EyouSoft.Model.EnumType.PlanStructure.Payment)reader.GetByte(reader.GetOrdinal("PaymentType")), PlanCost = reader.GetDecimal(reader.GetOrdinal("PlanCost")), PlanerCut = reader.GetDecimal(reader.GetOrdinal("PlanerCut")), PlanerPlus = reader.GetDecimal(reader.GetOrdinal("PlanerPlus")), PlanId = reader["PlanId"].ToString(), Prepaid = reader.GetDecimal(reader.GetOrdinal("Prepaid")), Remarks = reader.IsDBNull(reader.GetOrdinal("Remarks")) ? string.Empty : reader["Remarks"].ToString(), SaleCut = reader.GetDecimal(reader.GetOrdinal("SaleCut")), SalePlus = reader.GetDecimal(reader.GetOrdinal("SalePlus")), SourceId = reader.IsDBNull(reader.GetOrdinal("SourceId")) ? string.Empty : reader["SourceId"].ToString(), SourceName = reader.IsDBNull(reader.GetOrdinal("SourceName")) ? string.Empty : reader["SourceName"].ToString(), AddStatus = (EyouSoft.Model.EnumType.PlanStructure.PlanAddStatus)reader.GetByte(reader.GetOrdinal("AddStatus")), Status = (EyouSoft.Model.EnumType.PlanStructure.PlanState)reader.GetByte(reader.GetOrdinal("Status")), SueId = reader.IsDBNull(reader.GetOrdinal("SueId")) ? string.Empty : reader["SueId"].ToString(), TotalCosts = reader.GetDecimal(reader.GetOrdinal("TotalCosts")), TourId = reader.IsDBNull(reader.GetOrdinal("TourId")) ? string.Empty : reader["TourId"].ToString(), Type = (EyouSoft.Model.EnumType.PlanStructure.PlanProject)reader.GetByte(reader.GetOrdinal("Type")), IssueTime = reader.GetDateTime(reader.GetOrdinal("IssueTime")), }; } reader.Close(); } return(model); }
/// <summary> /// 添加or更新 /// </summary> /// <param name="model">导游实体</param> /// <param name="isAdd">添加true,更新false</param> /// <returns></returns> private bool OtherAddOrUpdate(EyouSoft.Model.PlanStructure.MPlanBaseInfo model, bool isAdd) { bool IsResult = false; if (model != null) { DbCommand cmd = null; if (isAdd) { cmd = db.GetStoredProcCommand("proc_PlanOther_Add"); db.AddInParameter(cmd, "PlanId", DbType.String, System.Guid.NewGuid().ToString()); db.AddInParameter(cmd, "CompanyId", DbType.String, model.CompanyId); db.AddInParameter(cmd, "TourId", DbType.String, model.TourId); db.AddInParameter(cmd, "AddStatus", DbType.AnsiStringFixedLength, (int)model.AddStatus); } else { cmd = db.GetStoredProcCommand("proc_PlanOther_Update"); db.AddInParameter(cmd, "PlanId", DbType.String, model.PlanId); } db.AddInParameter(cmd, "SourceId", DbType.String, model.SourceId); db.AddInParameter(cmd, "SourceName", DbType.String, model.SourceName); db.AddInParameter(cmd, "PlanCost", DbType.Decimal, model.PlanCost); db.AddInParameter(cmd, "PaymentType", DbType.AnsiStringFixedLength, model.PaymentType); db.AddInParameter(cmd, "Status", DbType.AnsiStringFixedLength, model.Status); db.AddInParameter(cmd, "GuideNotes", DbType.String, model.GuideNotes); db.AddInParameter(cmd, "Remarks", DbType.String, model.Remarks); db.AddInParameter(cmd, "OperatorId", DbType.String, model.OperatorID); db.AddInParameter(cmd, "OperatorName", DbType.String, model.OperatorName); db.AddInParameter(cmd, "TotalCosts", DbType.Decimal, model.TotalCosts); db.AddOutParameter(cmd, "IsResult", DbType.Int32, 4); DbHelper.RunProcedure(cmd, db); IsResult = Convert.ToInt32(db.GetParameterValue(cmd, "IsResult")) == 1 ? true : false; } return(IsResult); }
void PageSave() { #region 表单赋值 string message = string.Empty; string seterrorMsg = string.Empty; //出票点 string votesID = Utils.GetFormValue(this.supplierControl1.ClientValue); //出票点id string votesName = Utils.GetFormValue(this.supplierControl1.ClientText); //联系人 电话 传真 string contectName = Utils.GetFormValue(this.txtContentName.UniqueID); string contectPhone = Utils.GetFormValue(this.txtContentPhone.UniqueID); string contectFax = Utils.GetFormValue(this.txtContentFax.UniqueID); //出发时间 出发地 目的地 航班号 string[] startdate = Utils.GetFormValues("txtstartTime"); //string[] startTime = Utils.GetFormValues("txtstartHours"); string[] startPlace = Utils.GetFormValues("txtstartPlace"); string[] endplace = Utils.GetFormValues("txtendPlace"); string[] filghtNum = Utils.GetFormValues("txtFilghtnumbers"); //舱位 乘客类型 人数 价格 保险 机建费 附加费 折扣 小计 string[] seleSpaceType = Utils.GetFormValues("seleSpaceType"); string[] Passengerstype = Utils.GetFormValues("Passengerstype"); string[] peopleNums = Utils.GetFormValues("txtpeopleNums"); string[] prices = Utils.GetFormValues("txtprices"); //string[] Insurance = Utils.GetFormValues("txtInsurance"); //string[] jiJianFei = Utils.GetFormValues("txtjiJianFei"); //string[] FujiaFei = Utils.GetFormValues("txtFujiaFei"); //string[] Zekou = Utils.GetFormValues("txtZekou"); string[] TotalPrices = Utils.GetFormValues("txtXiaoJi"); string[] txtFeiJiHangBanBeiZhu = Utils.GetFormValues("txtFeiJiHangBanBeiZhu"); //结算费用 费用明细 decimal totalPrices = Utils.GetDecimal(Utils.GetFormValue(this.txtCostAccount.UniqueID)); string costDetail = Utils.GetFormValue(this.txtCostParticu.UniqueID); //导游需知 其它备注 string guidNotes = Utils.GetFormValue(this.txtGuidNotes.UniqueID); string otherRemark = Utils.GetFormValue(this.txtOtherMark.UniqueID); #endregion #region 验证 if (string.IsNullOrEmpty(votesID) && string.IsNullOrEmpty(votesName)) { message += "请选择出票点!<br/>"; } if (startdate.Length > 0) { for (int i = 0; i < startdate.Length; i++) { if (string.IsNullOrEmpty(startdate[i])) { message += "*请选择出发日期!<br/>"; } } } /*if (startTime.Length > 0) * { * for (int i = 0; i < startTime.Length; i++) * { * if (string.IsNullOrEmpty(startTime[i])) * { * message += "*请输入出发时间!<br/>"; * } * } * } * if (startPlace.Length > 0) * { * for (int i = 0; i < startPlace.Length; i++) * { * if (string.IsNullOrEmpty(startPlace[i])) * { * message += "*请输入出发地!<br/>"; * } * } * } * if (endplace.Length > 0) * { * for (int i = 0; i < startPlace.Length; i++) * { * if (string.IsNullOrEmpty(endplace[i])) * { * message += "*请输入目的地!<br/>"; * } * } * } * if (filghtNum.Length > 0) * { * for (int i = 0; i < filghtNum.Length; i++) * { * if (string.IsNullOrEmpty(filghtNum[i])) * { * message += "*请输入航班号!<br/>"; * } * } * } * * if (seleSpaceType.Length > 0) * { * for (int i = 0; i < seleSpaceType.Length; i++) * { * if (string.IsNullOrEmpty(seleSpaceType[i])) * { * message += "*请选择舱位!<br/>"; * } * } * } * if (Passengerstype.Length > 0) * { * for (int i = 0; i < Passengerstype.Length; i++) * { * if (string.IsNullOrEmpty(Passengerstype[i])) * { * message += "*请选择乘客类型!<br/>"; * } * } * } * if (peopleNums.Length > 0) * { * for (int i = 0; i < peopleNums.Length; i++) * { * if (string.IsNullOrEmpty(peopleNums[i]) || Utils.GetDecimal(peopleNums[i]) <= 0) * { * message += "*请输入人数!<br/>"; * } * } * } * if (prices.Length > 0) * { * for (int i = 0; i < prices.Length; i++) * { * if (string.IsNullOrEmpty(prices[i]) || Utils.GetDecimal(prices[i]) <= 0) * { * message += "*请输入价格!<br/>"; * } * } * } * if (Insurance.Length > 0) * { * for (int i = 0; i < Insurance.Length; i++) * { * if (string.IsNullOrEmpty(Insurance[i]) || Utils.GetDecimal(Insurance[i]) <= 0) * { * message += "*请输入保险!<br/>"; * } * } * } * if (jiJianFei.Length > 0) * { * for (int i = 0; i < jiJianFei.Length; i++) * { * if (string.IsNullOrEmpty(jiJianFei[i]) || Utils.GetDecimal(jiJianFei[i]) <= 0) * { * message += "*请输入机建费!<br/>"; * } * } * } * if (FujiaFei.Length > 0) * { * for (int i = 0; i < FujiaFei.Length; i++) * { * if (string.IsNullOrEmpty(FujiaFei[i]) || Utils.GetDecimal(FujiaFei[i]) <= 0) * { * message += "*请输入附加费!<br/>"; * } * } * } * if (Zekou.Length > 0) * { * for (int i = 0; i < Zekou.Length; i++) * { * if (string.IsNullOrEmpty(Zekou[i]) || Utils.GetDecimal(Zekou[i]) <= 0) * { * message += "*请输入折扣!<br/>"; * } * } * } * if (TotalPrices.Length > 0) * { * for (int i = 0; i < TotalPrices.Length; i++) * { * if (string.IsNullOrEmpty(TotalPrices[i]) || Utils.GetDecimal(TotalPrices[i]) <= 0) * { * message += "*请输入小计费用!<br/>"; * } * } * }*/ if (string.IsNullOrEmpty(Utils.GetFormValue("SelPamyMent"))) { message += "请选择支付方式!<br/>"; } if (string.IsNullOrEmpty(Utils.GetFormValue("SelStatus"))) { message += "请选择状态!<br/>"; } if (message != "") { seterrorMsg = UtilsCommons.AjaxReturnJson("0", "" + message + ""); RCWE(seterrorMsg); } #endregion #region 实体赋值 EyouSoft.Model.PlanStructure.MPlanBaseInfo AirBase = new EyouSoft.Model.PlanStructure.MPlanBaseInfo(); AirBase.AddStatus = EyouSoft.Model.EnumType.PlanStructure.PlanAddStatus.计调安排时添加; AirBase.CompanyId = this.SiteUserInfo.CompanyId; AirBase.Confirmation = totalPrices; AirBase.ContactFax = contectFax; AirBase.ContactName = contectName; AirBase.ContactPhone = contectPhone; AirBase.CostDetail = costDetail; AirBase.GuideNotes = guidNotes; AirBase.IssueTime = System.DateTime.Now; AirBase.PaymentType = (EyouSoft.Model.EnumType.PlanStructure.Payment)Utils.GetInt(Utils.GetFormValue("SelPamyMent")); //航班 int nums = 0; AirBase.PlanLargeTime = new List <EyouSoft.Model.PlanStructure.MPlanLargeTime>(); for (int i = 0; i < startdate.Length; i++) { EyouSoft.Model.PlanStructure.MPlanLargeTime largTime = new EyouSoft.Model.PlanStructure.MPlanLargeTime(); largTime.Departure = startPlace[i]; largTime.DepartureTime = Utils.GetDateTimeNullable(startdate[i]); largTime.Destination = endplace[i]; largTime.Numbers = filghtNum[i]; //largTime.Time = startTime[i]; largTime.AdultsType = (EyouSoft.Model.EnumType.PlanStructure.PlanLargeAdultsType)Enum.Parse(typeof(EyouSoft.Model.EnumType.PlanStructure.PlanLargeAdultsType), Passengerstype[i]); //largTime.Discount = float.Parse(Zekou[i]); //largTime.Fee = Utils.GetDecimal(jiJianFei[i]); //largTime.Insurance = Utils.GetDecimal(Insurance[i]); largTime.PayNumber = Utils.GetInt(peopleNums[i]); nums += EyouSoft.Common.Utils.GetInt(peopleNums[i]); largTime.FarePrice = Utils.GetDecimal(prices[i]); largTime.SeatType = (EyouSoft.Model.EnumType.PlanStructure.PlanLargeSeatType)Enum.Parse(typeof(EyouSoft.Model.EnumType.PlanStructure.PlanLargeSeatType), seleSpaceType[i]); largTime.SumPrice = Utils.GetDecimal(TotalPrices[i]); //largTime.Surcharge = Utils.GetDecimal(FujiaFei[i]); largTime.BeiZhu = txtFeiJiHangBanBeiZhu[i]; AirBase.PlanLargeTime.Add(largTime); } AirBase.Num = nums; AirBase.Remarks = otherRemark; AirBase.SourceId = votesID; AirBase.SourceName = votesName; AirBase.Status = (EyouSoft.Model.EnumType.PlanStructure.PlanState)Utils.GetInt(Utils.GetFormValue("SelStatus")); AirBase.SueId = ""; AirBase.TourId = Utils.GetQueryStringValue("tourId"); AirBase.Type = EyouSoft.Model.EnumType.PlanStructure.PlanProject.飞机; AirBase.PlanCost = totalPrices; AirBase.OperatorId = this.SiteUserInfo.UserId; AirBase.OperatorName = this.SiteUserInfo.Name; #endregion #region 提交操作 if (Utils.GetQueryStringValue("action") == "saveAir") { string planID = Utils.GetQueryStringValue("planIdAir"); if (planID != null && !string.IsNullOrEmpty(planID)) { AirBase.PlanId = planID; if (new EyouSoft.BLL.PlanStructure.BPlan().UpdPlan(AirBase) > 0) { message += "修改成功!"; seterrorMsg = UtilsCommons.AjaxReturnJson("1", "" + message + ""); } else { message += "修改失败!"; seterrorMsg = UtilsCommons.AjaxReturnJson("0", "" + message + ""); } } else { if (new EyouSoft.BLL.PlanStructure.BPlan().AddPlan(AirBase) > 0) { message += "添加成功!"; seterrorMsg = UtilsCommons.AjaxReturnJson("1", "" + message + ""); } else { message += "添加失败!"; seterrorMsg = UtilsCommons.AjaxReturnJson("0", "" + message + ""); } } } RCWE(seterrorMsg); #endregion }
/// <summary> /// 根据xml获取供应商安排(供应商安排) /// </summary> /// <param name="xml"></param> /// <returns></returns> private IList <EyouSoft.Model.PlanStructure.MPlanBaseInfo> GetPlanBaseInfoByXML(string xml) { IList <EyouSoft.Model.PlanStructure.MPlanBaseInfo> list = null; XmlDocument doc = new XmlDocument(); doc.LoadXml(xml); XmlNode root = doc.SelectSingleNode("Root"); if (root.HasChildNodes) { list = new List <EyouSoft.Model.PlanStructure.MPlanBaseInfo>(); for (int i = 0; i < root.ChildNodes.Count; i++) { XmlNode node = root.ChildNodes[i]; EyouSoft.Model.PlanStructure.MPlanBaseInfo plan = new EyouSoft.Model.PlanStructure.MPlanBaseInfo(); plan.PlanId = node.Attributes["PlanId"].Value; plan.CompanyId = node.Attributes["CompanyId"].Value; plan.Type = (PlanProject)Utils.GetInt(node.Attributes["Type"].Value); plan.TourId = node.Attributes["TourId"].Value; plan.SourceId = node.Attributes["SourceId"] != null ? node.Attributes["SourceId"].Value : string.Empty;; plan.SourceName = node.Attributes["SourceName"] != null ? node.Attributes["SourceName"].Value : string.Empty; plan.ContactName = node.Attributes["ContactName"] != null ? node.Attributes["ContactName"].Value : string.Empty; plan.ContactPhone = node.Attributes["ContactPhone"] != null ? node.Attributes["ContactPhone"].Value : string.Empty; plan.ContactFax = node.Attributes["ContactFax"] != null ? node.Attributes["ContactFax"].Value : string.Empty; plan.Num = node.Attributes["Num"] != null?Utils.GetInt(node.Attributes["Num"].Value) : 0; plan.ReceiveJourney = node.Attributes["ReceiveJourney"] != null ? node.Attributes["ReceiveJourney"].Value : string.Empty; plan.CostDetail = node.Attributes["CostDetail"] != null ? node.Attributes["CostDetail"].Value : string.Empty; plan.PlanCost = Utils.GetDecimal(node.Attributes["PlanCost"].Value); plan.PaymentType = (Payment)Utils.GetInt(node.Attributes["PaymentType"].Value); plan.Status = (PlanState)Utils.GetInt(node.Attributes["Status"].Value); plan.GuideNotes = node.Attributes["GuideNotes"] != null ? node.Attributes["GuideNotes"].Value : string.Empty; plan.Remarks = node.Attributes["Remarks"] != null ? node.Attributes["Remarks"].Value : string.Empty; plan.SueId = node.Attributes["SueId"] != null ? node.Attributes["SueId"].Value : string.Empty; plan.CostId = node.Attributes["CostId"] != null ? node.Attributes["CostId"].Value : string.Empty; plan.CostName = node.Attributes["CostName"] != null ? node.Attributes["CostName"].Value : string.Empty; plan.CostTime = node.Attributes["CostTime"] != null?Utils.GetDateTime(node.Attributes["CostTime"].Value) : (DateTime?)null; plan.Confirmation = Utils.GetDecimal(node.Attributes["Confirmation"].Value); plan.CostRemarks = node.Attributes["CostRemarks"] != null ? node.Attributes["CostRemarks"].Value : string.Empty; plan.DeptId = Utils.GetInt(node.Attributes["DeptId"].Value); plan.OperatorId = node.Attributes["OperatorId"].Value; plan.OperatorName = node.Attributes["OperatorName"].Value; plan.IssueTime = Utils.GetDateTime(node.Attributes["IssueTime"].Value); plan.Prepaid = Utils.GetDecimal(node.Attributes["Prepaid"].Value); plan.IsRebate = Utils.GetInt(node.Attributes["IsRebate"].Value) == 1 ? true : false; plan.AddStatus = (PlanAddStatus)Utils.GetInt(node.Attributes["AddStatus"].Value); plan.ServiceStandard = node.Attributes["ServiceStandard"] != null ? node.Attributes["ServiceStandard"].Value : string.Empty; plan.CustomerInfo = node.Attributes["CustomerInfo"] != null ? node.Attributes["CustomerInfo"].Value : string.Empty; plan.StartDate = node.Attributes["StartDate"] != null?Utils.GetDateTime(node.Attributes["StartDate"].Value) : (DateTime?)null; plan.StartTime = node.Attributes["StartTime"] != null ? node.Attributes["StartTime"].Value : string.Empty; plan.EndDate = node.Attributes["EndDate"] != null?Utils.GetDateTime(node.Attributes["EndDate"].Value) : (DateTime?)null; plan.EndTime = node.Attributes["EndTime"] != null ? node.Attributes["EndTime"].Value : string.Empty; list.Add(plan); } } return(list); }
/// <summary> /// 保存按钮点击事件执行方法 /// </summary> protected string PageSave() { #region 表单赋值 string setsrrorMsg = string.Empty; string msg = string.Empty; //酒店名称 string hotelName = Utils.GetFormValue(this.supplierControl1.ClientText); //酒店id string hotelId = Utils.GetFormValue(this.supplierControl1.ClientValue); //星级 string hotelStart = Utils.GetFormValue(this.ddlHotelStart.UniqueID); //联系人 联系电话 联系传真 string contectName = Utils.GetFormValue(this.txtContectName.UniqueID); string contectPhone = Utils.GetFormValue(this.txtContectPhone.UniqueID); string contectFax = Utils.GetFormValue(this.txtContectFax.UniqueID); //入住时间 离店时间 天数 DateTime?startTime = Utils.GetDateTimeNullable(Utils.GetFormValue(this.txtStartTime.UniqueID)); DateTime?endTime = Utils.GetDateTimeNullable(Utils.GetFormValue(this.txtEndTime.UniqueID)); string days = Utils.GetFormValue(this.txtroomDays.UniqueID); //房型 单价 计算方式 数量 小计 string[] roomType = Utils.GetFormValues("ddlRoomType"); string[] unitPirces = Utils.GetFormValues("txtunitPrice"); string[] selectType = Utils.GetFormValues("select"); string[] numbers = Utils.GetFormValues("txtRoomNumber"); string[] roomItemDays = Utils.GetFormValues("txtRoomItemDays"); string[] TotalMoney = Utils.GetFormValues("txtTotalMoney"); string[] txtCheckInDate = Utils.GetFormValues("txtCheckInDate"); string[] txtCheckOutDate = Utils.GetFormValues("txtCheckOutDate"); //付房数量 免房数量 string payRoomNum = Utils.GetFormValue(this.txtPayRoomNumbers.UniqueID); string FreRoomNum = Utils.GetFormValue(this.txtFreRoomNumber.UniqueID); //是否含早 string ContainsEarly = Utils.GetFormValue(this.ddlContainsEarly.UniqueID); //早餐费用 单价 人数 次数 decimal unitPricesEarly = Utils.GetDecimal(Utils.GetFormValue(this.txtunitPricesEarly.UniqueID)); string earlyPeopleNum = Utils.GetFormValue(this.txtPeopleNumEarly.UniqueID); string sequenceNumEarly = Utils.GetFormValue(this.txtsequenceNumEarly.UniqueID); //结算费用 费用明细 decimal totalMoney = Utils.GetDecimal(Utils.GetFormValue(this.txtTotalPrices.UniqueID)); string CostParticu = Utils.GetFormValue(this.txtCostParticu.UniqueID); //导游须知 其它备注 string guidNotes = Utils.GetFormValue(this.txtGuidNotes.UniqueID); string otherMarks = Utils.GetFormValue(this.txtOtherRemark.UniqueID); //返利 状态 bool profit = Utils.GetFormValue(this.Selprofit1.UniqueID) == "0" ? true : false; #endregion #region 后台验证 if (string.IsNullOrEmpty(hotelName) && string.IsNullOrEmpty(hotelId)) { msg += "请选择酒店名称!<br/>"; } if (string.IsNullOrEmpty(startTime.ToString())) { msg += "请填写入住时间!<br/>"; } if (string.IsNullOrEmpty(endTime.ToString())) { msg += "请填写离店时间!<br/>"; } if (string.IsNullOrEmpty(days)) { msg += "请填写入住天数!<br/>"; } if (roomType.Length > 0) { for (int i = 0; i < roomType.Length; i++) { if (string.IsNullOrEmpty(roomType[i])) { msg += "第" + (i + 1) + "行请选择房型!<br/>"; } } } if (unitPirces.Length > 0) { for (int i = 0; i < unitPirces.Length; i++) { if (string.IsNullOrEmpty(unitPirces[i])) { msg += "第" + (i + 1) + "行请输入单价!<br/>"; } } } if (numbers.Length > 0) { for (int i = 0; i < numbers.Length; i++) { if (string.IsNullOrEmpty(numbers[i])) { msg += "第" + (i + 1) + "行请输入数量!<br/>"; } } } string[] totalPrices = Utils.GetFormValues("txtTotalMoney"); if (totalPrices.Length > 0) { for (int i = 0; i < totalPrices.Length; i++) { if (string.IsNullOrEmpty(totalPrices[i]) && Utils.GetDecimal(totalPrices[i]) <= 0) { msg += "第" + totalPrices[i] + "行请输入小计费用!<br/>"; } } } if (string.IsNullOrEmpty(ContainsEarly)) { msg += "请选择是否含早餐!<br/>"; } if (totalMoney <= 0) { msg += "请填写结算费用!<br/>"; } if (profit.ToString() == "-1") { msg += "请选择是否返利!<br/>"; } string status = Utils.GetFormValue("SelStatus"); if (string.IsNullOrEmpty(status)) { msg += "请选择状态!<br/>"; } if (string.IsNullOrEmpty(Utils.GetFormValue("SelPanyMent"))) { msg += "请选择支付方式!<br/>"; } if (msg != "") { setsrrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); return(setsrrorMsg); } #endregion #region 实体赋值 EyouSoft.Model.PlanStructure.MPlanBaseInfo baseinfo = new EyouSoft.Model.PlanStructure.MPlanBaseInfo(); baseinfo.AddStatus = EyouSoft.Model.EnumType.PlanStructure.PlanAddStatus.计调安排时添加; baseinfo.CompanyId = this.SiteUserInfo.CompanyId; baseinfo.Confirmation = totalMoney; baseinfo.PlanCost = totalMoney; baseinfo.ContactFax = contectFax; baseinfo.ContactName = contectName; baseinfo.ContactPhone = contectPhone; baseinfo.EndDate = endTime; baseinfo.GuideNotes = guidNotes; baseinfo.IsRebate = profit; baseinfo.IssueTime = System.DateTime.Now; baseinfo.Num = Utils.GetInt(payRoomNum); baseinfo.PaymentType = (EyouSoft.Model.EnumType.PlanStructure.Payment)Utils.GetInt(Utils.GetFormValue("SelPanyMent")); baseinfo.PlanHotel = new EyouSoft.Model.PlanStructure.MPlanHotel(); baseinfo.PlanHotel.Days = Utils.GetInt(days); baseinfo.PlanHotel.FreeNumber = Utils.GetInt(FreRoomNum); baseinfo.PlanHotel.IsMeal = (EyouSoft.Model.EnumType.PlanStructure.PlanHotelIsMeal)Enum.Parse(typeof(EyouSoft.Model.EnumType.PlanStructure.PlanHotelIsMeal), ContainsEarly); baseinfo.PlanHotel.MealFrequency = Utils.GetInt(sequenceNumEarly); baseinfo.PlanHotel.MealNumber = Utils.GetInt(earlyPeopleNum); baseinfo.PlanHotel.MealPrice = unitPricesEarly; baseinfo.PlanHotel.Star = (EyouSoft.Model.EnumType.SourceStructure.HotelStar)Enum.Parse(typeof(EyouSoft.Model.EnumType.SourceStructure.HotelStar), hotelStart); baseinfo.PlanHotel.QianTaiTelephone = Utils.GetFormValue(txtQianTaiTelephone.UniqueID); baseinfo.PlanHotel.PlanHotelRoomList = new List <EyouSoft.Model.PlanStructure.MPlanHotelRoom>(); for (int i = 0; i < roomType.Length; i++) { var roomHotel = new EyouSoft.Model.PlanStructure.MPlanHotelRoom(); roomHotel.RoomType = roomType[i].Split(',')[1]; roomHotel.RoomId = roomType[i].Split(',')[0]; roomHotel.UnitPrice = Utils.GetDecimal(unitPirces[i]); roomHotel.Days = Utils.GetInt(roomItemDays[i]); roomHotel.PriceType = (EyouSoft.Model.EnumType.PlanStructure.PlanHotelPriceType)Enum.Parse(typeof(EyouSoft.Model.EnumType.PlanStructure.PlanHotelPriceType), selectType[i]); roomHotel.Quantity = Utils.GetInt(numbers[i]); roomHotel.Total = Utils.GetDecimal(TotalMoney[i]); roomHotel.CheckInDate = Utils.GetDateTimeNullable(txtCheckInDate[i]); roomHotel.CheckOutDate = Utils.GetDateTimeNullable(txtCheckOutDate[i]); baseinfo.PlanHotel.PlanHotelRoomList.Add(roomHotel); } baseinfo.Remarks = otherMarks; baseinfo.SourceId = hotelId; baseinfo.SourceName = hotelName; baseinfo.StartDate = startTime; baseinfo.Status = (EyouSoft.Model.EnumType.PlanStructure.PlanState)Utils.GetInt(Utils.GetFormValue("SelStatus")); if (Utils.GetFormValue(this.supplierControl1.ClientIsyukong) == "1") { baseinfo.SueId = Utils.GetFormValue(this.supplierControl1.ClientzyykValue); } baseinfo.TourId = Utils.GetQueryStringValue("tourId"); baseinfo.Type = EyouSoft.Model.EnumType.PlanStructure.PlanProject.酒店; baseinfo.OperatorId = this.SiteUserInfo.UserId; baseinfo.OperatorName = this.SiteUserInfo.Name; baseinfo.CostDetail = CostParticu; #endregion #region 提交操作 //酒店id string planID = Utils.GetQueryStringValue("planId"); int result = 0; EyouSoft.BLL.PlanStructure.BPlan bll = new EyouSoft.BLL.PlanStructure.BPlan(); if (planID != null && planID != "") { baseinfo.PlanId = planID; baseinfo.PlanHotel.PlanId = planID; result = bll.UpdPlan(baseinfo); if (result == 1) { msg += "修改成功!"; setsrrorMsg = UtilsCommons.AjaxReturnJson("1", "" + msg + ""); } else if (result == 0) { msg += "修改失败!"; setsrrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); } else if (result == -2) { msg += "预控数量不足,修改失败!"; setsrrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); } } else { result = bll.AddPlan(baseinfo); if (result == 1) { msg += "添加成功!"; setsrrorMsg = UtilsCommons.AjaxReturnJson("1", "" + msg + ""); } else if (result == 0) { msg += "添加失败!"; setsrrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); } else if (result == -2) { msg += "预控数量不足,添加失败!"; setsrrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); } } #endregion return(setsrrorMsg); }
/// <summary> /// 保存 /// </summary> protected string PageSave() { #region 表单取值 string msg = string.Empty; string setErrorMsg = string.Empty; //餐馆名称 string SourceName = Utils.GetFormValue(this.supplierControl1.ClientText); string SourceID = Utils.GetFormValue(this.supplierControl1.ClientValue); //联系人 电话 传真 string ContactName = Utils.GetFormValue(this.txtContactName.UniqueID); string ContactPhone = Utils.GetFormValue(this.txtContactPhone.UniqueID); string ContactFax = Utils.GetFormValue(this.txtContactFax.UniqueID); //用餐时间 DateTime?Dintime = Utils.GetDateTimeNullable(Utils.GetFormValue(this.txtDinningDate.UniqueID)); //价格组成 //人员类型 string[] AdultType = Utils.GetFormValues("selAdultType"); //早 次数 人数 价格 string[] FrequencyB = Utils.GetFormValues("txtFrequencyB"); string[] PeopleNumsB = Utils.GetFormValues("txtPeopleNumsB"); string[] PricesB = Utils.GetFormValues("txtPricesB"); //中 次数 人数 价格 string[] FrequencyL = Utils.GetFormValues("txtFrequencyL"); string[] PeopleNumsL = Utils.GetFormValues("txtPeopleNumsL"); string[] PricesL = Utils.GetFormValues("txtPricesL"); //晚 次数 人数 价格 string[] FrequencyS = Utils.GetFormValues("txtFrequencyS"); string[] PeopleNumsS = Utils.GetFormValues("txtPeopleNumsS"); string[] PricesS = Utils.GetFormValues("txtPricesS"); //费用明细 结算费用 string CostDetail = Utils.GetFormValue(this.txtCostDetail.UniqueID); decimal totalprices = Utils.GetDecimal(Utils.GetFormValue(this.txtTotalPrices.UniqueID)); //导游须知 其它备注 string GuidNotes = Utils.GetFormValue(this.txtGuidNotes.UniqueID); string otherMark = Utils.GetFormValue(this.txtOtherMarks.UniqueID); #endregion #region 后台验证 if (string.IsNullOrEmpty(SourceID) && string.IsNullOrEmpty(SourceName)) { msg += "请选择餐馆!<br/>"; } if (totalprices <= 0) { msg += "请输入结算费用!<br/>"; } if (string.IsNullOrEmpty(Utils.GetFormValue("selPanyMent"))) { msg += "请选择支付方式!<br/>"; } if (string.IsNullOrEmpty(Utils.GetFormValue("SelStatus"))) { msg += "请选择状态!<br/>"; } if (msg != "") { setErrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); return(setErrorMsg); } #endregion #region 实体赋值 EyouSoft.Model.PlanStructure.MPlanBaseInfo baseinfo = new EyouSoft.Model.PlanStructure.MPlanBaseInfo(); baseinfo.AddStatus = EyouSoft.Model.EnumType.PlanStructure.PlanAddStatus.计调安排时添加; baseinfo.CompanyId = this.SiteUserInfo.CompanyId; baseinfo.Confirmation = totalprices; baseinfo.PlanCost = totalprices; baseinfo.ContactFax = ContactFax; baseinfo.ContactName = ContactName; baseinfo.ContactPhone = ContactPhone; baseinfo.CostDetail = CostDetail; baseinfo.GuideNotes = GuidNotes; baseinfo.IssueTime = System.DateTime.Now; baseinfo.PaymentType = (EyouSoft.Model.EnumType.PlanStructure.Payment)Utils.GetInt(Utils.GetFormValue("selPanyMent")); int nums = 0; baseinfo.PlanDiningPricelist = new List <EyouSoft.Model.PlanStructure.MPlanDiningPrice>(); for (int i = 0; i < FrequencyB.Length; i++) { EyouSoft.Model.PlanStructure.MPlanDiningPrice prices = new EyouSoft.Model.PlanStructure.MPlanDiningPrice(); prices.PeopleB = Utils.GetInt(PeopleNumsB[i]); prices.PriceB = Utils.GetDecimal(PricesB[i]); prices.TimeB = Utils.GetInt(FrequencyB[i]); prices.PriceL = Utils.GetDecimal((PricesL[i])); prices.TimeL = Utils.GetInt(FrequencyL[i]); prices.PeopleL = Utils.GetInt(PeopleNumsL[i]); prices.PeopleS = Utils.GetInt(PeopleNumsS[i]); prices.TimeS = Utils.GetInt(FrequencyS[i]); prices.PriceS = Utils.GetDecimal(PricesS[i]); prices.Pricetyp = (EyouSoft.Model.EnumType.PlanStructure.PlanLargeAdultsType)Enum.Parse(typeof(EyouSoft.Model.EnumType.PlanStructure.PlanLargeAdultsType), AdultType[i]); nums += Utils.GetInt(PeopleNumsB[i]) + Utils.GetInt(PeopleNumsL[i]) + Utils.GetInt(PeopleNumsS[i]); baseinfo.PlanDiningPricelist.Add(prices); } baseinfo.Num = Utils.GetInt(Utils.GetFormValue(this.txtPeopleNum.UniqueID)); baseinfo.Remarks = otherMark; baseinfo.SourceId = SourceID; baseinfo.SourceName = SourceName; baseinfo.StartDate = Dintime; baseinfo.Status = (EyouSoft.Model.EnumType.PlanStructure.PlanState)Utils.GetInt(Utils.GetFormValue("SelStatus")); baseinfo.SueId = ""; baseinfo.TourId = Utils.GetQueryStringValue("tourId"); baseinfo.Type = EyouSoft.Model.EnumType.PlanStructure.PlanProject.用餐; baseinfo.OperatorId = this.SiteUserInfo.UserId; baseinfo.OperatorName = this.SiteUserInfo.Name; baseinfo.PaymentType = (EyouSoft.Model.EnumType.PlanStructure.Payment)Utils.GetInt(Utils.GetFormValue("selPanyMent")); baseinfo.Status = (EyouSoft.Model.EnumType.PlanStructure.PlanState)Utils.GetInt(Utils.GetFormValue("SelStatus")); #endregion #region 提交操作 string planId = Utils.GetQueryStringValue("planId"); if (!string.IsNullOrEmpty(planId)) { baseinfo.PlanId = planId; if (new EyouSoft.BLL.PlanStructure.BPlan().UpdPlan(baseinfo) > 0) { msg += "修改成功!"; setErrorMsg = UtilsCommons.AjaxReturnJson("1", "" + msg + ""); } else { msg += "修改失败!"; setErrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); } } else { if (new EyouSoft.BLL.PlanStructure.BPlan().AddPlan(baseinfo) > 0) { msg += "添加成功!"; setErrorMsg = UtilsCommons.AjaxReturnJson("1", "" + msg + ""); } else { msg += "添加失败!"; setErrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); } } #endregion return(setErrorMsg); }
/// <summary> /// 其它计调项保存 /// </summary> /// <returns></returns> protected string PageSave() { #region 表单取值 string msg = string.Empty; string setErrorMsg = string.Empty; //供应商 string sourceId = Utils.GetFormValue(this.supplierControl1.ClientValue); string sourceName = Utils.GetFormValue(this.supplierControl1.ClientText); //联系人 电话 传真 string contactName = Utils.GetFormValue(this.txtContactName.UniqueID); string contactPhone = Utils.GetFormValue(this.txtContactPhone.UniqueID); string contactFax = Utils.GetFormValue(this.txtContactFax.UniqueID); //支出项目 人数 string costDetail = Utils.GetFormValue(this.txtOutProject.UniqueID); int Peoplenums = Utils.GetInt(Utils.GetFormValue(this.txtNums.UniqueID)); //结算费用 decimal totalPrices = Utils.GetDecimal(Utils.GetFormValue(this.txtTotalPrices.UniqueID)); //导游需知 其它备注 string guidNoted = Utils.GetFormValue(this.txtGuisNotes.UniqueID); string otherRemark = Utils.GetFormValue(this.txtOtherMark.UniqueID); #endregion #region 后台验证 if (string.IsNullOrEmpty(sourceId) && string.IsNullOrEmpty(sourceName)) { msg += "请选择供应商!<br/>"; } if (string.IsNullOrEmpty(Utils.GetFormValue("selPanyMent"))) { msg += "请选择支付方式!<br/>"; } if (string.IsNullOrEmpty(Utils.GetFormValue("selStatus"))) { msg += "请选择状态!<br/>"; } if (totalPrices <= 0) { msg += "请输入结算费用!"; } if (!string.IsNullOrEmpty(msg)) { setErrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); return(setErrorMsg); } #endregion #region 实体赋值 EyouSoft.Model.PlanStructure.MPlanBaseInfo baseinfo = new EyouSoft.Model.PlanStructure.MPlanBaseInfo(); baseinfo.AddStatus = EyouSoft.Model.EnumType.PlanStructure.PlanAddStatus.计调安排时添加; baseinfo.CompanyId = this.SiteUserInfo.CompanyId; baseinfo.Confirmation = totalPrices; baseinfo.PlanCost = totalPrices; baseinfo.ContactFax = contactFax; baseinfo.ContactName = contactName; baseinfo.ContactPhone = contactPhone; baseinfo.CostDetail = costDetail; baseinfo.GuideNotes = guidNoted; baseinfo.IssueTime = System.DateTime.Now; baseinfo.Num = Peoplenums; baseinfo.PaymentType = (EyouSoft.Model.EnumType.PlanStructure.Payment)Utils.GetInt(Utils.GetFormValue("selPanyMent")); baseinfo.Remarks = otherRemark; baseinfo.SourceId = sourceId; baseinfo.SourceName = sourceName; baseinfo.Status = (EyouSoft.Model.EnumType.PlanStructure.PlanState)Utils.GetInt(Utils.GetFormValue("selStatus")); if (Utils.GetFormValue(this.supplierControl1.ClientIsyukong) == "1") { baseinfo.SueId = Utils.GetFormValue(this.supplierControl1.ClientzyykValue); } baseinfo.TourId = Utils.GetQueryStringValue("tourId"); baseinfo.Type = EyouSoft.Model.EnumType.PlanStructure.PlanProject.其它; baseinfo.OperatorName = this.SiteUserInfo.Name; baseinfo.OperatorId = this.SiteUserInfo.UserId; #endregion #region 提交操作 string planID = Utils.GetQueryStringValue("planId"); if (!string.IsNullOrEmpty(planID)) { baseinfo.PlanId = planID; var r = new EyouSoft.BLL.PlanStructure.BPlan().UpdPlan(baseinfo); if (r == 1) { msg += "修改成功"; setErrorMsg = UtilsCommons.AjaxReturnJson("1", "" + msg + ""); } else if (r == 0) { msg += "修改失败!"; setErrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); } else if (r == -2) { msg += "预控数量不足,修改失败!"; setErrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); } } else { var r = new EyouSoft.BLL.PlanStructure.BPlan().AddPlan(baseinfo); if (r == 1) { msg += "添加成功!"; setErrorMsg = UtilsCommons.AjaxReturnJson("1", "" + msg + ""); } else if (r == 0) { msg += "添加失败!"; setErrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); } else if (r == -2) { msg += "预控数量不足,修改失败!"; setErrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); } } #endregion return(setErrorMsg); }
protected string PageSaveForeign() { #region 表单取值 string msg = string.Empty; string seterrormsg = string.Empty; //游船公司 string shipComName = Utils.GetFormValue(this.SupplierControl1.ClientText); string shipComID = Utils.GetFormValue(this.SupplierControl1.ClientValue); //联系人 电话 传真 string contectName = Utils.GetFormValue(this.txtContectName.UniqueID); string contectPhone = Utils.GetFormValue(this.txtContectPhone.UniqueID); string contectFax = Utils.GetFormValue(this.txtContectFax.UniqueID); //船名 船载电话 string shipName = Utils.GetFormValue("ddlShipNameList").Split(',')[1]; string shipPhone = Utils.GetFormValue(this.txtShipPhone.UniqueID); //登船日期 时间 船载码头 DateTime?boardDate = Utils.GetDateTimeNullable(Utils.GetFormValue(this.txtBoardDate.UniqueID)); string boardTime = Utils.GetFormValue(this.txtBoardTime.UniqueID); string boardWharif = Utils.GetFormValue(this.txtBoardWharif.UniqueID); //登船号 航线 string boardCode = Utils.GetFormValue(this.txtBoardCode.UniqueID); string route = Utils.GetFormValue(this.txtRoute.UniqueID); //停靠景点 string stopAttr = Utils.GetFormValue(this.txtStopAttr.UniqueID); //价格组成 string[] roomTypes = Utils.GetFormValues("selRoomTypeList"); string[] CrowdTypes = Utils.GetFormValues("selCrowdType"); string[] adultNums = Utils.GetFormValues("txtAdultNum"); string[] adultPrices = Utils.GetFormValues("txtAdultPrice"); //string[] childNums = Utils.GetFormValues("txtChildNum"); //string[] childPrices = Utils.GetFormValues("txtChildPrice"); //string[] childNoNums = Utils.GetFormValues("txtChildNoNum"); //string[] childNoPrices = Utils.GetFormValues("txtChildNoPrice"); //string[] bobyNums = Utils.GetFormValues("txtBobyNum"); //string[] bobyPrices = Utils.GetFormValues("txtBobyPrice"); string[] totalPrices = Utils.GetFormValues("txtTotalPrice"); //楼层 string[] floors = Utils.GetFormValues("selFloorList"); string[] peopleNums = Utils.GetFormValues("txtPeopleNum"); string[] unitPrices = Utils.GetFormValues("txtUnitPrice"); //自费项目 //string ownCost = Utils.GetFormValue(this.txtOwnCost.UniqueID); //string ownPrices = Utils.GetFormValue(this.txtOwnCostPrice.UniqueID); //string ownNums = Utils.GetFormValue(this.txtOwnCostNums.UniqueID); //结算费用 decimal totalCost = Utils.GetDecimal(Utils.GetFormValue(this.txtTotalPrices.UniqueID)); //游客资料 string customerInfo = Utils.GetFormValue(this.txtCustomerInfo.UniqueID); //费用明细 string costDetail = Utils.GetFormValue(this.txtCostDetail.UniqueID); //导游需知 其它备注 string guidNotes = Utils.GetFormValue(this.txtGuidNOtes.UniqueID); string otherMarks = Utils.GetFormValue(this.txtOtherRemarks.UniqueID); string[] txtSheWaiBeiZhu = Utils.GetFormValues("txtSheWaiBeiZhu"); #endregion #region 后台验证 if (string.IsNullOrEmpty(shipComID) && string.IsNullOrEmpty(shipComName)) { msg += "请选择游船公司!<br/>"; } if (string.IsNullOrEmpty(shipName)) { msg += "请输入船名!<br/>"; } if (string.IsNullOrEmpty(boardWharif)) { msg += "请输入登船码头!<br/>"; } if (roomTypes.Length > 0) { for (int i = 0; i < roomTypes.Length; i++) { if (string.IsNullOrEmpty(roomTypes[i])) { msg += "请选择房型!<br/>"; } } } if (CrowdTypes.Length > 0) { for (int i = 0; i < CrowdTypes.Length; i++) { if (string.IsNullOrEmpty(CrowdTypes[i])) { msg += "请选择人群类型!<br/>"; } } } if (adultNums.Length > 0) { for (int i = 0; i < adultNums.Length; i++) { if (string.IsNullOrEmpty(adultNums[i]) || Utils.GetInt(adultNums[i]) < 0) { msg += "请输入人数!<br/>"; } } } if (adultPrices.Length > 0) { for (int i = 0; i < adultPrices.Length; i++) { if (Utils.GetDecimal(adultPrices[i]) < 0 || string.IsNullOrEmpty(adultPrices[i])) { msg += "请输入单价!<br/>"; } } } if (totalCost < 0) { msg += "请输入结算费用!<br/>"; } if (string.IsNullOrEmpty(Utils.GetFormValue("SelPanyMent"))) { msg += "请选择支付方式!<br/>"; } if (string.IsNullOrEmpty(Utils.GetFormValue("SelStatus"))) { msg += "请选择状态!<br/>"; } if (string.IsNullOrEmpty(Utils.GetFormValue(this.ddlprofit1.UniqueID))) { msg += "请选择是否返利!<br/>"; } if (msg != "") { seterrormsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); return(seterrormsg); } #endregion #region 实体赋值 EyouSoft.Model.PlanStructure.MPlanBaseInfo baseinfo = new EyouSoft.Model.PlanStructure.MPlanBaseInfo(); baseinfo.AddStatus = EyouSoft.Model.EnumType.PlanStructure.PlanAddStatus.计调安排时添加; baseinfo.CompanyId = this.SiteUserInfo.CompanyId; baseinfo.Confirmation = totalCost; baseinfo.PlanCost = totalCost; baseinfo.ContactFax = contectFax; baseinfo.ContactName = contectName; baseinfo.ContactPhone = contectPhone; baseinfo.CostDetail = costDetail; baseinfo.CustomerInfo = customerInfo; baseinfo.GuideNotes = guidNotes; baseinfo.IsRebate = Utils.GetFormValue(this.ddlprofit1.UniqueID) == "0" ? true : false; baseinfo.IssueTime = System.DateTime.Now; baseinfo.PaymentType = (EyouSoft.Model.EnumType.PlanStructure.Payment)Utils.GetInt(Utils.GetFormValue("SelPanyMent")); baseinfo.PlanShip = new EyouSoft.Model.PlanStructure.MPlanShip(); baseinfo.PlanShip.Line = route; baseinfo.PlanShip.LoadCode = boardCode; baseinfo.PlanShip.LoadDock = boardWharif; baseinfo.PlanShip.ShipCalls = shipPhone; baseinfo.PlanShip.ShipName = shipName; baseinfo.PlanShip.SubId = Utils.GetFormValue("ddlShipNameList").Split(',')[0]; baseinfo.PlanShip.Sight = stopAttr; //自费项目 //baseinfo.PlanShip.PlanShipOwnCostList = new List<EyouSoft.Model.PlanStructure.MPlanShipOwnCost>(); //EyouSoft.Model.PlanStructure.MPlanShipOwnCost OwnCostM = new EyouSoft.Model.PlanStructure.MPlanShipOwnCost(); //OwnCostM.OwnItem = ownCost; //OwnCostM.PeopleNum = Utils.GetInt(ownNums); //OwnCostM.Price = Utils.GetDecimal(ownPrices); //OwnCostM.IsFloor = false; //baseinfo.PlanShip.PlanShipOwnCostList.Add(OwnCostM); //楼层 //for (int i = 0; i < floors.Length; i++) //{ // EyouSoft.Model.PlanStructure.MPlanShipOwnCost OwnCostF = new EyouSoft.Model.PlanStructure.MPlanShipOwnCost(); // OwnCostF.IsFloor = true; // OwnCostF.OwnItem = floors[i]; // OwnCostF.PeopleNum = Utils.GetInt(peopleNums[i]); // OwnCostF.Price = Utils.GetDecimal(unitPrices[i]); // baseinfo.PlanShip.PlanShipOwnCostList.Add(OwnCostF); //} decimal nums = 0; //价格组成 baseinfo.PlanShip.PlanShipPriceList = new List <EyouSoft.Model.PlanStructure.MPlanShipPrice>(); for (int i = 0; i < roomTypes.Length; i++) { EyouSoft.Model.PlanStructure.MPlanShipPrice pricesM = new EyouSoft.Model.PlanStructure.MPlanShipPrice(); pricesM.DNum = Utils.GetDecimal(adultNums[i]); pricesM.AdultNumber = Utils.GetInt(adultNums[i]); pricesM.AdultNumber = Convert.ToInt32(pricesM.DNum); pricesM.AdultPrice = Utils.GetDecimal(adultPrices[i]); //pricesM.BabyNumber = Utils.GetInt(bobyNums[i]); //pricesM.BabyNumberPrice = Utils.GetDecimal(bobyPrices[i]); //pricesM.ChildNoOccupancy = Utils.GetInt(childNoNums[i]); //pricesM.ChildNoOccupancyPrice = Utils.GetDecimal(childNoPrices[i]); //pricesM.ChildNumber = Utils.GetInt(childNums[i]); //pricesM.ChildPrice = Utils.GetDecimal(childPrices[i]); pricesM.SumPrice = Utils.GetDecimal(totalPrices[i]);; //nums += Utils.GetInt(adultNums[i]) + Utils.GetInt(bobyNums[i]) + Utils.GetInt(childNoNums[i]) + Utils.GetInt(childNums[i]); nums += Utils.GetDecimal(adultNums[i]); pricesM.CrowdType = (EyouSoft.Model.EnumType.PlanStructure.PlanShipCrowdType)Enum.Parse(typeof(EyouSoft.Model.EnumType.PlanStructure.PlanShipCrowdType), CrowdTypes[i]); pricesM.RoomType = (EyouSoft.Model.EnumType.PlanStructure.PlanShipRoomType)Enum.Parse(typeof(EyouSoft.Model.EnumType.PlanStructure.PlanShipRoomType), roomTypes[i]); pricesM.BeiZhu = txtSheWaiBeiZhu[i]; //小计 baseinfo.PlanShip.PlanShipPriceList.Add(pricesM); } baseinfo.Num = Convert.ToInt32(nums); baseinfo.DNum = nums; baseinfo.Remarks = otherMarks; baseinfo.SourceId = shipComID; baseinfo.SourceName = shipComName; baseinfo.StartDate = boardDate; baseinfo.StartTime = boardTime; baseinfo.Status = (EyouSoft.Model.EnumType.PlanStructure.PlanState)Utils.GetInt(Utils.GetFormValue("SelStatus")); if (Utils.GetFormValue(this.SupplierControl1.ClientIsyukong) == "1") { baseinfo.SueId = Utils.GetFormValue(this.SupplierControl1.ClientzyykValue); } baseinfo.TourId = Utils.GetQueryStringValue("tourId"); baseinfo.Type = EyouSoft.Model.EnumType.PlanStructure.PlanProject.涉外游轮; baseinfo.OperatorId = this.SiteUserInfo.UserId; baseinfo.OperatorName = this.SiteUserInfo.Name; #endregion #region 提交操作 int result = 0; EyouSoft.BLL.PlanStructure.BPlan bll = new EyouSoft.BLL.PlanStructure.BPlan(); if (Utils.GetQueryStringValue("action") == "save") { string editID = Utils.GetQueryStringValue("planId"); if (!string.IsNullOrEmpty(editID)) { baseinfo.PlanShip.PlanId = editID; baseinfo.PlanId = editID; result = bll.UpdPlan(baseinfo); if (result == 1) { msg += "修改成功!"; seterrormsg = UtilsCommons.AjaxReturnJson("1", "" + msg + ""); } else if (result == 0) { msg += "修改失败!"; seterrormsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); } else if (result == -2) { msg += "预控数量不足,修改失败!"; seterrormsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); } } else { result = bll.AddPlan(baseinfo); if (result == 1) { msg += "添加成功!"; seterrormsg = UtilsCommons.AjaxReturnJson("1", "" + msg + ""); } else if (result == 0) { msg += "添加失败!"; seterrormsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); } else if (result == -2) { msg += "预控数量不足,添加失败!"; seterrormsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); } } } #endregion return(seterrormsg); }
/// <summary> /// 获取供应商安排数据源 /// </summary> /// <returns></returns> private IList <EyouSoft.Model.PlanStructure.MPlanBaseInfo> GetSourcePlanList() { string[] SourceId = Utils.GetFormValues("ShowID"); string[] Sourcetype = Utils.GetFormValues("Sourcetype"); string[] SourceName = Utils.GetFormValues("SourceName"); string[] GuideNotes = Utils.GetFormValues("GuideNotes"); string[] PlanCost = Utils.GetFormValues("PlanCost"); string[] remarkSource = Utils.GetFormValues("remarkSource"); string[] PayType = Utils.GetFormValues("PayType"); string[] Count = Utils.GetFormValues("Count"); string[] ContactName = Utils.GetFormValues("ContactName"); string[] ContactTel = Utils.GetFormValues("ContactPhone"); string[] ContactFax = Utils.GetFormValues("ContactFax"); string[] PlanId = Utils.GetFormValues("PlanId"); EyouSoft.Model.PlanStructure.MPlanBaseInfo model; IList <EyouSoft.Model.PlanStructure.MPlanBaseInfo> list = new List <EyouSoft.Model.PlanStructure.MPlanBaseInfo>(); if (Sourcetype.Length > 0 && SourceName.Length > 0 && GuideNotes.Length > 0 && PlanCost.Length > 0 && remarkSource.Length > 0) { string errorMsg = string.Empty; for (int i = 0; i < SourceName.Length; i++) { model = new EyouSoft.Model.PlanStructure.MPlanBaseInfo(); if (!String.IsNullOrEmpty(PlanCost[i]) && !String.IsNullOrEmpty(SourceName[i]) && !string.IsNullOrEmpty(SourceId[i])) { model.GuideNotes = GuideNotes[i]; model.PlanCost = Utils.GetDecimal(PlanCost[i]); //model.Remarks = remarkSource[i]; model.CostDetail = remarkSource[i]; model.SourceName = SourceName[i]; model.Confirmation = Utils.GetDecimal(PlanCost[i]); model.PaymentType = (EyouSoft.Model.EnumType.PlanStructure.Payment)(Utils.GetInt(PayType[i])); model.Num = Utils.GetInt(Count[i]); EyouSoft.Model.EnumType.TourStructure.TourStatus tourStatus = (EyouSoft.Model.EnumType.TourStructure.TourStatus)Utils.GetInt(Utils.GetFormValue(status.UniqueID)); model.ContactName = ContactName[i]; model.ContactPhone = ContactTel[i]; model.ContactFax = ContactFax[i]; model.SourceId = SourceId[i]; model.PlanId = PlanId[i]; if (tourStatus == EyouSoft.Model.EnumType.TourStructure.TourStatus.销售未派计划) { model.Status = EyouSoft.Model.EnumType.PlanStructure.PlanState.未落实; } if (tourStatus == EyouSoft.Model.EnumType.TourStructure.TourStatus.计调配置完毕 || tourStatus == EyouSoft.Model.EnumType.TourStructure.TourStatus.待终审) { model.Status = EyouSoft.Model.EnumType.PlanStructure.PlanState.已落实; } model.Type = Utils.GetEnumValue <EyouSoft.Model.EnumType.PlanStructure.PlanProject>(Sourcetype[i], EyouSoft.Model.EnumType.PlanStructure.PlanProject.其它); list.Add(model); SourcePlanCount = list.Count; } } if (String.IsNullOrEmpty(errorMsg)) { this.SetSourcePlan = list; return(list); } else { return(null); } } else { return(null); } }
/// <summary> /// 购物计调项保存 /// </summary> /// <returns></returns> protected string PageSave() { #region 表单取值 string msg = string.Empty; string setErrorMsg = string.Empty; //购物点 string sourceID = Utils.GetFormValue(this.SupplierControl1.ClientValue); string sourceName = Utils.GetFormValue(this.SupplierControl1.ClientText); //联系人 电话 传真 string contactName = Utils.GetFormValue(this.txtContactName.UniqueID); string contactFax = Utils.GetFormValue(this.txtContactFax.UniqueID); string contactPhome = Utils.GetFormValue(this.txtContactPhone.UniqueID); //人头数 int nums = Utils.GetInt(Utils.GetFormValue(this.txtPeopleNums.UniqueID)); //返利标准 导游须知 其它备注 string profitStandard = Utils.GetFormValue(this.txtProfitStand.UniqueID); string guidNotes = Utils.GetFormValue(this.txtGuidNotes.UniqueID); string otherMarks = Utils.GetFormValue(this.txtOtherRemark.UniqueID); #endregion #region 验证 if (string.IsNullOrEmpty(sourceID) && string.IsNullOrEmpty(sourceName)) { msg += "请选择购物店!<br/>"; } if (nums < 0) { msg += "请输入人头数!<br/>"; } if (string.IsNullOrEmpty(Utils.GetFormValue("selStatus"))) { msg += "请选择状态!<br/>"; } if (msg != "") { setErrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); return(setErrorMsg); } #endregion #region 提交 EyouSoft.Model.PlanStructure.MPlanBaseInfo baseinfo = new EyouSoft.Model.PlanStructure.MPlanBaseInfo(); baseinfo.AddStatus = EyouSoft.Model.EnumType.PlanStructure.PlanAddStatus.计调安排时添加; baseinfo.CompanyId = this.SiteUserInfo.CompanyId; baseinfo.ContactFax = contactFax; baseinfo.ContactName = contactName; baseinfo.ContactPhone = contactPhome; baseinfo.Num = nums; baseinfo.ServiceStandard = profitStandard; baseinfo.SourceId = sourceID; baseinfo.SourceName = sourceName; baseinfo.GuideNotes = guidNotes; baseinfo.Remarks = otherMarks; baseinfo.Status = (EyouSoft.Model.EnumType.PlanStructure.PlanState)Utils.GetInt(Utils.GetFormValue("selStatus")); baseinfo.SueId = ""; baseinfo.TourId = Utils.GetQueryStringValue("tourId"); baseinfo.Type = EyouSoft.Model.EnumType.PlanStructure.PlanProject.购物; baseinfo.IssueTime = System.DateTime.Now; baseinfo.OperatorId = this.SiteUserInfo.UserId; baseinfo.OperatorName = this.SiteUserInfo.Name; string planID = Utils.GetQueryStringValue("planId"); if (!string.IsNullOrEmpty(planID)) { baseinfo.PlanId = planID; if (new EyouSoft.BLL.PlanStructure.BPlan().UpdPlan(baseinfo) > 0) { msg += "修改成功!"; setErrorMsg = UtilsCommons.AjaxReturnJson("1", "" + msg + ""); } else { msg += "修改失败!"; setErrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); } } else { if (new EyouSoft.BLL.PlanStructure.BPlan().AddPlan(baseinfo) > 0) { msg += "添加成功!"; setErrorMsg = UtilsCommons.AjaxReturnJson("1", "" + msg + ""); } else { msg += "添加失败!"; setErrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); } } #endregion return(setErrorMsg); }
/// <summary> /// 添加其他信息 /// </summary> /// <param name="model">信息实体</param> /// <returns>true:成功,false:失败</returns> public bool AddOther(EyouSoft.Model.PlanStructure.MPlanBaseInfo model) { return(OtherAddOrUpdate(model, true)); }
/// <summary> /// 保存 /// </summary> /// <returns></returns> void PageSave() { #region 表单赋值 string seterrorMsg = string.Empty; string msg = string.Empty; //导游姓名 string guidName = Utils.GetFormValue(this.GuidControl1.GuidNameClient); //导游id string guidID = Utils.GetFormValue(this.GuidControl1.GuidIDClient); //导游电话 string guidPhone = Utils.GetFormValue(this.txtguidPhone.UniqueID); //上团地点 string GroupPlace = Utils.GetFormValue(this.txtGroupPlace.UniqueID); //上团时间 DateTime groupTime = Utils.GetDateTime(Utils.GetFormValue(this.txtGroupTime.UniqueID)); //下团地点 string UnderPlace = Utils.GetFormValue(this.txtUnderPlace.UniqueID); //下团时间 DateTime UnderPlaceTime = Utils.GetDateTime(Utils.GetFormValue(this.txtunderTime.UniqueID)); //任务类型 string guidJobType = Utils.GetFormValue(this.guidType.UniqueID); //接待行程 string treval = Utils.GetFormValue(this.txttravel.UniqueID); //服务标准 string serverStande = Utils.GetFormValue(this.txtserverStand.UniqueID); //其它备注 //string remark = Utils.GetFormValue(this.txtOtherRemark.UniqueID); //费用明细 string CostParticu = Utils.GetFormValue(this.txtCostParticu.UniqueID); //结算费用 decimal CostAccount = Utils.GetDecimal(Utils.GetFormValue(this.txtCostAccount.UniqueID)); string daoYouXuZhi = Utils.GetFormValue(txtDaoYouXuZhi.UniqueID); #endregion #region 后台验证 if (string.IsNullOrEmpty(guidID) && string.IsNullOrEmpty(guidName)) { msg += "请选择导游!<br/>"; } if (string.IsNullOrEmpty(GroupPlace)) { msg += "请输入上团地点!<br/>"; } if (string.IsNullOrEmpty(groupTime.ToString())) { msg += "请选择上团时间!<br/>"; } if (string.IsNullOrEmpty(UnderPlace)) { msg += "请输入下团地点!<br/>"; } if (string.IsNullOrEmpty(UnderPlaceTime.ToString())) { msg += "请选择下团时间!<br/>"; } if (string.IsNullOrEmpty(guidJobType)) { msg += "请选择导游任务类型!<br/>"; } if (string.IsNullOrEmpty(Utils.GetFormValue("status"))) { msg += "请选择计调状态!<br/>"; } if (CostAccount <= 0) { msg += "请填写结算费用!<br/>"; } if (msg != "") { seterrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); RCWE(seterrorMsg); } #endregion #region 实体赋值 EyouSoft.Model.PlanStructure.MPlanBaseInfo baseInfo = new EyouSoft.Model.PlanStructure.MPlanBaseInfo(); baseInfo.AddStatus = EyouSoft.Model.EnumType.PlanStructure.PlanAddStatus.计调安排时添加; baseInfo.CompanyId = this.SiteUserInfo.CompanyId; baseInfo.Confirmation = CostAccount; baseInfo.PlanCost = CostAccount; baseInfo.ContactPhone = guidPhone; baseInfo.CostDetail = CostParticu; baseInfo.IssueTime = System.DateTime.Now; baseInfo.Num = new TimeSpan(UnderPlaceTime.Ticks).Subtract(new TimeSpan(groupTime.Ticks)).Duration().Days; baseInfo.PlanGuide = new EyouSoft.Model.PlanStructure.MPlanGuide(); baseInfo.PlanGuide.NextLocation = UnderPlace; baseInfo.PlanGuide.OnLocation = GroupPlace; baseInfo.PlanGuide.TaskType = (EyouSoft.Model.EnumType.PlanStructure.PlanGuideTaskType)Enum.Parse(typeof(EyouSoft.Model.EnumType.PlanStructure.PlanGuideTaskType), guidJobType); baseInfo.SourceName = guidName; baseInfo.SourceId = guidID; baseInfo.ReceiveJourney = treval; //baseInfo.Remarks = remark; baseInfo.GuideNotes = daoYouXuZhi; baseInfo.ServiceStandard = serverStande; baseInfo.StartDate = groupTime; baseInfo.EndDate = UnderPlaceTime; baseInfo.TourId = TourId; baseInfo.Type = EyouSoft.Model.EnumType.PlanStructure.PlanProject.导游; baseInfo.SueId = ""; baseInfo.OperatorId = this.SiteUserInfo.UserId; baseInfo.OperatorName = this.SiteUserInfo.Name; baseInfo.Status = (EyouSoft.Model.EnumType.PlanStructure.PlanState)Utils.GetInt(Utils.GetFormValue("status")); baseInfo.DeptId = this.SiteUserInfo.DeptId; baseInfo.PaymentType = EyouSoft.Model.EnumType.PlanStructure.Payment.导游现付; #endregion #region 提交操作 //导游id string editid = Utils.GetQueryStringValue("planId"); //修改 if (editid != "" && editid != null) { baseInfo.PlanId = editid; baseInfo.PlanGuide.PlanId = editid; if (new EyouSoft.BLL.PlanStructure.BPlan().UpdPlan(baseInfo) > 0) { msg += "修改成功!"; seterrorMsg = UtilsCommons.AjaxReturnJson("1", "" + msg + ""); } else { msg += "修改失败!"; seterrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); } } else //添加 { if (new EyouSoft.BLL.PlanStructure.BPlan().AddPlan(baseInfo) > 0) { msg += "添加成功!"; seterrorMsg = UtilsCommons.AjaxReturnJson("1", "" + msg + ""); } else { msg += "添加失败!"; seterrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); } } #endregion RCWE(seterrorMsg); }
/// <summary> /// 保存 /// </summary> /// <returns></returns> protected string PageSave() { #region 表单赋值 string msg = string.Empty; string seterrorMsg = string.Empty; //车队 string CarName = Utils.GetFormValue(this.SupplierControl1.ClientText); string CarId = Utils.GetFormValue(this.SupplierControl1.ClientValue); //联系人 联系电话 联系传真 string contectName = Utils.GetFormValue(this.txtContectName.UniqueID); string contectPhone = Utils.GetFormValue(this.txtContectPhone.UniqueID); string contectFax = Utils.GetFormValue(this.txtContectFax.UniqueID); //用车时间开始 开始时间点 结束 结束时间点 DateTime startTime = Utils.GetDateTime(Utils.GetFormValue(this.txtUseCarTime.UniqueID)); string timeHours1 = Utils.GetFormValue(this.txttime1.UniqueID); DateTime endTime = Utils.GetDateTime(Utils.GetFormValue(this.txtUseCarTime2.UniqueID)); string timeHours2 = Utils.GetFormValue(this.txttime2.UniqueID); //用车类型 车型 车牌号 string useCarType = Utils.GetFormValue(this.ddlUserCarType.UniqueID); string carTypeId = Utils.GetFormValue("selCarModel").Split(',')[0]; string carType = Utils.GetFormValue("selCarModel").Split(',')[1]; string carNumber = Utils.GetFormValue(this.txtCarNumber.UniqueID); //司机 司机电话 string driverName = Utils.GetFormValue(this.txtDirverName.UniqueID); string driverPhone = Utils.GetFormValue(this.txDirverPhone.UniqueID); //费用明细 用车数量 结算费用 string CostParticu = Utils.GetFormValue(this.txtCostParticu.UniqueID); string useCarnums = Utils.GetFormValue(this.txtUseCarNums.UniqueID); decimal totalMoney = Utils.GetDecimal(Utils.GetFormValue(this.txttotalMoney.UniqueID)); //接待行程 导游需知 其它备注 返利 支付方式 状态 string travel = Utils.GetFormValue(this.txtTravel.UniqueID); string guidNotes = Utils.GetFormValue(this.txtGuidNotes.UniqueID); string otherRemark = Utils.GetFormValue(this.txtOtherRemark.UniqueID); bool profit = Utils.GetFormValue(this.ddlProfit.UniqueID) == "0" ? true : false; #endregion #region 表单验证 if (string.IsNullOrEmpty(CarId) && string.IsNullOrEmpty(CarName)) { msg += "请选择车队!<br/>"; } if (string.IsNullOrEmpty(startTime.ToString())) { msg += "请输入用车开始时间天!<br/>"; } /*if (string.IsNullOrEmpty(timeHours1) || timeHours1 == "点时间") * { * msg += "请输入用车开始时间点!<br/>"; * }*/ /*if (string.IsNullOrEmpty(endTime.ToString())) * { * msg += "请输入用车结束时间天!<br/>"; * }*/ /*if (string.IsNullOrEmpty(timeHours2) || timeHours2 == "点时间") * { * msg += "请输入用车结束时间点!<br/>"; * }*/ if (useCarType.ToString() == "-1") { msg += "请选择用车类型!<br/>"; } if (string.IsNullOrEmpty(CostParticu)) { msg += "请输入费用明细!<br/>"; } if (totalMoney <= 0) { msg += "请输入结算费用!<br/>"; } if (string.IsNullOrEmpty(Utils.GetFormValue("selPenyMent"))) { msg += "请选择支付方式!<br/>"; } if (string.IsNullOrEmpty(Utils.GetFormValue("SelStatus"))) { msg += "请选择状态!<br/>"; } if (string.IsNullOrEmpty(Utils.GetFormValue(this.ddlProfit.UniqueID))) { msg += "请选择是否返利!<br/>"; } if (msg != "") { seterrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); return(seterrorMsg); } #endregion #region 实体赋值 EyouSoft.Model.PlanStructure.MPlanBaseInfo baseinfo = new EyouSoft.Model.PlanStructure.MPlanBaseInfo(); baseinfo.AddStatus = EyouSoft.Model.EnumType.PlanStructure.PlanAddStatus.计调安排时添加; baseinfo.CompanyId = this.SiteUserInfo.CompanyId; baseinfo.Confirmation = totalMoney; baseinfo.PlanCost = totalMoney; baseinfo.ContactFax = contectFax; baseinfo.ContactName = contectName; baseinfo.ContactPhone = contectPhone; baseinfo.CostDetail = CostParticu; baseinfo.StartTime = (timeHours1 == "点时间" ? "" : timeHours1); baseinfo.StartDate = startTime; baseinfo.EndTime = (timeHours2 == "点时间" ? "" : timeHours2); baseinfo.EndDate = endTime; baseinfo.GuideNotes = guidNotes; baseinfo.IsRebate = profit; baseinfo.IssueTime = System.DateTime.Now; baseinfo.Num = Utils.GetInt(useCarnums); baseinfo.PaymentType = (EyouSoft.Model.EnumType.PlanStructure.Payment)Utils.GetInt(Utils.GetFormValue("selPenyMent")); baseinfo.Status = (EyouSoft.Model.EnumType.PlanStructure.PlanState)Utils.GetInt(Utils.GetFormValue("SelStatus")); baseinfo.SourceId = Utils.GetFormValue(this.SupplierControl1.ClientValue); baseinfo.SourceName = Utils.GetFormValue(this.SupplierControl1.ClientText); if (Utils.GetFormValue(this.SupplierControl1.ClientIsyukong) == "1") { baseinfo.SueId = Utils.GetFormValue(this.SupplierControl1.ClientzyykValue); } baseinfo.Type = EyouSoft.Model.EnumType.PlanStructure.PlanProject.用车; baseinfo.TourId = Utils.GetQueryStringValue("tourId"); baseinfo.ReceiveJourney = travel; baseinfo.PlanCar = new EyouSoft.Model.PlanStructure.MPlanCar(); baseinfo.PlanCar.VehicleType = (EyouSoft.Model.EnumType.PlanStructure.PlanCarType)Enum.Parse(typeof(EyouSoft.Model.EnumType.PlanStructure.PlanCarType), useCarType); baseinfo.PlanCar.Models = carType; baseinfo.PlanCar.CarId = carTypeId; baseinfo.PlanCar.Driver = driverName; baseinfo.PlanCar.DriverPhone = driverPhone; baseinfo.PlanCar.CarNumber = carNumber; baseinfo.Remarks = otherRemark; baseinfo.OperatorId = this.SiteUserInfo.UserId; baseinfo.OperatorName = this.SiteUserInfo.Name; #endregion #region 提交操作 string editid = Utils.GetQueryStringValue("planId"); EyouSoft.BLL.PlanStructure.BPlan bll = new EyouSoft.BLL.PlanStructure.BPlan(); int result = 0; if (editid != "" && editid != null) { baseinfo.PlanId = editid; baseinfo.PlanCar.PlanId = editid; result = bll.UpdPlan(baseinfo); if (result == 1) { msg += "修改成功!"; seterrorMsg = UtilsCommons.AjaxReturnJson("1", "" + msg + ""); } else if (result == 0) { msg += "修改失败!"; seterrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); } else if (result == -2) { msg += "预控数量不足,修改失败!"; seterrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); } } else { result = bll.AddPlan(baseinfo); if (result == 1) { msg += "添加成功!"; seterrorMsg = UtilsCommons.AjaxReturnJson("1", "" + msg + ""); } else if (result == 0) { msg += "添加失败!"; seterrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); } else if (result == -2) { msg += "预控数量不足,添加失败!"; seterrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); } } #endregion return(seterrorMsg); }
/// <summary> /// 初始化信息 /// </summary> private void InitInfo() { string orderid = string.Empty; EyouSoft.BLL.TourStructure.BTour bll = new EyouSoft.BLL.TourStructure.BTour(); EyouSoft.Model.TourStructure.MTourBaseInfo baseModel = bll.GetTourInfo(TourId); if (baseModel == null) { RCWE("异常请求"); } EyouSoft.Model.TourStructure.MTourTeamInfo teamModel = null; EyouSoft.Model.TourStructure.MTourSanPinInfo sanpinModel = null; switch (baseModel.TourType) { case EyouSoft.Model.EnumType.TourStructure.TourType.出境团队: case EyouSoft.Model.EnumType.TourStructure.TourType.地接团队: case EyouSoft.Model.EnumType.TourStructure.TourType.组团团队: teamModel = (EyouSoft.Model.TourStructure.MTourTeamInfo)baseModel; break; case EyouSoft.Model.EnumType.TourStructure.TourType.单项服务: this.TGuideNote.Visible = false; this.TReceiveJourney.Visible = false; this.TService.Visible = false; this.ph_rpt_OrderinfoList.Visible = false; return; default: sanpinModel = (EyouSoft.Model.TourStructure.MTourSanPinInfo)baseModel; break; } #region 订单信息 EyouSoft.BLL.TourStructure.BTourOrder bllorder = new EyouSoft.BLL.TourStructure.BTourOrder(); EyouSoft.Model.TourStructure.MOrderSum ordersum = new EyouSoft.Model.TourStructure.MOrderSum(); IList <EyouSoft.Model.TourStructure.MTourOrder> MtourOrder = bllorder.GetTourOrderListById(TourId, ref ordersum).Where(c => c.OrderStatus == EyouSoft.Model.EnumType.TourStructure.OrderStatus.已成交).ToList(); if (MtourOrder != null && MtourOrder.Count > 0) { this.rpt_OrderinfoList.DataSource = MtourOrder; this.rpt_OrderinfoList.DataBind(); } else { this.ph_rpt_OrderinfoList.Visible = false; } #endregion #region 团队信息 if (teamModel != null) { this.lbRouteName.Text = teamModel.RouteName; this.lbTourCode.Text = teamModel.TourCode; this.lbdayCount.Text = teamModel.TourDays.ToString(); this.lbstarttime.Text = UtilsCommons.GetDateString(teamModel.LDate, ProviderToDate); this.lbendtime.Text = UtilsCommons.GetDateString(teamModel.RDate, ProviderToDate); if (teamModel.GuideList != null && teamModel.GuideList.Count > 0) { string guidelist = string.Empty; for (int i = 0; i < teamModel.GuideList.Count; i++) { if (i == teamModel.GuideList.Count - 1) { guidelist += teamModel.GuideList[i].Name; } else { guidelist += teamModel.GuideList[i].Name + "、"; } } this.lbguidename.Text = guidelist; } this.lbpeoplecount.Text = teamModel.PlanPeopleNumber.ToString(); if (teamModel.TourPlaner != null && teamModel.TourPlaner.Count > 0) { string planerlist = string.Empty; for (int i = 0; i < teamModel.TourPlaner.Count; i++) { if (i == teamModel.TourPlaner.Count - 1) { planerlist += teamModel.TourPlaner[i].Planer; } else { planerlist += teamModel.TourPlaner[i].Planer + "、"; } } var jiDiaoInfo = new EyouSoft.BLL.ComStructure.BComUser().GetModel(teamModel.TourPlaner[0].PlanerId, CurrentUserCompanyID); if (jiDiaoInfo != null) { planerlist += " " + jiDiaoInfo.ContactMobile + " " + jiDiaoInfo.ContactTel; } this.lbplander.Text = planerlist; } if (teamModel.SaleInfo != null) { var xiaoShouYuanInfo = new EyouSoft.BLL.ComStructure.BComUser().GetModel(teamModel.SaleInfo.SellerId, CurrentUserCompanyID); if (xiaoShouYuanInfo != null) { teamModel.SaleInfo.Mobile = xiaoShouYuanInfo.ContactMobile; teamModel.SaleInfo.Phone = xiaoShouYuanInfo.ContactTel; } this.lbsellerinfo.Text = teamModel.SaleInfo.Name + " " + teamModel.SaleInfo.Mobile + " " + teamModel.SaleInfo.Phone; } } else if (sanpinModel != null) { this.lbRouteName.Text = baseModel.RouteName; this.lbTourCode.Text = baseModel.TourCode; this.lbdayCount.Text = baseModel.TourDays.ToString(); this.lbstarttime.Text = UtilsCommons.GetDateString(baseModel.LDate, ProviderToDate); this.lbendtime.Text = UtilsCommons.GetDateString(baseModel.RDate, ProviderToDate); if (baseModel.GuideList != null && baseModel.GuideList.Count > 0) { string guidelist = string.Empty; for (int i = 0; i < baseModel.GuideList.Count; i++) { if (i == baseModel.GuideList.Count - 1) { guidelist += baseModel.GuideList[i].Name; } else { guidelist += baseModel.GuideList[i].Name + "、"; } } this.lbguidename.Text = guidelist; } this.lbpeoplecount.Text = baseModel.PlanPeopleNumber.ToString(); if (baseModel.TourPlaner != null && baseModel.TourPlaner.Count > 0) { string planerlist = string.Empty; for (int i = 0; i < baseModel.TourPlaner.Count; i++) { if (i == baseModel.TourPlaner.Count - 1) { planerlist += baseModel.TourPlaner[i].Planer; } else { planerlist += baseModel.TourPlaner[i].Planer + "、"; } } var jiDiaoInfo = new EyouSoft.BLL.ComStructure.BComUser().GetModel(baseModel.TourPlaner[0].PlanerId, CurrentUserCompanyID); if (jiDiaoInfo != null) { planerlist += " " + jiDiaoInfo.ContactMobile + " " + jiDiaoInfo.ContactTel; } this.lbplander.Text = planerlist; } if (baseModel.SaleInfo != null) { var xiaoShouYuanInfo = new EyouSoft.BLL.ComStructure.BComUser().GetModel(baseModel.SaleInfo.SellerId, CurrentUserCompanyID); if (xiaoShouYuanInfo != null) { baseModel.SaleInfo.Mobile = xiaoShouYuanInfo.ContactMobile; baseModel.SaleInfo.Phone = xiaoShouYuanInfo.ContactTel; } this.lbsellerinfo.Text = baseModel.SaleInfo.Name + " " + baseModel.SaleInfo.Mobile + " " + baseModel.SaleInfo.Phone; } } else { return; } #endregion #region 计调信息 EyouSoft.BLL.PlanStructure.BPlan bllPlan = new EyouSoft.BLL.PlanStructure.BPlan(); EyouSoft.Model.PlanStructure.MPlanBaseInfo planinfo = bllPlan.GetGuidePrint(TourId); #region 导游安排接待行程 if (!string.IsNullOrEmpty(planinfo.ReceiveJourney)) { TReceiveJourney.Visible = true; this.lbReceiveJourney.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(planinfo.ReceiveJourney); } else { TReceiveJourney.Visible = false; } #endregion #region 导游安排服务标准 if (!string.IsNullOrEmpty(planinfo.ServiceStandard)) { TService.Visible = true; this.lbServiceStandard.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(planinfo.ServiceStandard); } else { TService.Visible = false; } #endregion #region 导游须知 if (!string.IsNullOrEmpty(planinfo.GuideNotes)) { TGuideNote.Visible = true; this.lbGuidNote.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(planinfo.GuideNotes); } else { this.TGuideNote.Visible = false; } #endregion #region 团队支付详单 #region 导游 IList <EyouSoft.Model.PlanStructure.MPlan> GuidePlanList = bllPlan.GetList(EyouSoft.Model.EnumType.PlanStructure.PlanProject.导游, null, null, false, null, TourId, PlanState.已落实); GuidePlanList = GetZhiChus(GuidePlanList); if (GuidePlanList != null && GuidePlanList.Count > 0) { this.guid = GuidePlanList.Count; this.rpt_guid.DataSource = GuidePlanList; this.rpt_guid.DataBind(); } else { this.ph_guid.Visible = false; } #endregion #region 地接 IList <EyouSoft.Model.PlanStructure.MPlan> groundPlanList = bllPlan.GetList(EyouSoft.Model.EnumType.PlanStructure.PlanProject.地接, null, null, false, null, TourId, PlanState.已落实); groundPlanList = GetZhiChus(groundPlanList); if (groundPlanList != null && groundPlanList.Count > 0) { this.dijie = groundPlanList.Count; this.rpt_dijie.DataSource = groundPlanList; this.rpt_dijie.DataBind(); } else { this.ph_dijie.Visible = false; } #endregion #region 飞机 IList <EyouSoft.Model.PlanStructure.MPlan> phanePlanList = bllPlan.GetList(EyouSoft.Model.EnumType.PlanStructure.PlanProject.飞机, null, null, false, null, TourId, PlanState.已落实); phanePlanList = GetZhiChus(phanePlanList); if (phanePlanList != null && phanePlanList.Count > 0) { this.plane = phanePlanList.Count; this.rpt_plane.DataSource = phanePlanList; this.rpt_plane.DataBind(); } else { this.ph_plane.Visible = false; } #endregion #region 购物 IList <EyouSoft.Model.PlanStructure.MPlan> shopPlanList = bllPlan.GetList(EyouSoft.Model.EnumType.PlanStructure.PlanProject.购物, null, null, false, null, TourId, PlanState.已落实); shopPlanList = GetZhiChus(shopPlanList); if (shopPlanList != null && shopPlanList.Count > 0) { this.gouwu = shopPlanList.Count; this.rpt_gouwu.DataSource = shopPlanList; this.rpt_gouwu.DataBind(); } else { this.ph_gouwu.Visible = false; } #endregion #region 国内游轮 IList <EyouSoft.Model.PlanStructure.MPlan> InshipPlanList = bllPlan.GetList(EyouSoft.Model.EnumType.PlanStructure.PlanProject.国内游轮, null, null, false, null, TourId, PlanState.已落实); InshipPlanList = GetZhiChus(InshipPlanList); if (InshipPlanList != null && InshipPlanList.Count > 0) { this.guoneichuan = InshipPlanList.Count; this.rpt_guoneichuan.DataSource = InshipPlanList; this.rpt_guoneichuan.DataBind(); } else { this.ph_guoneichuan.Visible = false; } #endregion #region 涉外游轮 IList <EyouSoft.Model.PlanStructure.MPlan> OutshipPlanList = bllPlan.GetList(EyouSoft.Model.EnumType.PlanStructure.PlanProject.涉外游轮, null, null, false, null, TourId, PlanState.已落实); OutshipPlanList = GetZhiChus(OutshipPlanList); if (OutshipPlanList != null && OutshipPlanList.Count > 0) { this.shewaichuan = OutshipPlanList.Count; this.rpt_shewaichuan.DataSource = OutshipPlanList; this.rpt_shewaichuan.DataBind(); } else { this.ph_shewaichuan.Visible = false; } #endregion #region 火车 IList <EyouSoft.Model.PlanStructure.MPlan> trainPlanList = bllPlan.GetList(EyouSoft.Model.EnumType.PlanStructure.PlanProject.火车, null, null, false, null, TourId, PlanState.已落实); trainPlanList = GetZhiChus(trainPlanList); if (trainPlanList != null && trainPlanList.Count > 0) { this.train = trainPlanList.Count; this.rpt_train.DataSource = trainPlanList; this.rpt_train.DataBind(); } else { this.ph_train.Visible = false; } #endregion #region 景点 IList <EyouSoft.Model.PlanStructure.MPlan> scenicPlanList = bllPlan.GetList(EyouSoft.Model.EnumType.PlanStructure.PlanProject.景点, null, null, false, null, TourId, PlanState.已落实); scenicPlanList = GetZhiChus(scenicPlanList); if (scenicPlanList != null && scenicPlanList.Count > 0) { this.jingdian = scenicPlanList.Count; this.rpt_jingdian.DataSource = scenicPlanList; this.rpt_jingdian.DataBind(); } else { this.ph_jingdian.Visible = false; } #endregion #region 酒店 IList <EyouSoft.Model.PlanStructure.MPlan> hotelPlanList = bllPlan.GetList(EyouSoft.Model.EnumType.PlanStructure.PlanProject.酒店, null, null, false, null, TourId, PlanState.已落实); hotelPlanList = GetZhiChus(hotelPlanList); if (hotelPlanList != null && hotelPlanList.Count > 0) { this.hotel = hotelPlanList.Count; this.rpt_hotellistk.DataSource = hotelPlanList; this.rpt_hotellistk.DataBind(); } else { this.ph_hotel.Visible = false; } #endregion #region 领料 IList <EyouSoft.Model.PlanStructure.MPlan> lingliaolPlanList = bllPlan.GetList(EyouSoft.Model.EnumType.PlanStructure.PlanProject.领料, null, null, false, null, TourId, PlanState.已落实); lingliaolPlanList = GetZhiChus(lingliaolPlanList); if (lingliaolPlanList != null && lingliaolPlanList.Count > 0) { this.lingliao = lingliaolPlanList.Count; this.rpt_lingliao.DataSource = lingliaolPlanList; this.rpt_lingliao.DataBind(); } else { this.ph_lingliao.Visible = false; } #endregion #region 其它 IList <EyouSoft.Model.PlanStructure.MPlan> otherlPlanList = bllPlan.GetList(EyouSoft.Model.EnumType.PlanStructure.PlanProject.其它, null, null, false, null, TourId, PlanState.已落实); otherlPlanList = GetZhiChus(otherlPlanList); if (otherlPlanList != null && otherlPlanList.Count > 0) { this.qita = otherlPlanList.Count; this.rpt_qita.DataSource = otherlPlanList; this.rpt_qita.DataBind(); } else { this.ph_qita.Visible = false; } #endregion #region 汽车 IList <EyouSoft.Model.PlanStructure.MPlan> busPlanList = bllPlan.GetList(EyouSoft.Model.EnumType.PlanStructure.PlanProject.汽车, null, null, false, null, TourId, PlanState.已落实); busPlanList = GetZhiChus(busPlanList); if (busPlanList != null && busPlanList.Count > 0) { this.bus = busPlanList.Count; this.rpt_bus.DataSource = busPlanList; this.rpt_bus.DataBind(); } else { this.ph_bus.Visible = false; } #endregion #region 用餐 IList <EyouSoft.Model.PlanStructure.MPlan> yongcanPlanList = bllPlan.GetList(EyouSoft.Model.EnumType.PlanStructure.PlanProject.用餐, null, null, false, null, TourId, PlanState.已落实); yongcanPlanList = GetZhiChus(yongcanPlanList); if (yongcanPlanList != null && yongcanPlanList.Count > 0) { this.yongcan = yongcanPlanList.Count; this.rpt_yongcan.DataSource = yongcanPlanList; this.rpt_yongcan.DataBind(); } else { this.ph_yongcan.Visible = false; } #endregion #region 用车 IList <EyouSoft.Model.PlanStructure.MPlan> carPlanList = bllPlan.GetList(EyouSoft.Model.EnumType.PlanStructure.PlanProject.用车, null, null, false, null, TourId, PlanState.已落实); carPlanList = GetZhiChus(carPlanList); if (carPlanList != null && carPlanList.Count > 0) { this.chedui = carPlanList.Count; this.rpt_chedui.DataSource = carPlanList; this.rpt_chedui.DataBind(); } else { this.ph_chedui.Visible = false; } #endregion #endregion #endregion }
void PageSave() { #region 表单赋值 string msg = string.Empty; string seterrorMsg = string.Empty; //景点公司name id string spotComName = Utils.GetFormValue(this.supplierControl1.ClientText); string spotComID = Utils.GetFormValue(this.supplierControl1.ClientValue); //联系人 电话 传真 string contectName = Utils.GetFormValue(this.txtContectName.UniqueID); string contectPhone = Utils.GetFormValue(this.txtContectPhone.UniqueID); string contectFax = Utils.GetFormValue(this.txtContectFax.UniqueID); //景点名称 人数(成人 儿童) string spotName = Utils.GetFormValue("spotList").Split(',')[1]; string adultNum = Utils.GetFormValue(this.txtAdultNums.UniqueID); string childrenNum = Utils.GetFormValue(this.txtChildrenNums.UniqueID); //游览时间 DateTime?lookAbout1 = Utils.GetDateTimeNullable(Utils.GetFormValue(this.txtLookAbout1.UniqueID)); string scanTime1 = Utils.GetFormValue(this.txtScanTime1.UniqueID); DateTime?lookAbout2 = Utils.GetDateTimeNullable(Utils.GetFormValue(this.txtLookAbout2.UniqueID)); string scanTime2 = Utils.GetFormValue(this.txtScanTime2.UniqueID); //费用明细 结算费用 string CostParticu = Utils.GetFormValue(this.txtCostParticu.UniqueID); decimal totalMoney = Utils.GetDecimal(Utils.GetFormValue(this.txttotalMoney.UniqueID)); //导游需知 其它备注 string guidNotes = Utils.GetFormValue(this.txtGuidNotes.UniqueID); string otherRemark = Utils.GetFormValue(this.txtOtherRemarks.UniqueID); #endregion #region 后台验证 if (string.IsNullOrEmpty(spotComID) && string.IsNullOrEmpty(spotComName)) { msg += "请选择景点公司!<br/>"; } if (string.IsNullOrEmpty(spotName)) { msg += "请选择景点名称!<br/>"; } if (string.IsNullOrEmpty(adultNum)) { msg += "请输入成人数!<br/>"; } if (!lookAbout1.HasValue) { msg += "请输入浏览开始时间!<br>"; } /*if (string.IsNullOrEmpty(scanTime1.ToString())) * { * msg += "请输入浏览时间!<br/>"; * }*/ /*if (string.IsNullOrEmpty(lookAbout2.ToString())) * { * msg += "请输入浏览时间!<br/>"; * }*/ /*if (string.IsNullOrEmpty(scanTime2.ToString())) * { * msg += "请输入浏览时间!<br/>"; * }*/ if (totalMoney <= 0) { msg += "请输入结算费用!<br/>"; } if (string.IsNullOrEmpty(Utils.GetFormValue("SelStatus"))) { msg += "请选择状态!<br/>"; } if (string.IsNullOrEmpty(Utils.GetFormValue(this.ddlProfit1.UniqueID))) { msg += "请选择是否返利!<br/>"; } if (!string.IsNullOrEmpty(msg)) { seterrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); RCWE(seterrorMsg); } #endregion #region 实体赋值 EyouSoft.Model.PlanStructure.MPlanBaseInfo baseinfo = new EyouSoft.Model.PlanStructure.MPlanBaseInfo(); baseinfo.AddStatus = EyouSoft.Model.EnumType.PlanStructure.PlanAddStatus.计调安排时添加; baseinfo.CompanyId = SiteUserInfo.CompanyId; baseinfo.Confirmation = totalMoney; baseinfo.PlanCost = totalMoney; baseinfo.ContactFax = contectFax; baseinfo.ContactName = contectName; baseinfo.ContactPhone = contectPhone; baseinfo.EndDate = lookAbout2; baseinfo.EndTime = scanTime2; baseinfo.GuideNotes = guidNotes; baseinfo.IsRebate = Utils.GetFormValue(this.ddlProfit1.UniqueID) == "0" ? true : false; baseinfo.IssueTime = System.DateTime.Now; baseinfo.Num = Utils.GetInt(adultNum) + Utils.GetInt(childrenNum); baseinfo.PaymentType = (EyouSoft.Model.EnumType.PlanStructure.Payment)Utils.GetInt(Utils.GetFormValue("SelPanyMent")); baseinfo.Remarks = otherRemark; baseinfo.SourceId = spotComID; baseinfo.SourceName = spotComName; baseinfo.StartDate = lookAbout1; baseinfo.StartTime = scanTime1; baseinfo.Status = (EyouSoft.Model.EnumType.PlanStructure.PlanState)Utils.GetInt(Utils.GetFormValue("SelStatus")); if (Utils.GetFormValue(this.supplierControl1.ClientIsyukong) == "1") { baseinfo.SueId = Utils.GetFormValue(this.supplierControl1.ClientzyykValue); } baseinfo.TourId = Utils.GetQueryStringValue("tourId"); baseinfo.Type = EyouSoft.Model.EnumType.PlanStructure.PlanProject.景点; baseinfo.PlanAttractions = new EyouSoft.Model.PlanStructure.MPlanAttractions(); baseinfo.PlanAttractions.ChildNumber = Utils.GetInt(childrenNum); baseinfo.PlanAttractions.AdultNumber = Utils.GetInt(adultNum); baseinfo.PlanAttractions.Attractions = spotName; baseinfo.PlanAttractions.AttractionsId = Utils.GetFormValue("spotList").Split(',')[0]; baseinfo.OperatorId = this.SiteUserInfo.UserId; baseinfo.OperatorName = this.SiteUserInfo.Name; baseinfo.CostDetail = CostParticu; #endregion #region 表单提交 //景点id string editid = Utils.GetQueryStringValue("PlanId"); if (editid != "" && editid != null) //修改 { baseinfo.PlanAttractions.PlanId = editid; baseinfo.PlanId = editid; var r = new EyouSoft.BLL.PlanStructure.BPlan().UpdPlan(baseinfo); if (r == 1) { msg += "修改成功!"; seterrorMsg = UtilsCommons.AjaxReturnJson("1", "" + msg + ""); } else if (r == 0) { msg += "修改失败!"; seterrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); } else if (r == -2) { msg += "预控数量不足,修改失败!"; seterrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); } } else //添加 { var r = new EyouSoft.BLL.PlanStructure.BPlan().AddPlan(baseinfo); if (r == 1) { msg += "添加成功!"; seterrorMsg = UtilsCommons.AjaxReturnJson("1", "" + msg + ""); } else if (r == 0) { msg += "添加失败!"; seterrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); } else if (r == -2) { msg += "预控数量不足,修改失败!"; seterrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); } } RCWE(seterrorMsg); #endregion }
/// <summary> /// 保存 /// </summary> /// <returns></returns> protected string PageSaveC() { #region 表单取值 string msg = string.Empty; string seterrormsg = string.Empty; //游船公司id name string shipIdC = Utils.GetFormValue(this.SupplierControl2.ClientValue); string shipNameC = Utils.GetFormValue(this.SupplierControl2.ClientText); //联系人 电话 传真 string contectName = Utils.GetFormValue(this.txtContectNameC.UniqueID); string contectPhone = Utils.GetFormValue(this.txtContectPhoneC.UniqueID); string contectFax = Utils.GetFormValue(this.txtContectFaxC.UniqueID); //船名 线路 string shipId = string.Empty; string shipname = string.Empty; if (!string.IsNullOrEmpty(Utils.GetFormValue("SelShipNameC"))) { shipId = Utils.GetFormValue("SelShipNameC").Split(',')[0]; shipname = Utils.GetFormValue("SelShipNameC").Split(',')[1]; } string route = Utils.GetFormValue(this.txtRouteC.UniqueID); //登船日期 时间 登船码头 停靠景点 DateTime?boardDate = Utils.GetDateTimeNullable(Utils.GetFormValue(this.txtBoardDateC.UniqueID)); string boardtime = Utils.GetFormValue(this.txtBoardTimeC.UniqueID); string boardWhilfC = Utils.GetFormValue(this.txtBoardWhilfC.UniqueID); string stopAttr = Utils.GetFormValue(this.txtStopAttrC.UniqueID); //价格组成 string[] AircraftType = Utils.GetFormValues("selAircraft"); string[] adultNums = Utils.GetFormValues("AdultNumsC"); string[] adultPrices = Utils.GetFormValues("adultPricesC"); //string[] childNums = Utils.GetFormValues("childrenNumC"); //string[] childPrices = Utils.GetFormValues("childrenpricesC"); //自费项目 //string ownCost = Utils.GetFormValue(this.txtOwnCostC.UniqueID); //string ownPeopleNums = Utils.GetFormValue(this.txtOwnCostNumsC.UniqueID); //decimal ownUnitPrices = Utils.GetDecimal(Utils.GetFormValue(this.txtOwnUnitPricesC.UniqueID)); //结算费用 decimal totalPrices = Utils.GetDecimal(Utils.GetFormValue(this.txttotalPricesC.UniqueID)); //费用明细 string costDetail = Utils.GetFormValue(this.txtCostDetailC.UniqueID); //导游需知 其它备注 string guidNotes = Utils.GetFormValue(this.txtGuidNotesC.UniqueID); string otherRemrk = Utils.GetFormValue(this.txtOtherMarkC.UniqueID); string[] txtGuoNeiXiaoJi = Utils.GetFormValues("txtGuoNeiXiaoJi"); string[] txtGuoNeiBeiZhu = Utils.GetFormValues("txtGuoNeiBeiZhu"); #endregion #region 后台验证 if (string.IsNullOrEmpty(shipIdC) && string.IsNullOrEmpty(shipNameC)) { msg += "请选择游轮公司!<br/>"; } if (string.IsNullOrEmpty(route)) { msg += "请输入线路!<br/>"; } if (string.IsNullOrEmpty(boardWhilfC)) { msg += "请输入登船码头!<br/>"; } if (totalPrices <= 0) { msg += "请输入结算价格!<br/>"; } if (string.IsNullOrEmpty(Utils.GetFormValue("SelPanyMentC"))) { msg += "请选择支付方式!<br/>"; } if (string.IsNullOrEmpty(Utils.GetFormValue("SelStateC"))) { msg += "请选择状态!<br/>"; } if (string.IsNullOrEmpty(Utils.GetFormValue(this.ddlprofit2.UniqueID))) { msg += "请选择是否返利!<br/>"; } if (AircraftType.Length > 0) { for (int i = 0; i < AircraftType.Length; i++) { if (string.IsNullOrEmpty(AircraftType[i])) { msg += "请选择舱位类型!<br/>"; } } } if (adultNums.Length > 0) { for (int i = 0; i < adultNums.Length; i++) { if (string.IsNullOrEmpty(adultNums[i]) || Utils.GetInt(adultNums[i]) < 0) { msg += "请输入人数!<br/>"; } } } if (adultPrices.Length > 0) { for (int i = 0; i < adultPrices.Length; i++) { if (Utils.GetDecimal(adultPrices[i]) < 0) { msg += "请输入单价格!<br/>"; } } } if (msg != "") { seterrormsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); return(seterrormsg); } #endregion #region 实体赋值 EyouSoft.Model.PlanStructure.MPlanBaseInfo baseinfo = new EyouSoft.Model.PlanStructure.MPlanBaseInfo(); baseinfo.AddStatus = EyouSoft.Model.EnumType.PlanStructure.PlanAddStatus.计调安排时添加; baseinfo.CompanyId = this.SiteUserInfo.CompanyId; baseinfo.Confirmation = totalPrices; baseinfo.PlanCost = totalPrices; baseinfo.ContactFax = contectFax; baseinfo.ContactName = contectName; baseinfo.ContactPhone = contectPhone; baseinfo.CostDetail = costDetail; baseinfo.GuideNotes = guidNotes; baseinfo.IsRebate = Utils.GetFormValue(this.ddlprofit2.UniqueID) == "0" ? true : false; baseinfo.IssueTime = System.DateTime.Now; baseinfo.PaymentType = (EyouSoft.Model.EnumType.PlanStructure.Payment)Utils.GetInt(Utils.GetFormValue("SelPanyMentC")); baseinfo.PlanShip = new EyouSoft.Model.PlanStructure.MPlanShip(); baseinfo.PlanShip.Line = route; baseinfo.PlanShip.LoadDock = boardWhilfC; baseinfo.PlanShip.Sight = stopAttr; baseinfo.PlanShip.SubId = shipId; baseinfo.PlanShip.ShipName = shipname; decimal nums = 0; baseinfo.PlanShip.PlanShipPriceList = new List <EyouSoft.Model.PlanStructure.MPlanShipPrice>(); for (int i = 0; i < AircraftType.Length; i++) { EyouSoft.Model.PlanStructure.MPlanShipPrice prices = new EyouSoft.Model.PlanStructure.MPlanShipPrice(); prices.RoomType = (EyouSoft.Model.EnumType.PlanStructure.PlanShipRoomType)Enum.Parse(typeof(EyouSoft.Model.EnumType.PlanStructure.PlanShipRoomType), AircraftType[i]); prices.DNum = Utils.GetDecimal(adultNums[i]); prices.AdultNumber = Utils.GetInt(adultNums[i]); prices.AdultNumber = Convert.ToInt32(prices.DNum); prices.AdultPrice = Utils.GetDecimal(adultPrices[i]); //prices.ChildNumber = Utils.GetInt(childNums[i]); //prices.ChildPrice = Utils.GetDecimal(childPrices[i]); prices.SumPrice = Utils.GetDecimal(txtGuoNeiXiaoJi[i]); prices.BeiZhu = txtGuoNeiBeiZhu[i]; baseinfo.PlanShip.PlanShipPriceList.Add(prices); //nums += Utils.GetInt(adultNums[i]) + Utils.GetInt(childNums[i]); nums += Utils.GetDecimal(adultNums[i]); } baseinfo.PlanShip.PlanShipOwnCostList = new List <EyouSoft.Model.PlanStructure.MPlanShipOwnCost>(); //EyouSoft.Model.PlanStructure.MPlanShipOwnCost ownCostObj = new EyouSoft.Model.PlanStructure.MPlanShipOwnCost(); //ownCostObj.IsFloor = false; //ownCostObj.OwnItem = ownCost; //ownCostObj.PeopleNum = Utils.GetInt(ownPeopleNums); //ownCostObj.Price = ownUnitPrices; //baseinfo.PlanShip.PlanShipOwnCostList.Add(ownCostObj); baseinfo.Num = Convert.ToInt32(nums); baseinfo.DNum = nums; baseinfo.Remarks = otherRemrk; baseinfo.SourceId = shipIdC; baseinfo.SourceName = shipNameC; baseinfo.StartDate = boardDate; baseinfo.StartTime = boardtime; baseinfo.Status = (EyouSoft.Model.EnumType.PlanStructure.PlanState)Utils.GetInt(Utils.GetFormValue("SelStateC")); if (Utils.GetFormValue(this.SupplierControl2.ClientIsyukong) == "1") { baseinfo.SueId = Utils.GetFormValue(this.SupplierControl2.ClientzyykValue); } baseinfo.TourId = Utils.GetQueryStringValue("tourId"); baseinfo.Type = EyouSoft.Model.EnumType.PlanStructure.PlanProject.国内游轮; baseinfo.OperatorId = this.SiteUserInfo.UserId; baseinfo.OperatorName = this.SiteUserInfo.Name; #endregion #region 表单提交 if (Utils.GetQueryStringValue("action") == "saveC") { string planID = Utils.GetQueryStringValue("planId"); //修改 if (!string.IsNullOrEmpty(planID)) { baseinfo.PlanId = planID; baseinfo.PlanShip.PlanId = planID; if (new EyouSoft.BLL.PlanStructure.BPlan().UpdPlan(baseinfo) > 0) { msg += "修改成功!"; seterrormsg = UtilsCommons.AjaxReturnJson("1", "" + msg + ""); } else { msg += "修改失败!"; seterrormsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); } } else //添加 { if (new EyouSoft.BLL.PlanStructure.BPlan().AddPlan(baseinfo) > 0) { msg += "添加成功!"; seterrormsg = UtilsCommons.AjaxReturnJson("1", "" + msg + ""); } else { msg += "添加失败!"; seterrormsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); } } } #endregion return(seterrormsg); }
/// <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.GetFormValue("Status"); if (string.IsNullOrEmpty(strStatus)) { msg = EyouSoft.Common.UtilsCommons.AjaxReturnJson("0", "订单修改 失败!"); } else { EyouSoft.Model.EnumType.TourStructure.OrderStatus OrderStatus = (EyouSoft.Model.EnumType.TourStructure.OrderStatus) int.Parse(strStatus); EyouSoft.Model.PlanStructure.MPlanBaseInfo plan = null; if (OrderStatus == EyouSoft.Model.EnumType.TourStructure.OrderStatus.已成交) { plan = new EyouSoft.Model.PlanStructure.MPlanBaseInfo(); plan.CompanyId = SiteUserInfo.CompanyId; plan.TourId = Utils.GetFormValue("TourId"); plan.Type = EyouSoft.Model.EnumType.PlanStructure.PlanProject.地接; plan.SourceId = SiteUserInfo.SourceCompanyInfo.CompanyId; plan.SourceName = SiteUserInfo.SourceCompanyInfo.CompanyName; plan.ContactName = SiteUserInfo.Name; plan.ContactPhone = SiteUserInfo.Telephone; plan.ContactFax = SiteUserInfo.Fax; plan.Num = Utils.GetInt(Utils.GetFormValue("Adults")) + Utils.GetInt(Utils.GetFormValue("Childs")); plan.PlanCost = Utils.GetDecimal(Utils.GetFormValue(this.hfConfirmSettlementMoney.UniqueID)); plan.PaymentType = EyouSoft.Model.EnumType.PlanStructure.Payment.财务支付; plan.Status = EyouSoft.Model.EnumType.PlanStructure.PlanState.已落实; //已确认(存储过程已自动写入计划的审核人信息。) //plan.CostId = SiteUserInfo.UserId; //plan.CostName = SiteUserInfo.Username; plan.CostStatus = true; plan.CostTime = DateTime.Now; plan.Confirmation = Utils.GetDecimal(Utils.GetFormValue("ConfirmSettlementMoney")); plan.StartDate = Utils.GetDateTimeNullable(Utils.GetFormValue("LDate")); plan.EndDate = Utils.GetDateTimeNullable(Utils.GetFormValue("RDate")); //存储过程已自动写入计划的审核人信息。 //plan.DeptId = SiteUserInfo.DeptId; //plan.OperatorId = SiteUserInfo.UserId; //plan.OperatorName = SiteUserInfo.Username; plan.IssueTime = DateTime.Now; plan.AddStatus = EyouSoft.Model.EnumType.PlanStructure.PlanAddStatus.计调安排时添加; } string strSaveSeatDate = EyouSoft.Common.Utils.GetFormValue("SaveSeatDate"); DateTime?SaveSeatDate = !string.IsNullOrEmpty(strSaveSeatDate) ? (DateTime?)Utils.GetDateTime(strSaveSeatDate) : null; EyouSoft.BLL.TourStructure.BTourOrder bOrder = new EyouSoft.BLL.TourStructure.BTourOrder(); if (bOrder.UpdateTourOrderExpand(orderId, OrderStatus, SaveSeatDate, null, plan)) { msg = EyouSoft.Common.UtilsCommons.AjaxReturnJson("1", "订单已修改为 " + OrderStatus + "!"); } else { msg = EyouSoft.Common.UtilsCommons.AjaxReturnJson("0", "订单修改 失败!"); } } return(msg); }
/// <summary> /// 修改其他信息 /// </summary> /// <param name="model">信息实体</param> /// <returns>true:成功,false:失败</returns> public bool UpdateOther(EyouSoft.Model.PlanStructure.MPlanBaseInfo model) { return(dal.UpdateOther(model)); }
protected string PageSave(string name, string guideid) { string msg = string.Empty; string seterrorMsg = string.Empty; #region 表单赋值 //线路名称 string routename = Utils.GetFormValue(LineSelect1.LineNameClient); //导游姓名 string guidName = Utils.GetFormValue(this.GuidControl1.GuidNameClient); //电话 string tel = Utils.GetFormValue(this.txttel.UniqueID); //出团时间 string StartTime = Utils.GetFormValue(this.txtDate_Start.UniqueID); //接待行程 string treval = Utils.GetFormValue(this.txttravel.UniqueID); //返回时间 string endTime = Utils.GetFormValue(this.txtDate_End.UniqueID); //上团地点 string StartAddress = Utils.GetFormValue(this.txtStartAddress.UniqueID); //任务类型 string guidJobType = Utils.GetFormValue("seleJobType"); //下团地点 string EndAddress = Utils.GetFormValue(this.txtEndAddress.UniqueID); //费用明细 string CostDesc = Utils.GetFormValue(this.txtCostDesc.UniqueID); //备注 string remark = Utils.GetFormValue(this.txtrmark.UniqueID); //服务标准 string Service = Utils.GetFormValue(this.txtService.UniqueID); //结算费用 string PaidCost = Utils.GetFormValue(this.txtPaidCost.UniqueID); //团号 string TourCode = Utils.GetFormValue(this.txtTourCode.UniqueID); #endregion #region 后台验证 if (string.IsNullOrEmpty(guidName)) { msg += "请选择导游!<br/>"; } if (string.IsNullOrEmpty(StartAddress)) { msg += "请输入上团地点!<br/>"; } if (string.IsNullOrEmpty(StartTime.ToString())) { msg += "请选择上团时间!<br/>"; } if (string.IsNullOrEmpty(EndAddress)) { msg += "请输入下团地点!<br/>"; } if (string.IsNullOrEmpty(endTime.ToString())) { msg += "请选择下团时间!<br/>"; } if (string.IsNullOrEmpty(guidJobType)) { msg += "请选择导游任务类型!<br/>"; } if (Utils.GetDecimal(PaidCost) <= 0) { msg += "请填写结算费用!<br/>"; } if (!string.IsNullOrEmpty(msg)) { return(UtilsCommons.AjaxReturnJson("0", "" + msg + "")); } #endregion #region 实体赋值 EyouSoft.Model.PlanStructure.MPlanBaseInfo baseInfo = new EyouSoft.Model.PlanStructure.MPlanBaseInfo(); baseInfo.AddStatus = EyouSoft.Model.EnumType.PlanStructure.PlanAddStatus.计调安排时添加; baseInfo.CompanyId = this.SiteUserInfo.CompanyId; baseInfo.Confirmation = Utils.GetDecimal(PaidCost); baseInfo.ContactPhone = tel; baseInfo.CostDetail = CostDesc; baseInfo.IssueTime = System.DateTime.Now; TimeSpan ts1 = new TimeSpan(Utils.GetDateTime(endTime).Ticks); TimeSpan ts2 = new TimeSpan(Utils.GetDateTime(StartTime).Ticks); baseInfo.Num = ts1.Subtract(ts2).Duration().Days; baseInfo.PlanGuide = new EyouSoft.Model.PlanStructure.MPlanGuide(); baseInfo.PlanGuide.NextLocation = EndAddress; baseInfo.PlanGuide.OnLocation = StartAddress; baseInfo.PlanGuide.TaskType = (EyouSoft.Model.EnumType.PlanStructure.PlanGuideTaskType)Enum.Parse(typeof(EyouSoft.Model.EnumType.PlanStructure.PlanGuideTaskType), guidJobType); baseInfo.SourceId = guideid; baseInfo.SourceName = guidName; baseInfo.TourId = Utils.GetFormValue("hidTourID"); baseInfo.ReceiveJourney = treval; baseInfo.Remarks = remark; baseInfo.ServiceStandard = Service; baseInfo.StartDate = Utils.GetDateTimeNullable(StartTime); baseInfo.EndDate = Utils.GetDateTimeNullable(endTime); baseInfo.Type = EyouSoft.Model.EnumType.PlanStructure.PlanProject.导游; baseInfo.OperatorId = this.SiteUserInfo.UserId; baseInfo.OperatorName = this.SiteUserInfo.Name; baseInfo.DeptId = this.SiteUserInfo.DeptId; baseInfo.Status = (EyouSoft.Model.EnumType.PlanStructure.PlanState)Utils.GetInt(Utils.GetFormValue(this.ddlState.UniqueID)); #endregion #region 提交操作 if (new EyouSoft.BLL.PlanStructure.BPlan().AddPlan(baseInfo) > 0) { msg += "保存成功!"; seterrorMsg = UtilsCommons.AjaxReturnJson("1", "" + msg + ""); } else { msg += "保存失败!"; seterrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); } #endregion return(seterrorMsg); }
/// <summary> /// 保存领料计调项 /// </summary> /// <returns></returns> protected string PageSave() { #region 表单取值 string msg = string.Empty; string setErrorMsg = string.Empty; //领料id name string pickid = Utils.GetFormValue(this.SelectObject1.SelectIDClient); string pickName = Utils.GetFormValue(this.SelectObject1.SelectNameClient); //数量 int pickNums = Utils.GetInt(Utils.GetFormValue(this.txtNums.UniqueID)); //单价 结算费用 decimal prices = Utils.GetDecimal(Utils.GetFormValue(this.txtUnitPrices.UniqueID)); decimal totalPrices = Utils.GetDecimal(Utils.GetFormValue(this.txtTotalPrices.UniqueID)); //领料人 string pickNames = Utils.GetFormValue(this.hrSelect.HrSelectNameClient); string pickIds = Utils.GetFormValue(this.hrSelect.HrSelectIDClient); //导游需知 其它备注 string guidNotes = Utils.GetFormValue(this.txtGuidNotes.UniqueID); string otherMarks = Utils.GetFormValue(this.txtOtherRemarks.UniqueID); #endregion #region 后台验证 if (string.IsNullOrEmpty(pickid) && string.IsNullOrEmpty(pickName)) { msg += "请选择领料内容!<br/>"; } if (pickNums <= 0) { msg += "请输入领料数量!<br/>"; } if (prices <= 0) { msg += "请输入单价!<br/>"; } if (totalPrices <= 0) { msg += "请输入结算费用!<br/>"; } if (string.IsNullOrEmpty(Utils.GetFormValue("selStatus"))) { msg += "请选择状态!<br/>"; } if (!string.IsNullOrEmpty(msg)) { setErrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); return(setErrorMsg); } #endregion #region 实体赋值 EyouSoft.Model.PlanStructure.MPlanBaseInfo baseinfo = new EyouSoft.Model.PlanStructure.MPlanBaseInfo(); baseinfo.AddStatus = EyouSoft.Model.EnumType.PlanStructure.PlanAddStatus.计调安排时添加; baseinfo.CompanyId = this.SiteUserInfo.CompanyId; baseinfo.Confirmation = totalPrices; baseinfo.PlanCost = totalPrices; baseinfo.PlanGood = new EyouSoft.Model.GovStructure.MGovGoodUse(); baseinfo.PlanGood.GoodId = pickid; baseinfo.PlanGood.GoodName = pickName; baseinfo.PlanGood.UserId = pickIds; baseinfo.PlanGood.Price = prices; baseinfo.Remarks = otherMarks; baseinfo.GuideNotes = guidNotes; baseinfo.SourceId = pickid; baseinfo.SourceName = pickName; baseinfo.Status = (EyouSoft.Model.EnumType.PlanStructure.PlanState)Utils.GetInt(Utils.GetFormValue("selStatus")); baseinfo.TourId = Utils.GetQueryStringValue("tourId"); baseinfo.Type = EyouSoft.Model.EnumType.PlanStructure.PlanProject.领料; baseinfo.ContactName = pickNames; baseinfo.DeptId = this.SiteUserInfo.DeptId; baseinfo.OperatorId = this.SiteUserInfo.UserId; baseinfo.OperatorName = this.SiteUserInfo.Name; baseinfo.Num = pickNums; baseinfo.IssueTime = System.DateTime.Now; baseinfo.PaymentType = (EyouSoft.Model.EnumType.PlanStructure.Payment)Utils.GetInt(Utils.GetFormValue("selPanyMent")); #endregion #region 提交操作 string planID = Utils.GetQueryStringValue("planId"); int result = 0; if (!string.IsNullOrEmpty(planID)) { baseinfo.PlanGood.PlanId = planID; baseinfo.PlanId = planID; result = new EyouSoft.BLL.PlanStructure.BPlan().UpdPlan(baseinfo); if (result == 1) { msg += "修改成功!"; setErrorMsg = UtilsCommons.AjaxReturnJson("1", "" + msg + ""); } else if (result == 0) { msg += "修改失败!"; setErrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); } else if (result == -1) { msg += "领料不足,修改失败!"; setErrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); } } else { result = new EyouSoft.BLL.PlanStructure.BPlan().AddPlan(baseinfo); if (result == 1) { msg += "添加成功!"; setErrorMsg = UtilsCommons.AjaxReturnJson("1", "" + msg + ""); } else if (result == 0) { msg += "添加失败!"; setErrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); } else if (result == -1) { msg += "领料不足,添加失败!"; setErrorMsg = UtilsCommons.AjaxReturnJson("0", "" + msg + ""); } } #endregion return(setErrorMsg); }
/* #region 修改订单合同号 * /// <summary> * /// 修改订单合同号 * /// </summary> * /// <param name="orderId">订单编号</param> * /// <param name="contractCode">合同号</param> * /// <param name="contractCodeId">合同号编号</param> * /// <returns>0:失败 1:成功</returns> * public int UpdateTourOrderContaract(string orderId, string contractCode, string contractCodeId) * { * if (string.IsNullOrEmpty(orderId)) return 0; * * bool dalRetCode = dal.UpdateTourOrderContaract(orderId, contractCode, contractCodeId); * if (dalRetCode) * { * //添加操作日志 * StringBuilder str = new StringBuilder(); * str.AppendFormat("修改订单的合同号为:{0},订单编号:{1}", contractCode, orderId); * EyouSoft.BLL.SysStructure.BSysLogHandle.Insert(str.ToString()); * } * * return dalRetCode?1:0; * } #endregion*/ #region 修改订单状态(用于供应商处理订单) /// <summary> /// 修改订单状态 /// </summary> /// <param name="orderId">订单编号</param> /// <param name="orderStatus">订单状态</param> /// <param name="saveSeatDate">继续留位时间</param> /// <param name="change">订单变更的实体</param> /// <param name="plan">计调信息</param> /// <returns>0:失败 1:成功</returns> public bool UpdateTourOrderExpand(string orderId, OrderStatus orderStatus, DateTime?saveSeatDate, MTourOrderChange change, EyouSoft.Model.PlanStructure.MPlanBaseInfo plan) { if (string.IsNullOrEmpty(orderId)) { throw new System.Exception("bll error:查询id为null或string.IsNullOrEmpty(id)==true。"); } if (!CheckTourOrderChange(change)) { throw new System.Exception("bll error:查询id为null或string.IsNullOrEmpty(id)==true。"); } if (orderStatus == OrderStatus.已留位) { if (!saveSeatDate.HasValue) { throw new System.Exception("bll error:留位时间不能为空!"); } } if (orderStatus == OrderStatus.已成交) { if (plan == null || string.IsNullOrEmpty(plan.CompanyId) || string.IsNullOrEmpty(plan.TourId) || string.IsNullOrEmpty(plan.SourceName)) { throw new System.Exception("bll error:查询id为null或string.IsNullOrEmpty(id)==true。"); } } int flg = dal.UpdateTourOrderExpand(orderId, orderStatus, saveSeatDate, change, plan); if (flg == 1) { //添加操作日志 StringBuilder str = new StringBuilder(); str.AppendFormat("供应商修改订单的状态为:{0},订单编号:{1}", orderStatus, orderId); EyouSoft.BLL.SysStructure.BSysLogHandle.Insert(str.ToString()); if (plan != null) { SysStructure.BSysLogHandle.Insert(string.Format("新增计调编号:{0}、计调类型:{1}的计调项目。", plan.PlanId, plan.Type)); } return(true); } return(false); }