Beispiel #1
0
        protected EyouSoft.Model.TourStructure.LineInquireQuoteInfo InitInfo(int id)
        {
            //记录我社报价价格
            decimal price = 0;

            //询价实体类
            EyouSoft.Model.TourStructure.LineInquireQuoteInfo lineInfo = new EyouSoft.Model.TourStructure.LineInquireQuoteInfo();
            lineQuoteBll = new EyouSoft.BLL.TourStructure.LineInquireQuoteInfo(SiteUserInfo);
            lineInfo     = lineQuoteBll.GetQuoteModel(id, SiteUserInfo.CompanyID, 0, false);
            if (lineInfo != null)
            {
                //为类赋值
                //折扣
                this.txt_agio.Value = Utils.FilterEndOfTheZeroString(EyouSoft.Common.Utils.GetDecimal(lineInfo.TicketAgio.ToString()).ToString("0.00"));
                //出团日期
                this.txt_BegTime.Value = ((DateTime)(lineInfo.LeaveDate)).ToString("yyyy-MM-dd");
                //联系人姓名
                this.txt_contactName.Value = Utils.GetString(lineInfo.ContactName, "");
                //联系人电话
                this.txt_contactTel.Value = Utils.GetString(lineInfo.ContactTel, "");
                //总人数
                this.txt_peopleCount.Value = Utils.GetString(Convert.ToString(lineInfo.PeopleNum), "");
                //询价单位名称
                this.txt_quoteCompany.Value = Utils.GetString(lineInfo.CustomerName, "");
                //询价单位编号
                this.hid_QuoteCompanyId.Value = Convert.ToString(lineInfo.CustomerId);
                //客户要求用户控件赋值
                this.ConProjectControl1.SetList = lineInfo.Requirements;
                ConProjectControl1.SetDataList();
                //价格组成用户控件赋值
                this.PriceControl1.SetList     = lineInfo.Services;
                this.PriceControl1.TotalAmount = lineInfo.TotalAmount;
                //行程要求
                if (lineInfo.XingCheng != null)
                {
                    this.txtRoutingNeed.Text = Utils.GetString(lineInfo.XingCheng.QuotePlan, "");
                    file = Utils.GetString(lineInfo.XingCheng.PlanAccessory, "");
                    this.hid_img_name.Value = Utils.GetString(lineInfo.XingCheng.PlanAccessoryName, "");
                    this.hid_img_path.Value = Utils.GetString(lineInfo.XingCheng.PlanAccessory, "");
                }
                //状态
                this.lblResult.Text = Convert.ToString(lineInfo.QuoteState);
                //特殊需求
                this.txt_need.Value = Utils.GetString(lineInfo.SpecialClaim, "");
                //线路用户控件赋值
                this.xianluWindow1.Name        = lineInfo.RouteName;
                this.xianluWindow1.Id          = Convert.ToString(lineInfo.RouteId);
                this.xianluWindow1.publishType = 1;
                //备注
                this.txt_remark.Value = lineInfo.Remark;

                #region 订单游客数据
                EyouSoft.BLL.TourStructure.TourOrder TourOrderBll = new EyouSoft.BLL.TourStructure.TourOrder(SiteUserInfo);
                System.Collections.Generic.IList <EyouSoft.Model.TourStructure.TourOrderCustomer> curList = lineInfo.Traveller.Travellers;
                System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
                if (curList != null && curList.Count > 0)
                {
                    for (int i = 0; i < curList.Count; i++)
                    {
                        if (curList[i].VisitorType == EyouSoft.Model.EnumType.TourStructure.VisitorType.成人)
                        {
                            stringBuilder.AppendFormat("<tr itemtype=\"{0}\">", "adult");
                        }
                        else if (curList[i].VisitorType == EyouSoft.Model.EnumType.TourStructure.VisitorType.儿童)
                        {
                            stringBuilder.AppendFormat("<tr itemtype=\"{0}\">", "child");
                        }
                        else
                        {
                            stringBuilder.AppendFormat("<tr itemtype=\"{0}\">", "other");
                        }
                        stringBuilder.AppendFormat("<td style=\"width: 5%\" bgcolor=\"#e3f1fc\" index=\"{0}\" align=\"center\">{0}</td><td height=\"25\" bgcolor=\"#e3f1fc\" align=\"center\">", i + 1);
                        stringBuilder.AppendFormat("<input type=\"text\" class=\"searchinput\" id=\"cusName\" MaxLength=\"50\" valid=\"required\" errmsg=\"请填写姓名!\" name=\"cusName\" value=\"{0}\" /></td>", curList[i].VisitorName);
                        stringBuilder.Append("<td bgcolor=\"#e3f1fc\" align=\"center\">");

                        #region 游客类型
                        if (curList[i].VisitorType == EyouSoft.Model.EnumType.TourStructure.VisitorType.成人)
                        {
                            stringBuilder.Append("<select disabled=\"disabled\" title=\"请选择\" id=\"cusType\" name=\"cusType\">");
                            stringBuilder.Append("<option value=\"\">请选择</option>");
                            stringBuilder.Append("<option value=\"1\" selected=\"selected\">成人</option>");
                            stringBuilder.Append("<option value=\"2\">儿童</option>");
                            stringBuilder.Append(" </select>");
                        }
                        //儿童
                        else if (curList[i].VisitorType == EyouSoft.Model.EnumType.TourStructure.VisitorType.儿童)
                        {
                            stringBuilder.Append("<select disabled=\"disabled\" title=\"请选择\"  id=\"cusType\" name=\"cusType\">");
                            stringBuilder.Append("<option value=\"\">请选择</option>");
                            stringBuilder.Append("<option value=\"1\" >成人</option>");
                            stringBuilder.Append("<option value=\"2\" selected=\"selected\">儿童</option>");
                            stringBuilder.Append(" </select>");
                        }
                        //其它
                        else
                        {
                            stringBuilder.Append("<select id=\"cusType\" title=\"请选择\"  name=\"cusType\">");
                            stringBuilder.Append("<option value=\"\"  selected=\"selected\">请选择</option>");
                            stringBuilder.Append("<option value=\"1\" >成人</option>");
                            stringBuilder.Append("<option value=\"2\">儿童</option>");
                            stringBuilder.Append(" </select>");
                        }
                        #endregion

                        stringBuilder.Append("</td>");
                        stringBuilder.Append("<td bgcolor=\"#e3f1fc\" align=\"center\">");

                        #region 游客证件类型
                        switch (curList[i].CradType)
                        {
                        case EyouSoft.Model.EnumType.TourStructure.CradType.身份证:
                        {
                            stringBuilder.Append("<select id=\"cusCardType\" name=\"cusCardType\">");
                            stringBuilder.Append("<option value=\"0\">请选择证件</option>");
                            stringBuilder.Append("<option value=\"1\" selected=\"selected\">身份证</option>");
                            stringBuilder.Append("<option value=\"2\">护照</option>");
                            stringBuilder.Append("<option value=\"3\">军官证</option>");
                            stringBuilder.Append("<option value=\"4\">台胞证</option>");
                            stringBuilder.Append("<option value=\"5\">港澳通行证</option>");
                            stringBuilder.Append("<option value=\"6\">户口本</option>");
                            stringBuilder.Append("</select>");
                            break;
                        }

                        case EyouSoft.Model.EnumType.TourStructure.CradType.护照:
                        {
                            stringBuilder.Append("<select id=\"cusCardType\" name=\"cusCardType\">");
                            stringBuilder.Append("<option value=\"0\">请选择证件</option>");
                            stringBuilder.Append("<option value=\"1\">身份证</option>");
                            stringBuilder.Append("<option value=\"2\" selected=\"selected\">护照</option>");
                            stringBuilder.Append("<option value=\"3\">军官证</option>");
                            stringBuilder.Append("<option value=\"4\">台胞证</option>");
                            stringBuilder.Append("<option value=\"5\">港澳通行证</option>");
                            stringBuilder.Append("<option value=\"6\">户口本</option>");
                            stringBuilder.Append("</select>");
                            break;
                        }

                        case EyouSoft.Model.EnumType.TourStructure.CradType.军官证:
                        {
                            stringBuilder.Append("<select id=\"cusCardType\" name=\"cusCardType\">");
                            stringBuilder.Append("<option value=\"0\">请选择证件</option>");
                            stringBuilder.Append("<option value=\"1\">身份证</option>");
                            stringBuilder.Append("<option value=\"2\">护照</option>");
                            stringBuilder.Append("<option value=\"3\" selected=\"selected\">军官证</option>");
                            stringBuilder.Append("<option value=\"4\">台胞证</option>");
                            stringBuilder.Append("<option value=\"5\">港澳通行证</option>");
                            stringBuilder.Append("<option value=\"6\">户口本</option>");
                            stringBuilder.Append("</select>");
                            break;
                        }

                        case EyouSoft.Model.EnumType.TourStructure.CradType.台胞证:
                        {
                            stringBuilder.Append("<select id=\"cusCardType\" name=\"cusCardType\">");
                            stringBuilder.Append("<option value=\"0\">请选择证件</option>");
                            stringBuilder.Append("<option value=\"1\">身份证</option>");
                            stringBuilder.Append("<option value=\"2\">护照</option>");
                            stringBuilder.Append("<option value=\"3\">军官证</option>");
                            stringBuilder.Append("<option value=\"4\" selected=\"selected\">台胞证</option>");
                            stringBuilder.Append("<option value=\"5\">港澳通行证</option>");
                            stringBuilder.Append("<option value=\"6\">户口本</option>");
                            stringBuilder.Append("</select>");
                            break;
                        }

                        case EyouSoft.Model.EnumType.TourStructure.CradType.港澳通行证:
                        {
                            stringBuilder.Append("<select id=\"cusCardType\" name=\"cusCardType\">");
                            stringBuilder.Append("<option value=\"0\">请选择证件</option>");
                            stringBuilder.Append("<option value=\"1\">身份证</option>");
                            stringBuilder.Append("<option value=\"2\">护照</option>");
                            stringBuilder.Append("<option value=\"3\">军官证</option>");
                            stringBuilder.Append("<option value=\"4\">台胞证</option>");
                            stringBuilder.Append("<option value=\"5\" selected=\"selected\">港澳通行证</option>");
                            stringBuilder.Append("<option value=\"6\">户口本</option>");
                            stringBuilder.Append("</select>");
                            break;
                        }

                        case EyouSoft.Model.EnumType.TourStructure.CradType.户口本:
                        {
                            stringBuilder.Append("<select id=\"cusCardType\" name=\"cusCardType\">");
                            stringBuilder.Append("<option value=\"0\">请选择证件</option>");
                            stringBuilder.Append("<option value=\"1\">身份证</option>");
                            stringBuilder.Append("<option value=\"2\">护照</option>");
                            stringBuilder.Append("<option value=\"3\">军官证</option>");
                            stringBuilder.Append("<option value=\"4\">台胞证</option>");
                            stringBuilder.Append("<option value=\"5\" >港澳通行证</option>");
                            stringBuilder.Append("<option value=\"6\" selected=\"selected\">户口本</option>");
                            stringBuilder.Append("</select>");
                            break;
                        }

                        default:
                        {
                            stringBuilder.Append("<select id=\"cusCardType\" name=\"cusCardType\">");
                            stringBuilder.Append("<option value=\"0\" selected=\"selected\">请选择证件</option>");
                            stringBuilder.Append("<option value=\"1\" >身份证</option>");
                            stringBuilder.Append("<option value=\"2\">护照</option>");
                            stringBuilder.Append("<option value=\"3\">军官证</option>");
                            stringBuilder.Append("<option value=\"4\">台胞证</option>");
                            stringBuilder.Append("<option value=\"5\">港澳通行证</option>");
                            stringBuilder.Append("</select>");
                            break;
                        }
                        }
                        #endregion

                        stringBuilder.Append("</td>");
                        stringBuilder.Append("<td bgcolor=\"#e3f1fc\" align=\"center\">");
                        stringBuilder.AppendFormat("<input type=\"text\" class=\"searchinput searchinput02\" id=\"cusCardNo\" MaxLength=\"150\" onblur='getSex(this)' name=\"cusCardNo\" value=\"{0}\">", curList[i].CradNumber);
                        stringBuilder.Append("</td>");
                        stringBuilder.Append("<td bgcolor=\"#e3f1fc\" align=\"center\">");

                        #region 游客性别
                        switch (curList[i].Sex)
                        {
                        case EyouSoft.Model.EnumType.CompanyStructure.Sex.男:
                        {
                            stringBuilder.Append("<select class='ddlSex' id=\"cusSex\" name=\"cusSex\">");
                            stringBuilder.Append("<option value=\"0\">请选择</option>");
                            stringBuilder.Append("<option value=\"1\" selected=\"selected\">男</option>");
                            stringBuilder.Append("<option value=\"2\">女</option>");
                            stringBuilder.Append("</select>");
                            break;
                        }

                        case EyouSoft.Model.EnumType.CompanyStructure.Sex.女:
                        {
                            stringBuilder.Append("<select class='ddlSex' id=\"cusSex\" name=\"cusSex\">");
                            stringBuilder.Append("<option value=\"0\">请选择</option>");
                            stringBuilder.Append("<option value=\"1\">男</option>");
                            stringBuilder.Append("<option value=\"2\" selected=\"selected\">女</option>");
                            stringBuilder.Append("</select>");
                            break;
                        }

                        default:
                        {
                            stringBuilder.Append("<select class='ddlSex' id=\"cusSex\" name=\"cusSex\">");
                            stringBuilder.Append("<option value=\"0\" selected=\"selected\">请选择</option>");
                            stringBuilder.Append("<option value=\"1\">男</option>");
                            stringBuilder.Append("<option value=\"2\">女</option>");
                            break;
                        }
                        }

                        #endregion

                        stringBuilder.Append("</td>");
                        stringBuilder.Append("<td bgcolor=\"#e3f1fc\" align=\"center\">");
                        stringBuilder.AppendFormat("<input type=\"text\" class=\"searchinput\" id=\"cusPhone\" MaxLength=\"50\" name=\"cusPhone\" value=\"{0}\">", curList[i].ContactTel);
                        stringBuilder.Append("</td>");
                        stringBuilder.Append("<td bgcolor=\"#e3f1fc\" align=\"center\"  width=\"6%\">");
                        if (curList[i].SpecialServiceInfo != null)
                        {
                            string str = string.Format("txtItem={0}&txtServiceContent={1}&txtCost={2}&ddlOperate={3}", curList[i].SpecialServiceInfo.ProjectName, curList[i].SpecialServiceInfo.ServiceDetail, curList[i].SpecialServiceInfo.Fee, (curList[i].SpecialServiceInfo.IsAdd ? "0" : "1"));
                            stringBuilder.AppendFormat("<input id=\"spe{0}\" type=\"hidden\" name=\"specive\" value=\"{1}\" />", curList[i].ID, str);
                        }
                        else
                        {
                            string special = "";
                            if (curList[i].SpecialServiceInfo != null)
                            {
                                string isadd = curList[i].SpecialServiceInfo.IsAdd ? "0" : "1";
                                special = "txtItem=" + curList[i].SpecialServiceInfo.ProjectName + "&txtServiceContent=" + curList[i].SpecialServiceInfo.ServiceDetail + "&ddlOperate=" + isadd + "&txtCost=" + Utils.FilterEndOfTheZeroDecimal(curList[i].SpecialServiceInfo.Fee);
                            }
                            stringBuilder.AppendFormat("<input id=\"spe{0}\" type=\"hidden\" name=\"specive\" value=\"{1}\" />", curList[i].ID, special);
                        }
                        stringBuilder.AppendFormat("<a sign=\"speService\" href=\"javascript:void(0)\" onclick=\"OrderEdit.OpenSpecive('spe{0}')\">特服</a></td>", curList[i].ID);
                        stringBuilder.Append("<td bgcolor=\"#e3f1fc\" align=\"center\" width=\"15%\">");
                        stringBuilder.AppendFormat("<input type=\"hidden\" name=\"cusID\" value=\"{0}\" />", curList[i].ID);
                        stringBuilder.Append("<a sign=\"add\" href=\"javascript:void(0)\" onclick=\"OrderEdit.AddCus()\">添加</a>&nbsp;");
                        stringBuilder.Append("<input type=\"hidden\" name=\"cusState\" value=\"EDIT\" />");
                        string msg = "";
                        if (TourOrderBll.IsDoDelete(curList[i].ID, ref msg))
                        {
                            stringBuilder.Append("<a sign=\"del\" href=\"javascript:void(0)\" onclick=\"OrderEdit.DelCus($(this))\">删除</a></td></tr>");
                        }
                        else
                        {
                            stringBuilder.AppendFormat("<span>{0}</span>", msg);
                        }
                    }
                }
                cusHtml = stringBuilder.ToString();
                #endregion
            }
            CheckBtn(lineInfo);
            return(lineInfo);
        }
