/// <summary> /// 获的公司已经设置过的价格等级 /// </summary> private void BindPriceList() { EyouSoft.IBLL.CompanyStructure.ICompanyPriceStand bll = EyouSoft.BLL.CompanyStructure.CompanyPriceStand.CreateInstance(); IList <EyouSoft.Model.CompanyStructure.CompanyPriceStand> list = bll.GetList(CompanyId); if (list != null && list.Count > 0) { foreach (EyouSoft.Model.CompanyStructure.CompanyPriceStand model in list) { MyPriceStand += model.CommonPriceStandID + ","; } MyPriceStand = MyPriceStand.Substring(0, MyPriceStand.Length - 1); } list = null; bll = null; }
/// <summary> /// 设置价格等级 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected string btnSave() { string strSelect = string.Empty; string PriceId = Request.QueryString["IdList"]; string PriceName = Request.QueryString["priceNameList"]; if (PriceId.Length == 0) { MessageBox.Show(this, "请选择价格等级!"); } else { IList <EyouSoft.Model.CompanyStructure.CommonPriceStand> commonPriceStands = new List <EyouSoft.Model.CompanyStructure.CommonPriceStand>(); for (int i = 0; i < PriceId.Split(',').Length; i++) { EyouSoft.Model.CompanyStructure.CommonPriceStand model = new EyouSoft.Model.CompanyStructure.CommonPriceStand(); model.ID = PriceId.Split(',')[i]; model.PriceStandName = PriceName.Split(',')[i]; model.TypeID = EyouSoft.Model.CompanyStructure.CommPriceTypeID.None; commonPriceStands.Add(model); model = null; } EyouSoft.IBLL.CompanyStructure.ICompanyPriceStand bll = EyouSoft.BLL.CompanyStructure.CompanyPriceStand.CreateInstance(); bool Result = bll.SetCompanyPriceStand(CompanyId, commonPriceStands); if (Result) { strSelect = "<select name=\"drpPriceRank\" onchange=\"TourPriceStand.isSamePrice(this);\">"; string strOption = ""; IList <EyouSoft.Model.CompanyStructure.CompanyPriceStand> list = bll.GetList(CompanyId); if (list != null) { foreach (EyouSoft.Model.CompanyStructure.CompanyPriceStand Pricemodel in list) { strOption += string.Format("<option value=\"{0}\">{1}</option>", Pricemodel.ID, Pricemodel.PriceStandName); } } strSelect += strOption + "</select>"; list = null; } bll = null; } return(strSelect); }
/// <summary> /// 初始化团队价格列表 /// </summary> private string InitTourPriceDetail() { StringBuilder str = new StringBuilder(); if (TourPriceDetails != null && TourPriceDetails.Count > 0) { foreach (EyouSoft.Model.TourStructure.TourPriceDetail priceModel in TourPriceDetails) { str.Append("<tr>"); str.Append("<td align=\"right\" valign=\"bottom\" style=\"border: 1px solid #93B5D7;\">"); EyouSoft.IBLL.CompanyStructure.ICompanyPriceStand bll = EyouSoft.BLL.CompanyStructure.CompanyPriceStand.CreateInstance(); IList <EyouSoft.Model.CompanyStructure.CompanyPriceStand> priceStandList = bll.GetList(CompanyId); str.Append("<select name=\"drpPriceRank\" onchange=\"TourPriceStand.isSamePrice(this,'" + ContainerID + "');\">"); if (priceStandList != null && priceStandList.Count > 0) { foreach (EyouSoft.Model.CompanyStructure.CompanyPriceStand priceStandModel in priceStandList) { if (priceStandModel.ID == priceModel.PriceStandId) { str.AppendFormat("<option value=\"{0}\" selected>{1}</option>", priceStandModel.ID, priceStandModel.PriceStandName); } else { str.AppendFormat("<option value=\"{0}\">{1}</option>", priceStandModel.ID, priceStandModel.PriceStandName); } } } else { str.Append("<option value=\"\">请选择</option>"); } str.Append("</select></td>"); priceStandList = null; IList <EyouSoft.Model.TourStructure.TourPriceCustomerLeaveDetail> detailList = priceModel.PriceDetail; if (detailList != null && detailList.Count > 0) { ArrayList arrCustomerLevelID = new ArrayList(); StringBuilder strDF = new StringBuilder(); foreach (EyouSoft.Model.TourStructure.TourPriceCustomerLeaveDetail detailModel in detailList) { arrCustomerLevelID.Add(detailModel.CustomerLevelId); if (detailModel.CustomerLevelType == EyouSoft.Model.CompanyStructure.CustomerLevelType.门市 || detailModel.CustomerLevelType == EyouSoft.Model.CompanyStructure.CustomerLevelType.行) { str.AppendFormat("<TD align=\"center\" style=\"border:1px solid #93B5D7;\" class=\"adultorchildren\"><nobr><input name=\"PeoplePrice{0}\" size=\"7\" class=\"bitiansm\" type=\"text\" id=\"PeoplePrice{0}\" value=\"{1}\">", detailModel.CustomerLevelId, detailModel.AdultPrice > 0 ? detailModel.AdultPrice.ToString("F0") : "0"); str.AppendFormat(" <input name=\"ChildPrice{0}\" size=\"7\" class=\"shurukuang\" type=\"text\" id=\"ChildPrice{0}\" value=\"{1}\"></nobr></TD>", detailModel.CustomerLevelId, detailModel.ChildrenPrice > 0 ? detailModel.ChildrenPrice.ToString("F0") : "0"); } else if (detailModel.CustomerLevelType == EyouSoft.Model.CompanyStructure.CustomerLevelType.单房差) { strDF.AppendFormat("<TD align=\"center\" style=\"border:1px solid #93B5D7;\" class=\"room\"><nobr><input name=\"PeoplePrice{0}\" size=\"7\" class=\"shurukuang\" type=\"text\" id=\"PeoplePrice{0}\" value=\"{1}\">", detailModel.CustomerLevelId, detailModel.AdultPrice > 0 ? detailModel.AdultPrice.ToString("F0") : "0"); strDF.AppendFormat(" <input name=\"ChildPrice{0}\" size=\"7\" class=\"shurukuang\" type=\"text\" id=\"ChildPrice{0}\" value=\"{1}\"></nobr></TD>", detailModel.CustomerLevelId, detailModel.ChildrenPrice > 0 ? detailModel.ChildrenPrice.ToString("F0") : "0"); } else { if (arrLevelId.Contains(detailModel.CustomerLevelId)) { str.AppendFormat("<TD align=\"center\" style=\"border:1px solid #93B5D7;\" class=\"adultorchildren\"><nobr><input name=\"PeoplePrice{0}\" size=\"7\" class=\"shurukuang\" type=\"text\" id=\"PeoplePrice{0}\" value=\"{1}\">", detailModel.CustomerLevelId, detailModel.AdultPrice > 0 ? detailModel.AdultPrice.ToString("F0") : "0"); str.AppendFormat(" <input name=\"ChildPrice{0}\" size=\"7\" class=\"shurukuang\" type=\"text\" id=\"ChildPrice{0}\" value=\"{1}\"></nobr></TD>", detailModel.CustomerLevelId, detailModel.ChildrenPrice > 0 ? detailModel.ChildrenPrice.ToString("F0") : "0"); } } } StringBuilder strTMP = new StringBuilder(); if (arrLevelId.Count > 0) { for (int a = 0; a < arrLevelId.Count; a++) { if (!arrCustomerLevelID.Contains(arrLevelId[a])) { strTMP.AppendFormat("<TD align=\"center\" style=\"border:1px solid #93B5D7;\" class=\"adultorchildren\"><nobr><input name=\"PeoplePrice{0}\" size=\"7\" class=\"shurukuang\" type=\"text\" id=\"PeoplePrice{0}\" value=\"成人价\">", arrLevelId[a]); strTMP.AppendFormat(" <input name=\"ChildPrice{0}\" size=\"7\" class=\"shurukuang\" type=\"text\" id=\"ChildPrice{0}\" value=\"儿童价\"></nobr></TD>", arrLevelId[a]); } } str.Append(strTMP); } str.Append(strDF); } detailList = null; str.Append("<td style=\"border: 1px solid #93B5D7;\"><a onclick=\"TourPriceStand.addthis(this,null,'" + ContainerID + "');return false;\" href=\"javascript:void(0);\">增加一行</a> <a onclick=\"TourPriceStand.delthis(this);return false;\" href=\"javascript:void(0);\">删除</a></td>"); } } else { str.Append("<tr>"); str.Append("<td align=\"right\" valign=\"bottom\" style=\"border: 1px solid #93B5D7;\">"); EyouSoft.IBLL.CompanyStructure.ICompanyPriceStand bll = EyouSoft.BLL.CompanyStructure.CompanyPriceStand.CreateInstance(); IList <EyouSoft.Model.CompanyStructure.CompanyPriceStand> priceStandList = bll.GetList(CompanyId); str.Append("<select name=\"drpPriceRank\" onchange=\"TourPriceStand.isSamePrice(this,'" + ContainerID + "');\" valid=\"required\" errmsg=\"请选择报价等级\">"); if (priceStandList != null && priceStandList.Count > 0) { foreach (EyouSoft.Model.CompanyStructure.CompanyPriceStand priceStandModel in priceStandList) { str.AppendFormat("<option value=\"{0}\">{1}</option>", priceStandModel.ID, priceStandModel.PriceStandName); } } else { str.Append("<option value=\"\">请选择</option>"); } str.Append("</select></td>"); priceStandList = null; bll = null; foreach (EyouSoft.Model.SystemStructure.SysFieldBase customerLevelModel in CustomerLevelList) { if (customerLevelModel.FieldId == 0 || customerLevelModel.FieldId == 1) { str.AppendFormat("<TD align=\"center\" style=\"border:1px solid #93B5D7;\" class=\"adultorchildren\"><nobr><input name=\"PeoplePrice{0}\" size=\"7\" class=\"bitiansm\" type=\"text\" id=\"PeoplePrice{0}\" value=\"成人价\">", customerLevelModel.FieldId); str.AppendFormat(" <input name=\"ChildPrice{0}\" size=\"7\" class=\"shurukuang\" type=\"text\" id=\"ChildPrice{0}\" value=\"儿童价\"></nobr></TD>", customerLevelModel.FieldId); } else if (customerLevelModel.FieldId == 2) { str.AppendFormat("<TD align=\"center\" style=\"border:1px solid #93B5D7;\" class=\"room\"><nobr><input name=\"PeoplePrice{0}\" size=\"7\" class=\"shurukuang\" type=\"text\" id=\"PeoplePrice{0}\" value=\"结算价\">", customerLevelModel.FieldId); str.AppendFormat(" <input name=\"ChildPrice{0}\" size=\"7\" class=\"shurukuang\" type=\"text\" id=\"ChildPrice{0}\" value=\"门市价\"></nobr></TD>", customerLevelModel.FieldId); } else { str.AppendFormat("<TD align=\"center\" style=\"border:1px solid #93B5D7;\" class=\"adultorchildren\"><nobr><input name=\"PeoplePrice{0}\" size=\"7\" class=\"shurukuang\" type=\"text\" id=\"PeoplePrice{0}\" value=\"成人价\">", customerLevelModel.FieldId); str.AppendFormat(" <input name=\"ChildPrice{0}\" size=\"7\" class=\"shurukuang\" type=\"text\" id=\"ChildPrice{0}\" value=\"儿童价\"></nobr></TD>", customerLevelModel.FieldId); } } str.Append("<td style=\"border: 1px solid #93B5D7;\"><a onclick=\"TourPriceStand.addthis(this,null,'" + ContainerID + "');return false;\" href=\"javascript:void(0);\">增加一行</a> <a onclick=\"TourPriceStand.delthis(this);return false;\" href=\"javascript:void(0);\">删除</a></td>"); } TourPriceDetails = null; return(str.ToString()); }