Beispiel #2
0
        protected EyouSoft.Model.TourStructure.LineInquireQuoteInfo SaveInfo(int id)
        {
            EyouSoft.Model.TourStructure.LineInquireQuoteInfo lineInfo = new EyouSoft.Model.TourStructure.LineInquireQuoteInfo();
            //预计出团日期
            lineInfo.LeaveDate = Utils.GetDateTime(Utils.GetFormValue(this.txt_BegTime.UniqueID));
            //总人数
            lineInfo.PeopleNum = Utils.GetInt(Utils.GetFormValue(this.txt_peopleCount.UniqueID), 0);
            //状态
            lineInfo.QuoteState = EyouSoft.Model.EnumType.TourStructure.QuoteState.已处理;
            //备注
            lineInfo.Remark = Utils.GetFormValue(this.txt_remark.UniqueID);
            //客人要求集合
            lineInfo.Requirements = ConProjectControl1.GetDataList();
            //线路编号
            lineInfo.RouteId = Utils.GetInt(xianluWindow1.Id);
            //线路名称
            lineInfo.RouteName = xianluWindow1.Name;
            //价格组成集合
            lineInfo.Services = PriceControl1.GetList;
            //总价
            lineInfo.TotalAmount = PriceControl1.TotalAmount;
            //行程
            lineInfo.XingCheng           = new EyouSoft.Model.TourStructure.XingChengMust();
            lineInfo.XingCheng.QuotePlan = Request.Form[this.txtRoutingNeed.UniqueID];
            lineInfo.XingCheng.QuoteId   = id;
            //行程_附件
            string filepath    = string.Empty;
            string oldfilename = string.Empty;
            bool   file_result = EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files["routingFile"], "TourQuotePriceFile", out filepath, out oldfilename);

            if (filepath != "")
            {
                lineInfo.XingCheng.PlanAccessory     = filepath;
                lineInfo.XingCheng.PlanAccessoryName = oldfilename;
            }
            else
            {
                if (hid_img_path.Value != "null")
                {
                    lineInfo.XingCheng.PlanAccessory     = hid_img_path.Value;
                    lineInfo.XingCheng.PlanAccessoryName = hid_img_name.Value;
                }
                else
                {
                    lineInfo.XingCheng.PlanAccessoryName = "";
                    lineInfo.XingCheng.PlanAccessory     = "";
                }
            }
            //机票折扣
            lineInfo.TicketAgio = Utils.GetDecimal(Utils.GetFormValue(this.txt_agio.UniqueID));
            //特殊要求
            lineInfo.SpecialClaim = Utils.GetFormValue(this.txt_need.UniqueID);
            //编号
            lineInfo.Id = id;
            //公司ID
            lineInfo.CompanyId = SiteUserInfo.CompanyID;
            //联系人姓名
            lineInfo.ContactTel = Utils.GetFormValue(this.txt_contactTel.UniqueID);
            //联系人电话
            lineInfo.ContactName = Utils.GetFormValue(this.txt_contactName.UniqueID);
            //询价单位编号
            lineInfo.CustomerId = Utils.GetInt(this.hid_QuoteCompanyId.Value, 0);
            //询价单位名称
            lineInfo.CustomerName = Utils.GetFormValue(this.txt_quoteCompany.UniqueID);
            ///////////////////////////////////////游客信息

            int cusLength = Utils.GetFormValues("cusName").Length;

            lineInfo.Traveller            = new EyouSoft.Model.TourStructure.TourEverydayApplyTravellerInfo();
            lineInfo.Traveller.Travellers = new List <EyouSoft.Model.TourStructure.TourOrderCustomer>();
            for (int i = 0; i < cusLength; i++)
            {
                //游客id
                string cusID = Utils.GetFormValues("cusID")[i];
                EyouSoft.Model.TourStructure.TourOrderCustomer toc = new EyouSoft.Model.TourStructure.TourOrderCustomer();
                toc.VisitorName = Utils.GetFormValues("cusName")[i];
                toc.VisitorType = (EyouSoft.Model.EnumType.TourStructure.VisitorType)(Utils.GetInt(Utils.GetFormValues("cusType")[i]));
                toc.CradType    = (EyouSoft.Model.EnumType.TourStructure.CradType)(Utils.GetInt(Utils.GetFormValues("cusCardType")[i]));
                toc.CradNumber  = Utils.GetFormValues("cusCardNo")[i];

                //游客性别
                int cusSex = Utils.GetInt(Utils.GetFormValues("cusSex")[i]);

                #region 性别
                if (cusSex == 1)
                {
                    toc.Sex = EyouSoft.Model.EnumType.CompanyStructure.Sex.男;
                }
                else if (cusSex == 2)
                {
                    toc.Sex = EyouSoft.Model.EnumType.CompanyStructure.Sex.女;
                }
                else
                {
                    toc.Sex = EyouSoft.Model.EnumType.CompanyStructure.Sex.未知;
                }
                #endregion

                toc.ContactTel = Utils.GetFormValues("cusPhone")[i];

                toc.IssueTime = DateTime.Now;
                EyouSoft.Model.TourStructure.CustomerSpecialService specModel = new EyouSoft.Model.TourStructure.CustomerSpecialService();
                if (string.IsNullOrEmpty(cusID))
                {
                    toc.ID = System.Guid.NewGuid().ToString();
                }
                else
                {
                    toc.ID = cusID;
                }

                if (Utils.GetFormValues("cusState")[i] == "DEL")
                {
                    toc.IsDelete = true;
                }
                else
                {
                    toc.IsDelete = false;
                }
                //特服
                string specive = Utils.GetFormValues("specive")[i];
                if (!string.IsNullOrEmpty(specive))
                {
                    if (specive.LastIndexOf(',') + 1 == specive.Length)
                    {
                        specive = specive.Substring(0, specive.Length - 1);
                    }
                    specModel.CustormerId   = toc.ID;
                    specModel.ProjectName   = Server.UrlDecode(Utils.GetFromQueryStringByKey(specive, "txtItem"));
                    specModel.ServiceDetail = Server.UrlDecode(Utils.GetFromQueryStringByKey(specive, "txtServiceContent"));
                    specModel.IsAdd         = Utils.GetFromQueryStringByKey(specive, "ddlOperate") == "0" ? true : false;
                    specModel.Fee           = Utils.GetDecimal(Utils.GetFromQueryStringByKey(specive,
                                                                                             "txtCost"));
                    specModel.IssueTime = DateTime.Now;
                    //特服项目名不能为空,否则不添加该条特服信息
                    if (!string.IsNullOrEmpty(specModel.ProjectName))
                    {
                        toc.SpecialServiceInfo = specModel;
                    }
                }
                lineInfo.Traveller.Travellers.Add(toc);
            }
            ///
            return(lineInfo);
        }
Beispiel #3
0
        /// <summary>
        /// 提交数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void lbtn_save_Click(object sender, EventArgs e)
        {
            #region 获取基础数据
            EyouSoft.BLL.TourStructure.TourEveryday       bll   = new EyouSoft.BLL.TourStructure.TourEveryday(SiteUserInfo);
            EyouSoft.Model.TourStructure.TourEverydayInfo model = new EyouSoft.Model.TourStructure.TourEverydayInfo();
            model.AreaId     = Utils.GetInt(Utils.GetFormValue(ddl_area.UniqueID));
            model.CompanyId  = CurrentUserCompanyID;
            model.CreateTime = DateTime.Now;
            model.OperatorId = SiteUserInfo.ID;
            IList <EyouSoft.Model.TourStructure.TourPriceStandardInfo> pricelist = new List <EyouSoft.Model.TourStructure.TourPriceStandardInfo>();

            IList <EyouSoft.Model.CompanyStructure.CustomStand> listcus = new List <EyouSoft.Model.CompanyStructure.CustomStand>();
            EyouSoft.BLL.CompanyStructure.CompanyCustomStand    bllCom  = new CompanyCustomStand();
            listcus = bllCom.GetCustomStandByCompanyId(CurrentUserCompanyID);

            int kkk = listcus.Count;
            for (int k = 0; k < Utils.GetFormValues("ddl_price").Length; k++)
            {
                EyouSoft.Model.TourStructure.TourPriceStandardInfo price = new EyouSoft.Model.TourStructure.TourPriceStandardInfo();
                price.StandardId = Utils.GetInt(Utils.GetFormValues("ddl_price")[k].Split('|')[0]);
                if (price.StandardId == 0)
                {
                    continue;
                }
                price.StandardName = Utils.GetFormValues("ddl_price")[k].Split('|')[1];
                IList <EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo> listLevels = new List <EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo>();


                string[] crPrice = Utils.GetFormValues("txt_cr_price");


                for (int i = 0; i < kkk; i++)
                {
                    EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo level = new EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo();
                    level.AdultPrice    = Utils.GetDecimal(Utils.GetFormValues("txt_cr_price")[i + kkk * k]);
                    level.ChildrenPrice = Utils.GetDecimal(Utils.GetFormValues("txt_rt_price")[i + kkk * k]);
                    level.LevelType     = EyouSoft.Model.EnumType.CompanyStructure.CustomLevType.其他;
                    level.LevelName     = Utils.GetFormValues("hd_cusStandName")[i];
                    level.LevelId       = Utils.GetInt(Utils.GetFormValues("hd_cusStandId")[i]);
                    if (level.LevelId == 0)
                    {
                        continue;
                    }
                    listLevels.Add(level);
                }
                price.CustomerLevels = listLevels;
                pricelist.Add(price);
            }
            IList <EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo> levelList = new List <EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo>();
            model.PriceStandards = pricelist;

            model.ReleaseType = EyouSoft.Model.EnumType.TourStructure.ReleaseType.Normal;
            model.RouteId     = Utils.GetInt(selectXl.Id);
            model.RouteName   = selectXl.Name;
            model.TourDays    = Utils.GetInt(Utils.GetFormValue(txt_Days.UniqueID));
            EyouSoft.Model.TourStructure.TourNormalPrivateInfo privateInfo = new EyouSoft.Model.TourStructure.TourNormalPrivateInfo();
            privateInfo.BuHanXiangMu  = Utils.GetFormValue(txt_noProject.UniqueID);
            privateInfo.ErTongAnPai   = Utils.GetFormValue(txt_child.UniqueID);
            privateInfo.GouWuAnPai    = Utils.GetFormValue(txt_buy.UniqueID);
            privateInfo.NeiBuXingXi   = Utils.GetFormValue(txt_nbinfo.UniqueID);
            privateInfo.Plans         = xingcheng1.GetValues();
            privateInfo.Services      = ConProjectControl1.GetDataList();
            privateInfo.WenXinTiXing  = Utils.GetFormValue(txt_Reminded.UniqueID);
            privateInfo.ZhuYiShiXiang = Utils.GetFormValue(txt_Note.UniqueID);
            privateInfo.ZiFeiXIangMu  = Utils.GetFormValue(txt_owner.UniqueID);
            model.TourNormalInfo      = privateInfo;

            #region 附件

            IList <EyouSoft.Model.TourStructure.TourAttachInfo> listAttachs = new List <EyouSoft.Model.TourStructure.TourAttachInfo>();
            EyouSoft.Model.TourStructure.TourAttachInfo         attInfo     = new EyouSoft.Model.TourStructure.TourAttachInfo();
            string fileAtt    = "";
            string oldfileAtt = "";
            if (EyouSoft.Common.Function.UploadFile.FileUpLoad(FileUpload1.PostedFile, "dayDayPublish", out fileAtt, out oldfileAtt))
            {
                attInfo.FilePath = fileAtt;
            }
            else
            {
                EyouSoft.Common.Function.MessageBox.Show(this.Page, "上传附件失败!");
                return;
            }
            if (attInfo.FilePath.Length < 1)
            {
                attInfo.FilePath = hd_img.Value;
            }
            listAttachs.Add(attInfo);
            model.Attachs = listAttachs;
            #endregion
            #endregion
            #region 数据库修改或添加
            if (Request.QueryString["act"] == "update")
            {
                model.TourId = Utils.GetQueryStringValue("id");
                int i = bll.UpdateTourEverydayInfo(model);
                if (i > 0)
                {
                    EyouSoft.Common.Function.MessageBox.ShowAndRedirect(this.Page, "修改成功!", "DaydayPublish.aspx");
                }
                else
                {
                    EyouSoft.Common.Function.MessageBox.ShowAndRedirect(this.Page, "修改失败!", Request.Url.ToString());
                }
            }
            else
            {
                int i = bll.InsertTourEverydayInfo(model);
                if (i > 0)
                {
                    EyouSoft.Common.Function.MessageBox.ShowAndRedirect(this.Page, "添加成功!", "DaydayPublish.aspx");
                }
                else
                {
                    EyouSoft.Common.Function.MessageBox.ShowAndRedirect(this.Page, "添加失败!", Request.Url.ToString());
                }
            }
            #endregion
        }
Beispiel #4
0
        private void Save()
        {
            EyouSoft.BLL.TourStructure.LineInquireQuoteInfo tsBLL = new EyouSoft.BLL.TourStructure.LineInquireQuoteInfo();
            tsModel = new LineInquireQuoteInfo();          //初始化model

            tid = Utils.GetInt(Utils.GetFormValue("tid")); //获取表操作值
            bool res;

            if (tid > 0)
            {
                tsModel = tsBLL.GetQuoteModel(tid, 0, SiteUserInfo.TourCompany.TourCompanyId, true);
                xcModel = tsModel.XingCheng;
            }
            /////////////////////////////////////普通数据

            tsModel.CustomerName = SiteUserInfo.TourCompany.CompanyName;      //询价单位=当前单位名称??编号??
            tsModel.ContactName  = SiteUserInfo.ContactInfo.ContactName;      //联系人姓名
            tsModel.CustomerId   = SiteUserInfo.TourCompany.TourCompanyId;    //询价单位编号
            tsModel.CompanyId    = SiteUserInfo.CompanyID;                    //专线公司编号

            tsModel.ContactTel = Utils.GetFormValue("vontactTel").ToString(); //联系人电话

            tsModel.RouteName = xianluWindow1.Name;                           //线路名称
            tsModel.RouteId   = Utils.GetInt(xianluWindow1.Id);               //线路ID
            tsModel.LeaveDate = Convert.ToDateTime(this.txtLDate.Text);       //预计出团日期
            tsModel.PeopleNum = Utils.GetInt(Utils.GetFormValue("number"));   //人数??总人数??成人数??儿童数??



            /////////////////////////////////////行程要求////////上传验证

            if (string.IsNullOrEmpty(xcModel.PlanAccessory))
            {
                string[] allowExtensions = new string[] { ".jpeg", ".jpg", ".bmp", ".gif", ".pdf", ".xls", ".xlsx", ".doc", ".docx" };
                string   msg             = string.Empty;
                bool     nameForm        = EyouSoft.Common.Function.UploadFile.CheckFileType(Request.Files, "workAgree", allowExtensions, null, out msg);
                if (!nameForm)
                {
                    lstMsg.Text = msg;
                }
            }
            ////////////////////////////////////行程要求////////上传文件


            if (Request.Files.Count > 0)//上传
            {
                string filepath    = string.Empty;
                string oldfilename = string.Empty;
                bool   result      = EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files["workAgree"], "SupplierControlFile", out filepath, out oldfilename);
                if (result)
                {
                    xcModel.PlanAccessoryName = oldfilename;//协议名
                    xcModel.PlanAccessory     = filepath;
                }
            }

            /////////////////////////////////////////行程要求////文本输入
            xcModel.QuotePlan = Utils.EditInputText(txt_xinchen.Text);


            tsModel.XingCheng = xcModel;                             //行程要求=输入框+附件

            tsModel.Requirements = ConProjectControl1.GetDataList(); //客人要求


            tsModel.SpecialClaim = Utils.GetFormValue("quotePlan");; //特殊要求说明

            ///////////////////////////////////////游客信息

            int cusLength = Utils.GetFormValues("cusName").Length;

            tsModel.Traveller            = new TourEverydayApplyTravellerInfo();
            tsModel.Traveller.Travellers = new List <EyouSoft.Model.TourStructure.TourOrderCustomer>();
            for (int i = 0; i < cusLength; i++)
            {
                //游客id
                string cusID = Utils.GetFormValues("cusID")[i];
                EyouSoft.Model.TourStructure.TourOrderCustomer toc = new TourOrderCustomer();
                toc.VisitorName = Utils.GetFormValues("cusName")[i];
                toc.VisitorType = (EyouSoft.Model.EnumType.TourStructure.VisitorType)(Utils.GetInt(Utils.GetFormValues("cusType")[i]));
                toc.CradType    = (EyouSoft.Model.EnumType.TourStructure.CradType)(Utils.GetInt(Utils.GetFormValues("cusCardType")[i]));
                toc.CradNumber  = Utils.GetFormValues("cusCardNo")[i];

                //游客性别
                int cusSex = Utils.GetInt(Utils.GetFormValues("cusSex")[i]);
                toc.Sex = (EyouSoft.Model.EnumType.CompanyStructure.Sex)cusSex;
                #region 性别
                //if (cusSex == 1)
                //{
                //    toc.Sex = EyouSoft.Model.EnumType.CompanyStructure.Sex.男;
                //}
                //else if (cusSex == 2)
                //{
                //    toc.Sex = EyouSoft.Model.EnumType.CompanyStructure.Sex.女;
                //}
                //else
                //{
                //    toc.Sex = EyouSoft.Model.EnumType.CompanyStructure.Sex.未知;
                //}
                #endregion

                toc.ContactTel = Utils.GetFormValues("cusPhone")[i];

                toc.IssueTime = DateTime.Now;
                EyouSoft.Model.TourStructure.CustomerSpecialService specModel = new EyouSoft.Model.TourStructure.CustomerSpecialService();
                if (string.IsNullOrEmpty(cusID))
                {
                    toc.ID = System.Guid.NewGuid().ToString();
                }
                else
                {
                    toc.ID = cusID;
                }

                if (Utils.GetFormValues("cusState")[i] == "DEL")
                {
                    toc.IsDelete = true;
                }
                else
                {
                    toc.IsDelete = false;
                }
                //特服
                string specive = Utils.GetFormValues("specive")[i];
                if (!string.IsNullOrEmpty(specive))
                {
                    if (specive.LastIndexOf(',') + 1 == specive.Length)
                    {
                        specive = specive.Substring(0, specive.Length - 1);
                    }
                    specModel.CustormerId   = toc.ID;
                    specModel.ProjectName   = Server.UrlDecode(Utils.GetFromQueryStringByKey(specive, "txtItem"));
                    specModel.ServiceDetail = Server.UrlDecode(Utils.GetFromQueryStringByKey(specive, "txtServiceContent"));
                    specModel.IsAdd         = Utils.GetFromQueryStringByKey(specive, "ddlOperate") == "0" ? true : false;
                    specModel.Fee           = Utils.GetDecimal(Utils.GetFromQueryStringByKey(specive,
                                                                                             "txtCost"));
                    specModel.IssueTime = DateTime.Now;
                    //特服项目名不能为空,否则不添加该条特服信息
                    if (!string.IsNullOrEmpty(specModel.ProjectName))
                    {
                        toc.SpecialServiceInfo = specModel;
                    }
                }
                tsModel.Traveller.Travellers.Add(toc);
            }
            ///
            if (tid > 0 && lstMsg.Text == "")
            {
                tsModel.Id = tid;

                res = tsBLL.UpdateInquire(tsModel);
            }
            else
            {
                res = tsBLL.AddInquire(tsModel);
            }


            if (res)
            {
                EyouSoft.Common.Function.MessageBox.ResponseScript(this, ";alert('保存成功!');location.href='SelectMoney.aspx';</script>");
            }
            else
            {
                EyouSoft.Common.Function.MessageBox.ResponseScript(this, ";alert('保存失败!');");
            }
        }
Beispiel #5
0
        private void bind()
        {
            EyouSoft.BLL.TourStructure.TourOrder TourOrderBll = new EyouSoft.BLL.TourStructure.TourOrder(SiteUserInfo);
            List <EnumObj> selectList = EnumObj.GetList(typeof(EyouSoft.Model.EnumType.TourStructure.ServiceType));

            EyouSoft.BLL.TourStructure.LineInquireQuoteInfo tsBLL = new EyouSoft.BLL.TourStructure.LineInquireQuoteInfo(SiteUserInfo);
            tid = Utils.GetInt(Utils.GetQueryStringValue("tid"));
            if (tid > 0)
            {
                tsModel = tsBLL.GetQuoteModel(tid, 0, SiteUserInfo.TourCompany.TourCompanyId, true);
                tup     = true;

                if (tsModel != null)
                {
                    if (tsModel.QuoteState != EyouSoft.Model.EnumType.TourStructure.QuoteState.未处理)
                    {
                        tup = false;
                        EyouSoft.Model.TourStructure.LineInquireQuoteInfo infoModel    = new LineInquireQuoteInfo();
                        EyouSoft.BLL.TourStructure.LineInquireQuoteInfo   lineQuoteBll = new EyouSoft.BLL.TourStructure.LineInquireQuoteInfo(SiteUserInfo);
                        infoModel = lineQuoteBll.GetQuoteModel(tid, SiteUserInfo.CompanyID, 0, false);
                        IList <EyouSoft.Model.TourStructure.TourTeamServiceInfo> list = infoModel.Services;
                        //decimal  Money=0;

                        if (infoModel.Services.Count > 0)
                        {
                            this.rptList.DataSource = list;
                            this.rptList.DataBind();
                            //for (int i = 0; i < infoModel.Services.Count; i++)
                            //{
                            //    Money += infoModel.Services[i].SelfPrice;
                            //}
                        }
                        mlen = infoModel.Services.Count;
                        txtAllPrice.Value = infoModel.TotalAmount.ToString("#,##0.00");
                    }

                    if (tsModel.QuoteState == EyouSoft.Model.EnumType.TourStructure.QuoteState.已成功)
                    {
                        this.txtRemarks.Text = tsModel.Remark;
                    }
                    else
                    {
                        this.lblRemarks.Visible = false;
                        this.txtRemarks.Visible = false;
                    }


                    vontactTel = tsModel.ContactTel;
                    ConProjectControl1.SetList = tsModel.Requirements;
                    ConProjectControl1.SetDataList();
                    xcModel = tsModel.XingCheng;



                    #region 订单游客数据
                    System.Collections.Generic.IList <EyouSoft.Model.TourStructure.TourOrderCustomer> curList = tsModel.Traveller.Travellers;
                    System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
                    if (curList != null && curList.Count > 0)
                    {
                        for (int i = 0; i < curList.Count; i++)
                        {
                            if (curList[i].VisitorType == EyouSoft.Model.EnumType.TourStructure.VisitorType.成人)
                            {
                                stringBuilder.AppendFormat("<tr itemtype=\"{0}\">", "adult");
                            }
                            else if (curList[i].VisitorType == EyouSoft.Model.EnumType.TourStructure.VisitorType.儿童)
                            {
                                stringBuilder.AppendFormat("<tr itemtype=\"{0}\">", "child");
                            }
                            else
                            {
                                stringBuilder.AppendFormat("<tr itemtype=\"{0}\">", "other");
                            }
                            stringBuilder.AppendFormat("<td style=\"width: 5%\" bgcolor=\"#e3f1fc\" index=\"{0}\" align=\"center\">{0}</td><td height=\"25\" bgcolor=\"#e3f1fc\" align=\"center\">", i + 1);
                            stringBuilder.AppendFormat("<input type=\"text\" class=\"searchinput\" id=\"cusName\" MaxLength=\"50\" valid=\"required\" errmsg=\"请填写姓名!\" name=\"cusName\" value=\"{0}\" /></td>", curList[i].VisitorName);
                            stringBuilder.Append("<td bgcolor=\"#e3f1fc\" align=\"center\">");

                            #region 游客类型
                            if (curList[i].VisitorType == EyouSoft.Model.EnumType.TourStructure.VisitorType.成人)
                            {
                                stringBuilder.Append("<select disabled=\"disabled\" title=\"请选择\" id=\"cusType\" name=\"cusType\">");
                                stringBuilder.Append("<option value=\"\">请选择</option>");
                                stringBuilder.Append("<option value=\"1\" selected=\"selected\">成人</option>");
                                stringBuilder.Append("<option value=\"2\">儿童</option>");
                                stringBuilder.Append(" </select>");
                            }
                            //儿童
                            else if (curList[i].VisitorType == EyouSoft.Model.EnumType.TourStructure.VisitorType.儿童)
                            {
                                stringBuilder.Append("<select disabled=\"disabled\" title=\"请选择\"  id=\"cusType\" name=\"cusType\">");
                                stringBuilder.Append("<option value=\"\">请选择</option>");
                                stringBuilder.Append("<option value=\"1\" >成人</option>");
                                stringBuilder.Append("<option value=\"2\" selected=\"selected\">儿童</option>");
                                stringBuilder.Append(" </select>");
                            }
                            //其它
                            else
                            {
                                stringBuilder.Append("<select id=\"cusType\" title=\"请选择\"  name=\"cusType\">");
                                stringBuilder.Append("<option value=\"\"  selected=\"selected\">请选择</option>");
                                stringBuilder.Append("<option value=\"1\" >成人</option>");
                                stringBuilder.Append("<option value=\"2\">儿童</option>");
                                stringBuilder.Append(" </select>");
                            }
                            #endregion

                            stringBuilder.Append("</td>");
                            stringBuilder.Append("<td bgcolor=\"#e3f1fc\" align=\"center\">");

                            #region 游客证件类型
                            switch (curList[i].CradType)
                            {
                            case EyouSoft.Model.EnumType.TourStructure.CradType.身份证:
                            {
                                stringBuilder.Append("<select id=\"cusCardType\" name=\"cusCardType\">");
                                stringBuilder.Append("<option value=\"0\">请选择证件</option>");
                                stringBuilder.Append("<option value=\"1\" selected=\"selected\">身份证</option>");
                                stringBuilder.Append("<option value=\"2\">护照</option>");
                                stringBuilder.Append("<option value=\"3\">军官证</option>");
                                stringBuilder.Append("<option value=\"4\">台胞证</option>");
                                stringBuilder.Append("<option value=\"5\">港澳通行证</option>");
                                stringBuilder.Append("<option value=\"6\">户口本</option>");
                                stringBuilder.Append("</select>");
                                break;
                            }

                            case EyouSoft.Model.EnumType.TourStructure.CradType.护照:
                            {
                                stringBuilder.Append("<select id=\"cusCardType\" name=\"cusCardType\">");
                                stringBuilder.Append("<option value=\"0\">请选择证件</option>");
                                stringBuilder.Append("<option value=\"1\">身份证</option>");
                                stringBuilder.Append("<option value=\"2\" selected=\"selected\">护照</option>");
                                stringBuilder.Append("<option value=\"3\">军官证</option>");
                                stringBuilder.Append("<option value=\"4\">台胞证</option>");
                                stringBuilder.Append("<option value=\"5\">港澳通行证</option>");
                                stringBuilder.Append("<option value=\"6\">户口本</option>");
                                stringBuilder.Append("</select>");
                                break;
                            }

                            case EyouSoft.Model.EnumType.TourStructure.CradType.军官证:
                            {
                                stringBuilder.Append("<select id=\"cusCardType\" name=\"cusCardType\">");
                                stringBuilder.Append("<option value=\"0\">请选择证件</option>");
                                stringBuilder.Append("<option value=\"1\">身份证</option>");
                                stringBuilder.Append("<option value=\"2\">护照</option>");
                                stringBuilder.Append("<option value=\"3\" selected=\"selected\">军官证</option>");
                                stringBuilder.Append("<option value=\"4\">台胞证</option>");
                                stringBuilder.Append("<option value=\"5\">港澳通行证</option>");
                                stringBuilder.Append("<option value=\"6\">户口本</option>");
                                stringBuilder.Append("</select>");
                                break;
                            }

                            case EyouSoft.Model.EnumType.TourStructure.CradType.台胞证:
                            {
                                stringBuilder.Append("<select id=\"cusCardType\" name=\"cusCardType\">");
                                stringBuilder.Append("<option value=\"0\">请选择证件</option>");
                                stringBuilder.Append("<option value=\"1\">身份证</option>");
                                stringBuilder.Append("<option value=\"2\">护照</option>");
                                stringBuilder.Append("<option value=\"3\">军官证</option>");
                                stringBuilder.Append("<option value=\"4\" selected=\"selected\">台胞证</option>");
                                stringBuilder.Append("<option value=\"5\">港澳通行证</option>");
                                stringBuilder.Append("<option value=\"6\">户口本</option>");
                                stringBuilder.Append("</select>");
                                break;
                            }

                            case EyouSoft.Model.EnumType.TourStructure.CradType.港澳通行证:
                            {
                                stringBuilder.Append("<select id=\"cusCardType\" name=\"cusCardType\">");
                                stringBuilder.Append("<option value=\"0\">请选择证件</option>");
                                stringBuilder.Append("<option value=\"1\">身份证</option>");
                                stringBuilder.Append("<option value=\"2\">护照</option>");
                                stringBuilder.Append("<option value=\"3\">军官证</option>");
                                stringBuilder.Append("<option value=\"4\">台胞证</option>");
                                stringBuilder.Append("<option value=\"5\" selected=\"selected\">港澳通行证</option>");
                                stringBuilder.Append("<option value=\"6\">户口本</option>");
                                stringBuilder.Append("</select>");
                                break;
                            }

                            case EyouSoft.Model.EnumType.TourStructure.CradType.户口本:
                            {
                                stringBuilder.Append("<select id=\"cusCardType\" name=\"cusCardType\">");
                                stringBuilder.Append("<option value=\"0\">请选择证件</option>");
                                stringBuilder.Append("<option value=\"1\">身份证</option>");
                                stringBuilder.Append("<option value=\"2\">护照</option>");
                                stringBuilder.Append("<option value=\"3\">军官证</option>");
                                stringBuilder.Append("<option value=\"4\">台胞证</option>");
                                stringBuilder.Append("<option value=\"5\">港澳通行证</option>");
                                stringBuilder.Append("<option value=\"6\" selected=\"selected\">户口本</option>");
                                break;
                            }

                            default:
                            {
                                stringBuilder.Append("<select id=\"cusCardType\" name=\"cusCardType\">");
                                stringBuilder.Append("<option value=\"0\" selected=\"selected\">请选择证件</option>");
                                stringBuilder.Append("<option value=\"1\" >身份证</option>");
                                stringBuilder.Append("<option value=\"2\">护照</option>");
                                stringBuilder.Append("<option value=\"3\">军官证</option>");
                                stringBuilder.Append("<option value=\"4\">台胞证</option>");
                                stringBuilder.Append("<option value=\"5\">港澳通行证</option>");
                                stringBuilder.Append("<option value=\"6\">户口本</option>");
                                stringBuilder.Append("</select>");
                                break;
                            }
                            }
                            #endregion

                            stringBuilder.Append("</td>");
                            stringBuilder.Append("<td bgcolor=\"#e3f1fc\" align=\"center\">");
                            stringBuilder.AppendFormat("<input type=\"text\" class=\"searchinput searchinput02\" id=\"cusCardNo\" MaxLength=\"150\" onblur='getSex(this)' name=\"cusCardNo\" value=\"{0}\">", curList[i].CradNumber);
                            stringBuilder.Append("</td>");
                            stringBuilder.Append("<td bgcolor=\"#e3f1fc\" align=\"center\">");

                            #region 游客性别
                            switch (curList[i].Sex)
                            {
                            case EyouSoft.Model.EnumType.CompanyStructure.Sex.男:
                            {
                                stringBuilder.Append("<select class='ddlSex' id=\"cusSex\" name=\"cusSex\">");
                                stringBuilder.Append("<option value=\"0\">请选择</option>");
                                stringBuilder.Append("<option value=\"1\" selected=\"selected\">男</option>");
                                stringBuilder.Append("<option value=\"2\">女</option>");
                                stringBuilder.Append("</select>");
                                break;
                            }

                            case EyouSoft.Model.EnumType.CompanyStructure.Sex.女:
                            {
                                stringBuilder.Append("<select class='ddlSex' id=\"cusSex\" name=\"cusSex\">");
                                stringBuilder.Append("<option value=\"0\">请选择</option>");
                                stringBuilder.Append("<option value=\"1\">男</option>");
                                stringBuilder.Append("<option value=\"2\" selected=\"selected\">女</option>");
                                stringBuilder.Append("</select>");
                                break;
                            }

                            default:
                            {
                                stringBuilder.Append("<select class='ddlSex' id=\"cusSex\" name=\"cusSex\">");
                                stringBuilder.Append("<option value=\"0\" selected=\"selected\">请选择</option>");
                                stringBuilder.Append("<option value=\"1\">男</option>");
                                stringBuilder.Append("<option value=\"2\">女</option>");
                                break;
                            }
                            }

                            #endregion

                            stringBuilder.Append("</td>");
                            stringBuilder.Append("<td bgcolor=\"#e3f1fc\" align=\"center\">");
                            stringBuilder.AppendFormat("<input type=\"text\" class=\"searchinput\" id=\"cusPhone\" MaxLength=\"50\" name=\"cusPhone\" value=\"{0}\">", curList[i].ContactTel);
                            stringBuilder.Append("</td>");
                            stringBuilder.Append("<td bgcolor=\"#e3f1fc\" align=\"center\"  width=\"6%\">");
                            if (curList[i].SpecialServiceInfo != null)
                            {
                                string str = string.Format("txtItem={0}&txtServiceContent={1}&txtCost={2}&ddlOperate={3}", curList[i].SpecialServiceInfo.ProjectName, curList[i].SpecialServiceInfo.ServiceDetail, curList[i].SpecialServiceInfo.Fee, (curList[i].SpecialServiceInfo.IsAdd ? "0" : "1"));
                                stringBuilder.AppendFormat("<input id=\"spe{0}\" type=\"hidden\" name=\"specive\" value=\"{1}\" />", curList[i].ID, str);
                            }
                            else
                            {
                                string special = "";
                                if (curList[i].SpecialServiceInfo != null)
                                {
                                    string isadd = curList[i].SpecialServiceInfo.IsAdd ? "0" : "1";
                                    special = "txtItem=" + curList[i].SpecialServiceInfo.ProjectName + "&txtServiceContent=" + curList[i].SpecialServiceInfo.ServiceDetail + "&ddlOperate=" + isadd + "&txtCost=" + Utils.FilterEndOfTheZeroDecimal(curList[i].SpecialServiceInfo.Fee);
                                }
                                stringBuilder.AppendFormat("<input id=\"spe{0}\" type=\"hidden\" name=\"specive\" value=\"{1}\" />", curList[i].ID, special);
                            }
                            stringBuilder.AppendFormat("<a sign=\"speService\" href=\"javascript:void(0)\" onclick=\"OrderEdit.OpenSpecive('spe{0}')\">特服</a></td>", curList[i].ID);
                            stringBuilder.Append("<td bgcolor=\"#e3f1fc\" align=\"center\" width=\"15%\">");
                            stringBuilder.AppendFormat("<input type=\"hidden\" name=\"cusID\" value=\"{0}\" />", curList[i].ID);
                            stringBuilder.Append("<a sign=\"add\" href=\"javascript:void(0)\" onclick=\"OrderEdit.AddCus()\">添加</a>&nbsp;");
                            stringBuilder.Append("<input type=\"hidden\" name=\"cusState\" value=\"EDIT\" />");
                            string msg = "";
                            if (TourOrderBll.IsDoDelete(curList[i].ID, ref msg))
                            {
                                stringBuilder.Append("<a sign=\"del\" href=\"javascript:void(0)\" onclick=\"OrderEdit.DelCus($(this))\">删除</a></td></tr>");
                            }
                            else
                            {
                                stringBuilder.AppendFormat("<span>{0}</span>", msg);
                            }
                        }
                    }
                    cusHtml = stringBuilder.ToString();
                    #endregion
                }
            }
        }
Beispiel #6
0
        /// <summary>
        /// 提交事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void lbtn_save_Click(object sender, EventArgs e)
        {
            if (Request.QueryString["act"] == "update")
            {
                actType = 1;
            }
            if (Request.QueryString["act"] == "copy")
            {
                actType = 2;
            }
            #region 基础数据绑定
            IList <EyouSoft.Model.CompanyStructure.CustomStand> listcus = new List <EyouSoft.Model.CompanyStructure.CustomStand>();
            EyouSoft.BLL.CompanyStructure.CompanyCustomStand    bllCom  = new CompanyCustomStand();

            EyouSoft.BLL.TourStructure.Tour       tour = new EyouSoft.BLL.TourStructure.Tour();
            EyouSoft.Model.TourStructure.TourInfo info = new EyouSoft.Model.TourStructure.TourInfo();
            if (actType == 1)
            {
                info = (EyouSoft.Model.TourStructure.TourInfo)tour.GetTourInfo(Utils.GetQueryStringValue("id"));
            }
            listcus = bllCom.GetCustomStandByCompanyId(CurrentUserCompanyID);

            int      kkk = listcus.Count;
            string[] st  = Utils.GetFormValues("eat");
            List <EyouSoft.Model.TourStructure.TourPlanInfo> list = xingcheng1.GetValues();
            info.AreaId           = EyouSoft.Common.Utils.GetInt(Request.Form[ddl_area.UniqueID]);
            info.RouteName        = selectXl.Name;
            info.TourDays         = EyouSoft.Common.Utils.GetInt(txt_Days.Text);
            info.PlanPeopleNumber = 1;//EyouSoft.Common.Utils.GetInt(txt_pepoleNum.Text);
            info.TourTraffic      = GetSelectTraffic();
            EyouSoft.Model.TourStructure.TourCreateRuleInfo rule = new EyouSoft.Model.TourStructure.TourCreateRuleInfo();

            if (actType == 0 || actType == 2)
            {
                string gz = createTea1.getGuiZe();
                rule.EDate = EyouSoft.Common.Utils.GetDateTime(Utils.GetFromQueryStringByKey(gz, "end"));
                rule.SDate = EyouSoft.Common.Utils.GetDateTime(Utils.GetFromQueryStringByKey(gz, "start"));
                switch (Utils.GetFromQueryStringByKey(gz, "type"))
                {
                case "1":
                {
                    rule.Cycle = Utils.GetFromQueryStringByKey(gz, "data");
                    rule.Rule  = EyouSoft.Model.EnumType.TourStructure.CreateTourRule.星期;
                } break;

                case "2":
                {
                    rule.Cycle = Utils.GetFromQueryStringByKey(gz, "data");
                    rule.Rule  = EyouSoft.Model.EnumType.TourStructure.CreateTourRule.天数;
                } break;

                case "3":
                {
                    rule.SDate = null;
                    rule.EDate = null;
                    rule.Cycle = null;
                    rule.Rule  = EyouSoft.Model.EnumType.TourStructure.CreateTourRule.日期;
                } break;
                }
                info.CreateRule = rule;
            }
            #region 出团信息
            info.LTraffic = txt_startTraffic.Text;
            info.RTraffic = txt_endTraffic.Text;
            List <EyouSoft.Model.TourStructure.TourSentPeopleInfo> sentpepole = new List <EyouSoft.Model.TourStructure.TourSentPeopleInfo>();
            string[] strOperId = SelectgroupPepole.OperId.Split(',');
            for (int i = 0; i < strOperId.Length; i++)
            {
                EyouSoft.Model.TourStructure.TourSentPeopleInfo sent = new EyouSoft.Model.TourStructure.TourSentPeopleInfo();
                sent.OperatorId   = Utils.GetInt(strOperId[i]);
                sent.OperatorName = SelectgroupPepole.OperName.Split(',')[i];
                sentpepole.Add(sent);
            }
            info.SentPeoples = sentpepole;
            //string time = txt_jh_date.Text + " " + ddl_jh_date.SelectedValue + ":00:00";
            //info.GatheringTime = Utils.GetDateTimeNullable(time) == null ? string.Empty : time;
            info.GatheringTime  = Utils.GetFormValue(txt_jh_date.UniqueID);
            info.GatheringPlace = txt_jh_area.Text;
            info.GatheringSign  = txt_jh_logo.Text;
            #endregion
            IList <EyouSoft.Model.TourStructure.TourLocalAgencyInfo> local;
            local             = DiJieControl1.GetList;
            info.LocalAgencys = local;

            info.CompanyId = CurrentUserCompanyID;

            IList <EyouSoft.Model.TourStructure.TourPriceStandardInfo> pricelist = new List <EyouSoft.Model.TourStructure.TourPriceStandardInfo>();
            string[] ddl_price = Utils.GetFormValues("ddl_price");
            for (int k = 0; k < ddl_price.Length; k++)
            {
                EyouSoft.Model.TourStructure.TourPriceStandardInfo price = new EyouSoft.Model.TourStructure.TourPriceStandardInfo();
                price.StandardId = Utils.GetInt(Utils.GetFormValues("ddl_price")[k].Split('|')[0]);

                if (ddl_price[k] == "" || price.StandardId == 0)
                {
                    continue;
                }
                price.StandardName = Utils.GetFormValues("ddl_price")[k].Split('|')[1];
                IList <EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo> listLevels = new List <EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo>();


                string[] crPrice = Utils.GetFormValues("txt_cr_price");
                for (int i = 0; i < kkk; i++)
                {
                    int levId = Utils.GetInt(Utils.GetFormValues("hd_cusStandId")[i]);
                    if (levId == 0)
                    {
                        continue;
                    }
                    EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo level = new EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo();
                    level.AdultPrice    = Utils.GetDecimal(Utils.GetFormValues("txt_cr_price")[i + kkk * k]);
                    level.ChildrenPrice = Utils.GetDecimal(Utils.GetFormValues("txt_rt_price")[i + kkk * k]);
                    level.LevelType     = EyouSoft.Model.EnumType.CompanyStructure.CustomLevType.其他;
                    level.LevelName     = Utils.GetFormValues("hd_cusStandName")[i];
                    level.LevelId       = levId;
                    listLevels.Add(level);
                }
                price.CustomerLevels = listLevels;
                pricelist.Add(price);
            }
            IList <EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo> levelList = new List <EyouSoft.Model.TourStructure.TourPriceCustomerLevelInfo>();

            info.PriceStandards = pricelist;
            IList <EyouSoft.Model.TourStructure.TourPlanInfo> ilist = new List <EyouSoft.Model.TourStructure.TourPlanInfo>();

            ilist = xingcheng1.GetValues();
            info.TourNormalInfo       = new EyouSoft.Model.TourStructure.TourNormalPrivateInfo();
            info.TourNormalInfo.Plans = ilist;
            IList <EyouSoft.Model.TourStructure.TourAttachInfo> listAttachs = new List <EyouSoft.Model.TourStructure.TourAttachInfo>();
            EyouSoft.Model.TourStructure.TourAttachInfo         attInfo     = new EyouSoft.Model.TourStructure.TourAttachInfo();
            string fileAtt    = "";
            string oldfileAtt = "";
            if (EyouSoft.Common.Function.UploadFile.FileUpLoad(FileUpload1.PostedFile, "sanping", out fileAtt, out oldfileAtt))
            {
                attInfo.FilePath = fileAtt;
            }
            else
            {
                EyouSoft.Common.Function.MessageBox.Show(this.Page, "上传附件失败!");
                return;
            }
            if (attInfo.FilePath.Length < 1)
            {
                attInfo.FilePath = hd_img.Value;
            }
            listAttachs.Add(attInfo);

            info.TourNormalInfo.Services      = ConProjectControl1.GetDataList();
            info.TourNormalInfo.BuHanXiangMu  = txt_noProject.Value;
            info.TourNormalInfo.GouWuAnPai    = txt_buy.Value;
            info.TourNormalInfo.ErTongAnPai   = txt_child.Value;
            info.TourNormalInfo.ZiFeiXIangMu  = txt_owner.Value;
            info.TourNormalInfo.ZhuYiShiXiang = txt_Note.Value;
            info.TourNormalInfo.WenXinTiXing  = txt_Reminded.Value;
            info.Attachs = listAttachs;
            //info.TourDays = createTea1.getDays();
            info.OperatorId = SiteUserInfo.ID;
            info.TourNormalInfo.NeiBuXingXi = Utils.GetFormValue(txt_nbinfo.UniqueID);
            info.Coordinator = new EyouSoft.Model.TourStructure.TourCoordinatorInfo();
            info.Coordinator.CoordinatorId = Utils.GetInt(Utils.GetFormValue("sel_oprator"));
            info.TourCityId = Utils.GetInt(Utils.GetFormValue(ddl_city.UniqueID));

            #endregion
            #region 新增操作
            if (actType == 0 || actType == 2)
            {
                info.ReleaseType  = EyouSoft.Model.EnumType.TourStructure.ReleaseType.Normal;
                info.Status       = EyouSoft.Model.EnumType.TourStructure.TourStatus.正在收客;
                info.TourType     = EyouSoft.Model.EnumType.TourStructure.TourType.散拼计划;
                info.TicketStatus = EyouSoft.Model.EnumType.PlanStructure.TicketState.None;
                IList <EyouSoft.Model.TourStructure.TourChildrenInfo> listChild = new List <EyouSoft.Model.TourStructure.TourChildrenInfo>();
                string[] childTeamNum = Utils.GetFormValue("hidToursNumbers").Split(',');
                string[] tourcodes    = new string[childTeamNum.Length];
                for (int i = 0; i < childTeamNum.Length; i++)
                {
                    ///子团
                    EyouSoft.Model.TourStructure.TourChildrenInfo child = new EyouSoft.Model.TourStructure.TourChildrenInfo();
                    child.TourCode = childTeamNum[i].Split('}')[1];
                    child.LDate    = Utils.GetDateTime(childTeamNum[i].Split('{')[0]);
                    listChild.Add(child);
                    tourcodes[i] = child.TourCode;
                }
                info.Childrens = listChild;

                IList <string> list_tourCode = tour.ExistsTourCodes(SiteUserInfo.CompanyID, null, tourcodes);
                if (list_tourCode.Count > 0)
                {
                    Response.Write("<script>alert('" + string.Join(",", list_tourCode.ToArray()) + "团号已经存在!');location.href=location.href;</script>");
                    return;
                }
                int ii = tour.InsertTourInfo(info);

                if (ii > 0)
                {
                    Response.Write("<script>alert('添加成功!');location.href='default.aspx';</script>");
                }
                else
                {
                    EyouSoft.Common.Function.MessageBox.Show(this.Page, "添加失败!请重试");
                }
            }
            #endregion
            #region 修改操作
            else
            {
                if (!Utils.PlanIsUpdateOrDelete(info.Status.ToString()))
                {
                    Response.Write("<script>alert('该团已提交财务,不能对它操作!');location.href=location.href;</script>");
                    return;
                }
                info.TourId    = Request.QueryString["id"];
                info.Childrens = null;
                info.TourCode  = txt_teamNum.Value;
                IList <string> list_tourCode = tour.ExistsTourCodes(SiteUserInfo.CompanyID, info.TourId, info.TourCode);
                if (list_tourCode.Count > 0)
                {
                    Response.Write("<script>alert('团号已经存在!');location.href=location.href;</script>");
                    return;
                }
                int ii = tour.UpdateTourInfo(info);

                if (ii > 0)
                {
                    Response.Write("<script>alert('修改成功!');location.href='default.aspx';</script>");
                    return;
                }
                else
                {
                    EyouSoft.Common.Function.MessageBox.Show(this.Page, "修改失败!请重试");
                    return;
                }
            }
            #endregion
        }