protected void IbtnSubmit_Click(object sender, EventArgs e)
    {
        //获取投资资源的信息
        Tz888.Model.Info.MainInfoModel               mainInfoModel         = new Tz888.Model.Info.MainInfoModel();               //创建主体信息实体
        Tz888.Model.Info.V124.CapitalInfoModel       capitalInfoModel      = new Tz888.Model.Info.V124.CapitalInfoModel();       //创建投资信息实体
        List <Tz888.Model.Info.CapitalInfoAreaModel> capitalInfoAreaModels = new List <Tz888.Model.Info.CapitalInfoAreaModel>(); //投资区域信息实体列表

        Tz888.Model.Info.ShortInfoModel shortInfoModel = new Tz888.Model.Info.ShortInfoModel();                                  //创建短信息实体
        //以下是文件上传的实体声明
        List <Tz888.Model.Info.InfoResourceModel> infoResourceModels = new List <Tz888.Model.Info.InfoResourceModel>();

        DateTime time_now = DateTime.Now;

        //拟投向区域
        capitalInfoAreaModels = this.ZoneMoreSelectControl1.CapitalInfoAreaModels;

        //主体信息实体付值


        #region 投资信息实体赋值

        //投资意向详细说明
        capitalInfoModel.ComAbout = Tz888.Common.Utility.PageValidate.TxtToHtml(this.txtCapitalIntent.Value.Trim());

        //单项目可投资金额

        capitalInfoModel.CapitalID = this.rblCurreny.SelectedValue;
        //投资回报率
        capitalInfoModel.RegisteredCapital = this.txtHBao.Text.ToString().Trim();
        //项目介绍提炼
        capitalInfoModel.ComBreif = "";

        capitalInfoModel.CooperationDemandType = "";

        //拟投资行业
        capitalInfoModel.IndustryBID = this.SelectIndustryControl1.IndustryString;
        //投资项目阶段
        //2010-06-23

        capitalInfoModel.stageID = Convert.ToInt32(1);//(this.rblStage.SelectedValue);
        // 是否参与项目方管理
        //2010-06-23
        capitalInfoModel.joinManageID = Convert.ToInt32(1); //(this.rdlJoinManage.SelectedValue);

        //投资方式
        for (int i = 0; chkLstCooperationDemand.Items.Count > i; i++)
        {
            if (chkLstCooperationDemand.Items[i].Selected)
            {
                capitalInfoModel.CooperationDemandType += chkLstCooperationDemand.Items[i].Value + ",";
            }
        }


        //以下是需要添加的参数
        //注册资金
        //capitalInfoModel.RegisteredCapital = "";// this.rblRegisterdollar.SelectedValue;
        //团队规模
        capitalInfoModel.TeamScale = "";            // this.rblTeam.SelectedValue;
        //机构年平均投资事件数
        capitalInfoModel.AverageInvestment = "";    // this.rblPinJ.SelectedValue;
        //机构成功投资事件总数
        capitalInfoModel.SuccessfulInvestment = ""; // this.rblSucess.SelectedValue;
        //投资需求摘要
        capitalInfoModel.InvestmentDemand = Tz888.Common.Utility.PageValidate.TxtToHtml("");

        //添加所属区域


        capitalInfoModel.SCountryID  = "001";
        capitalInfoModel.SProvinceID = "001";
        capitalInfoModel.SCityID     = "001";
        capitalInfoModel.SCountyID   = "001";



        //项目承办单位
        capitalInfoModel.Prorganizers = "no";
        //文件上传的
        infoResourceModels = FilesUploadControl1.InfoList;


        #endregion


        //这里是其他的实体值
        if (!string.IsNullOrEmpty(this.txtCapitalName.Text.Trim()))
        {
            mainInfoModel.Title = Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtCapitalName.Text.Trim());
        }

        string CountryCode;
        try
        {
            CountryCode = capitalInfoAreaModels[0].CountryCode;
        }
        catch
        {
            CountryCode = "ALL";
        }
        mainInfoModel.InfoCode       = Tz888.BLL.Info.Common.CreateInfoCode("Capital", capitalInfoModel.IndustryBID.Split(',')[0], CountryCode, time_now);
        mainInfoModel.publishT       = time_now;
        mainInfoModel.Hit            = 0;
        mainInfoModel.MainPointCount = Convert.ToDecimal(txtPointCount.Text.ToString().Trim());
        mainInfoModel.IsCore         = true;
        //mainInfoModel.LoginName = "cxj";

        mainInfoModel.LoginName          = bp.LoginName; //用户名称
        mainInfoModel.InfoOriginRoleName = "0";          //用户角色
        mainInfoModel.GradeID            = "0";

        if (chkIsPoint.Checked == true)
        {
            mainInfoModel.FixPriceID = "2";
        }
        else
        {
            mainInfoModel.FixPriceID = "1";
        }

        mainInfoModel.FeeStatus = 0;

        string keyword = "";


        mainInfoModel.KeyWord  = Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtCapitalName.Text.Trim());
        mainInfoModel.Descript = Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtCapitalName.Text.Trim());
        if (!string.IsNullOrEmpty(this.txtCapitalName.Text.Trim()))
        {
            mainInfoModel.DisplayTitle = Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtCapitalName.Text.Trim());
        }
        mainInfoModel.FrontDisplayTime  = time_now;
        mainInfoModel.ValidateStartTime = time_now;
        //意向有效期限
        //20100623
        mainInfoModel.ValidateTerm = Convert.ToInt32(this.rdlValiditeTerm.SelectedValue.Trim());
        capitalInfoModel.isVIP     = Convert.ToInt32(this.ddlIsVip.SelectedValue.ToString());
        mainInfoModel.IsVip        = Convert.ToInt32(this.ddlIsVip.SelectedValue.ToString());
        mainInfoModel.TemplateID   = "001";
        mainInfoModel.HtmlFile     = "";

        shortInfoModel.ShortInfoControlID = "CapitalIndex1";
        if (!string.IsNullOrEmpty(this.txtCapitalName.Text.Trim()))
        {
            shortInfoModel.ShortTitle = Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtCapitalName.Text.Trim());
        }
        shortInfoModel.ShortContent = "";
        shortInfoModel.Remark       = "";

        Tz888.BLL.Info.V124.CapitalInfoBLL bll = new Tz888.BLL.Info.V124.CapitalInfoBLL();

        //这里是插入资源投资信息
        //long infoID = bll.Insert(mainInfoModel, capitalInfoModel, this.GetInfoContact(), shortInfoModel, capitalInfoAreaModels, null, infoResourceModels);
        long infoID = bll.Insert(mainInfoModel, capitalInfoModel, this.GetInfoContact(), shortInfoModel, capitalInfoAreaModels, infoResourceModels);
        //以下进行图片的插入


        if (infoID > 0)
        {
            Tz888.BLL.MerchantManage.PageStatic merstatic = new Tz888.BLL.MerchantManage.PageStatic();
            #region 定价
            string price = "";


            #endregion

            if (chkIsPoint.Checked == true)
            {
                price = "2";
            }
            else
            {
                price = "1";
            }

            bool pric = mainBll.HasFixPrice(infoID, price, bp.LoginName);
            if (rdPass.Checked == true)
            {
                string url = "Capital/" + DateTime.Now.ToString("yyyyMM") + "/Capital" + DateTime.Now.ToString("yyyyMMdd") + "_" + infoID + ".shtml";

                merstatic.UpdateUrl(url, infoID);
            }
            long   _infoID = Convert.ToInt64(infoID);
            string title   = Convert.ToString("投资发布");
            Tz888.Model.Info.InfoContactModel infoContactModel = new Tz888.Model.Info.InfoContactModel(); //创建信息联系方式主体

            string email       = this.txtEmail.Text.Trim();
            string telCountry  = this.txtTelCountry.Text.Trim();
            string telZoneCode = this.txtTelZoneCode.Text.Trim();
            string telNumber   = this.txtTelNumber.Text.Trim();
            //注释掉传真
            string faxCountry  = "0";
            string faxZoneCode = "0";
            string faxNumber   = "0";
            string webSite     = this.txtWebSite.Text.Trim();
            string name        = this.txtLinkMan.Text.Trim();
            string mobile      = this.txtMobile.Text.Trim();
            string address     = this.txtAddress.Text.Trim();
            //注释右邮编
            string postCode = "0";

            //以下是职位
            string position = ""; //this.txtPosition.Text.Trim();
            //投资机构名称
            string organizationName = this.txtGovName.Text.Trim();


            infoContactModel.OrganizationName = organizationName;
            infoContactModel.InfoID           = _infoID;
            infoContactModel.Email            = email;
            infoContactModel.WebSite          = webSite;
            infoContactModel.TelCountryCode   = telCountry;
            infoContactModel.TelStateCode     = telZoneCode;
            infoContactModel.TelNum           = telNumber;
            infoContactModel.FaxCountryCode   = faxCountry;
            infoContactModel.FaxStateCode     = faxZoneCode;
            infoContactModel.FaxNum           = faxNumber;
            infoContactModel.Name             = name;
            infoContactModel.Mobile           = mobile;
            infoContactModel.Address          = address;
            infoContactModel.PostCode         = postCode;
            //以下是职位
            infoContactModel.Position = position;

            Tz888.BLL.Info.InfoContact obj = new Tz888.BLL.Info.InfoContact();

            //这里是更新联系信息
            if (obj.Update(infoContactModel))
            {
                Tz888.Model.Info.V124.CapitalSetModel model = new Tz888.Model.Info.V124.CapitalSetModel();
                page = page.objGetMerchantInfoByInfoID(_infoID);    //根ID获取信息
                string IsVip   = Mercahrstatic.SelCapitalInfoVip(); //查询为重点推荐资源
                string Idstuny = page.SelectLndus(page.Are);        //根据区域查询信息
                int    sum     = page.StaticHtml(Convert.ToInt32(_infoID), page.Title, page.PublishT, page.AreaName, page.Content, page.IndustryCarveOutID, page.CooperationTypeName, page.Money, page.ValidateID, page.MerchantNameTotal, Idstuny, page.Pic, IsVip, page.Title, page.Title, page.Title, page.Register);
                this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('添加信息成功!');location.href='CapitalManage.aspx'", true);
            }
            else
            {
                Tz888.Common.MessageBox.Show(this.Page, "更新联系方式失败!");
            }
        }
        else
        {
            Tz888.Common.MessageBox.Show(this.Page, "发布失败!");
        }
    }
    protected void btnSubmit_ServerClick(object sender, EventArgs e)
    {
        try//验证验证码

        {
            if (Session["valationNo"] == null || ImageCode.Text.ToUpper().Trim() != Session["valationNo"].ToString().ToUpper().Trim() || Session["valationNo"].ToString().Trim() == "")
            {
                Tz888.Common.MessageBox.Show(this.Page, "验证码错误!");
                return;
            }
        }
        catch
        {
            Tz888.Common.MessageBox.Show(this.Page, "未知错误!");
        }
        //20090811 判断权限
        Tz888.BLL.Login.LoginInfoBLL loginbll = new Tz888.BLL.Login.LoginInfoBLL();
        bool yanzheng = loginbll.yanzheng(Page.User.Identity.Name);

        if (!yanzheng)
        {
            Tz888.Common.MessageBox.Show(this.Page, "发布失败,你没有发布信息的权限!\\n可能是你发布违规信息帐户被锁定了。\\n详情请联系客服。");
            return;
        }
        //-----end-

        Tz888.Model.Info.MainInfoModel               mainInfoModel         = new Tz888.Model.Info.MainInfoModel();               //创建主体信息实体
        Tz888.Model.Info.V124.CapitalInfoModel       capitalInfoModel      = new Tz888.Model.Info.V124.CapitalInfoModel();       //创建投资信息实体
        List <Tz888.Model.Info.CapitalInfoAreaModel> capitalInfoAreaModels = new List <Tz888.Model.Info.CapitalInfoAreaModel>(); //投资区域信息实体列表

        Tz888.Model.Info.ShortInfoModel shortInfoModel = new Tz888.Model.Info.ShortInfoModel();                                  //创建短信息实体


        DateTime time_now = DateTime.Now;

        capitalInfoAreaModels = this.ZoneSelect1.CapitalInfoAreaModels;

        #region 投资信息实体赋值

        capitalInfoModel.ComAbout              = Tz888.Common.Utility.PageValidate.TxtToHtml(this.txtCapitalIntent.Value.Trim());
        capitalInfoModel.CapitalTypeID         = this.rblfinancingTarget.SelectedValue;
        capitalInfoModel.CapitalID             = this.rblCurreny.SelectedValue;
        capitalInfoModel.ComBreif              = "";
        capitalInfoModel.CooperationDemandType = "";
        capitalInfoModel.IndustryBID           = this.SelectIndustryControl1.IndustryString;
        capitalInfoModel.stageID      = Convert.ToInt32(this.rblStage.SelectedValue);
        capitalInfoModel.joinManageID = Convert.ToInt32(this.rdlJoinManage.SelectedValue);


        for (int i = 0; chkLstCooperationDemand.Items.Count > i; i++)
        {
            if (chkLstCooperationDemand.Items[i].Selected)
            {
                capitalInfoModel.CooperationDemandType += chkLstCooperationDemand.Items[i].Value + ",";
            }
        }
        #endregion

        if (!string.IsNullOrEmpty(this.txtCapitalName.Text.Trim()))
        {
            mainInfoModel.Title = Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtCapitalName.Text.Trim());
        }

        string CountryCode;
        try
        {
            CountryCode = capitalInfoAreaModels[0].CountryCode;
        }
        catch
        {
            CountryCode = "ALL";
        }
        mainInfoModel.InfoCode = Tz888.BLL.Info.Common.CreateInfoCode("Capital", capitalInfoModel.IndustryBID.Split(',')[0], CountryCode, time_now);
        mainInfoModel.publishT = time_now;
        mainInfoModel.Hit      = 0;

        mainInfoModel.IsCore             = true;
        mainInfoModel.LoginName          = Page.User.Identity.Name; //用户名称
        mainInfoModel.InfoOriginRoleName = "0";                     //用户角色
        mainInfoModel.GradeID            = "0";
        mainInfoModel.FixPriceID         = "1";
        mainInfoModel.FeeStatus          = 0;

        string keyword = "";
        if (!string.IsNullOrEmpty(this.txtKeyword1.Text.Trim()))
        {
            keyword += Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtKeyword1.Text.Trim()) + ",";
        }
        if (!string.IsNullOrEmpty(this.txtKeyword2.Text.Trim()))
        {
            keyword += Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtKeyword2.Text.Trim()) + ",";
        }
        if (!string.IsNullOrEmpty(this.txtKeyword3.Text.Trim()))
        {
            keyword += Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtKeyword3.Text.Trim()) + ",";
        }

        mainInfoModel.KeyWord  = keyword;
        mainInfoModel.Descript = "";
        if (!string.IsNullOrEmpty(this.txtCapitalName.Text.Trim()))
        {
            mainInfoModel.DisplayTitle = Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtCapitalName.Text.Trim());
        }
        mainInfoModel.FrontDisplayTime = time_now;

        mainInfoModel.ValidateStartTime = time_now;
        mainInfoModel.ValidateTerm      = Convert.ToInt32(this.rdlValiditeTerm.SelectedValue.Trim());
        mainInfoModel.TemplateID        = "001";
        mainInfoModel.HtmlFile          = "";

        shortInfoModel.ShortInfoControlID = "CapitalIndex1";
        if (!string.IsNullOrEmpty(this.txtCapitalName.Text.Trim()))
        {
            shortInfoModel.ShortTitle = Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtCapitalName.Text.Trim());
        }
        shortInfoModel.ShortContent = "";
        shortInfoModel.Remark       = "";

        Tz888.BLL.Info.V124.CapitalInfoBLL bll = new Tz888.BLL.Info.V124.CapitalInfoBLL();

        //这里是插入资源投资信息

        long infoID = bll.Insert(mainInfoModel, capitalInfoModel, this.GetInfoContact(), shortInfoModel, capitalInfoAreaModels, null);


        if (infoID > 0)
        {
            bool isTof = Page.User.IsInRole("GT1002");
            if (isTof)
            {
                string HtmlFile = Tz888.BLL.Info.Common.createStaticPageFileName("Capital", mainInfoModel.InfoCode, infoID);
                Tz888.BLL.Info.MainInfoBLL mainBll = new Tz888.BLL.Info.MainInfoBLL();
                Page.Response.Write(infoID.ToString() + HtmlFile.ToString());
                mainBll.HasHtmlFile(infoID, HtmlFile);
                string actionMsg = "";
                Tz888.BLL.PageStatic.CapitalPageStatic staticobj = new Tz888.BLL.PageStatic.CapitalPageStatic();
                staticobj.CreateStaticPageCapital(infoID.ToString(), ref actionMsg);
            }
            Response.Redirect("publishCapital_step2.aspx?code=" + Tz888.Common.DEncrypt.DESEncrypt.Encrypt(infoID.ToString() + "|Capital|" + this.txtCapitalName.Text.Trim() + "|" + txtGovName.Text.Trim()));
        }
        else
        {
            Tz888.Common.MessageBox.Show(this.Page, "发布失败!");
        }
    }
    protected void IbtnSubmit_Click(object sender, EventArgs e)
    {
        //20090811 判断权限
        Tz888.BLL.Login.LoginInfoBLL loginbll = new Tz888.BLL.Login.LoginInfoBLL();
        bool yanzheng = loginbll.yanzheng(fz_LoginName);

        if (!yanzheng)
        {
            Tz888.Common.MessageBox.Show(this.Page, "发布失败,你没有发布信息的权限!\\n可能是你发布违规信息帐户被锁定了。\\n详情请联系客服。");
            return;
        }
        //-----end--



        //获取投资资源的信息
        Tz888.Model.Info.MainInfoModel         mainInfoModel    = new Tz888.Model.Info.MainInfoModel();                          //创建主体信息实体
        Tz888.Model.Info.V124.CapitalInfoModel capitalInfoModel = new Tz888.Model.Info.V124.CapitalInfoModel();                  //创建投资信息实体

        Tz888.Model.Info.InfoContactModel infoContactModel = new Tz888.Model.Info.InfoContactModel();                            //创建信息联系方式主体

        List <Tz888.Model.Info.CapitalInfoAreaModel> capitalInfoAreaModels = new List <Tz888.Model.Info.CapitalInfoAreaModel>(); //投资区域信息实体列表

        Tz888.Model.Info.ShortInfoModel shortInfoModel = new Tz888.Model.Info.ShortInfoModel();                                  //创建短信息实体
        //以下是文件上传的实体声明
        List <Tz888.Model.Info.InfoResourceModel> infoResourceModels = new List <Tz888.Model.Info.InfoResourceModel>();

        DateTime time_now = DateTime.Now;

        //拟投向区域
        capitalInfoAreaModels = this.ZoneSelect1.CapitalInfoAreaModels;

        //主体信息实体付值
        //联系2010-06-29
        infoContactModel = this.CapitalAddressInfo1.InfoContact;

        #region 投资信息实体赋值

        //投资意向详细说明
        capitalInfoModel.ComAbout = Tz888.Common.Utility.PageValidate.TxtToHtml(this.txtCapitalIntent.Value.Trim());
        //资本类型
        //capitalInfoModel.CapitalTypeID = this.rblfinancingTarget.SelectedValue;
        for (int i = 0; rblfinancingTarget.Items.Count > i; i++)
        {
            if (rblfinancingTarget.Items[i].Selected)
            {
                capitalInfoModel.CapitalTypeID += rblfinancingTarget.Items[i].Value + ",";
            }
        }
        //单项目可投资金额
        capitalInfoModel.CapitalID = this.rblCurreny.SelectedValue;
        //项目介绍提炼
        capitalInfoModel.ComBreif = "";

        capitalInfoModel.CooperationDemandType = "";

        //拟投资行业
        capitalInfoModel.IndustryBID = this.SelectIndustryControl1.IndustryString;
        //投资项目阶段
        //2010-06-23

        capitalInfoModel.stageID = Convert.ToInt32(this.rblStage.SelectedValue);
        // 是否参与项目方管理
        //2010-06-23
        capitalInfoModel.joinManageID = Convert.ToInt32(this.rdlJoinManage.SelectedValue);

        //投资方式
        for (int i = 0; chkLstCooperationDemand.Items.Count > i; i++)
        {
            if (chkLstCooperationDemand.Items[i].Selected)
            {
                capitalInfoModel.CooperationDemandType += chkLstCooperationDemand.Items[i].Value + ",";
            }
        }

        //以下是需要添加的参数
        //注册资金
        capitalInfoModel.RegisteredCapital = this.rblRegisterdollar.SelectedValue;
        //团队规模
        capitalInfoModel.TeamScale = this.rblTeam.SelectedValue;
        //机构年平均投资事件数
        capitalInfoModel.AverageInvestment = this.rblPinJ.SelectedValue;
        //机构成功投资事件总数
        capitalInfoModel.SuccessfulInvestment = this.rblSucess.SelectedValue;
        //投资需求摘要
        capitalInfoModel.InvestmentDemand = Tz888.Common.Utility.PageValidate.TxtToHtml(this.txtDemand.Value.Trim());

        //添加所属区域

        //capitalInfoModel.SCountryID = this.ZoneSelectControl1.CountryID;
        //capitalInfoModel.SProvinceID = this.ZoneSelectControl1.ProvinceID;
        //capitalInfoModel.SCityID = this.ZoneSelectControl1.CityID;
        //capitalInfoModel.SCountyID = this.ZoneSelectControl1.CountyID;
        capitalInfoModel.SCountryID  = "001";
        capitalInfoModel.SProvinceID = "001";
        capitalInfoModel.SCityID     = "001";
        capitalInfoModel.SCountyID   = "001";



        //项目承办单位
        capitalInfoModel.Prorganizers = "no";
        //文件上传的
        infoResourceModels = FilesUploadControl1.InfoList;


        #endregion


        //这里是其他的实体值
        if (!string.IsNullOrEmpty(this.txtCapitalName.Text.Trim()))
        {
            mainInfoModel.Title = Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtCapitalName.Text.Trim());
        }

        string CountryCode;
        try
        {
            CountryCode = capitalInfoAreaModels[0].CountryCode;
        }
        catch
        {
            CountryCode = "ALL";
        }
        mainInfoModel.InfoCode = Tz888.BLL.Info.Common.CreateInfoCode("Capital", capitalInfoModel.IndustryBID.Split(',')[0], CountryCode, time_now);
        mainInfoModel.publishT = time_now;
        mainInfoModel.Hit      = 0;

        mainInfoModel.IsCore = true;
        //mainInfoModel.LoginName = "cxj";

        mainInfoModel.LoginName          = fz_LoginName; //用户名称
        mainInfoModel.InfoOriginRoleName = "0";          //用户角色
        mainInfoModel.GradeID            = "0";
        mainInfoModel.FixPriceID         = "1";
        mainInfoModel.FeeStatus          = 0;

        string keyword = "";
        if (!string.IsNullOrEmpty(this.txtKeyword1.Text.Trim()))
        {
            keyword += Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtKeyword1.Text.Trim()) + ",";
        }
        if (!string.IsNullOrEmpty(this.txtKeyword2.Text.Trim()))
        {
            keyword += Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtKeyword2.Text.Trim()) + ",";
        }
        if (!string.IsNullOrEmpty(this.txtKeyword3.Text.Trim()))
        {
            keyword += Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtKeyword3.Text.Trim()) + ",";
        }

        mainInfoModel.KeyWord  = keyword;
        mainInfoModel.Descript = "";
        if (!string.IsNullOrEmpty(this.txtCapitalName.Text.Trim()))
        {
            mainInfoModel.DisplayTitle = Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtCapitalName.Text.Trim());
        }
        mainInfoModel.FrontDisplayTime  = time_now;
        mainInfoModel.ValidateStartTime = time_now;
        //意向有效期限
        //20100623
        mainInfoModel.ValidateTerm = Convert.ToInt32(this.rdlValiditeTerm.SelectedValue.Trim());

        mainInfoModel.TemplateID = "001";
        mainInfoModel.HtmlFile   = "";

        shortInfoModel.ShortInfoControlID = "CapitalIndex1";
        if (!string.IsNullOrEmpty(this.txtCapitalName.Text.Trim()))
        {
            shortInfoModel.ShortTitle = Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtCapitalName.Text.Trim());
        }
        shortInfoModel.ShortContent = "";
        shortInfoModel.Remark       = "";

        Tz888.BLL.Info.V124.CapitalInfoBLL bll = new Tz888.BLL.Info.V124.CapitalInfoBLL();

        //这里是插入资源投资信息
        //long infoID = bll.Insert(mainInfoModel, capitalInfoModel, this.GetInfoContact(), shortInfoModel, capitalInfoAreaModels, null, infoResourceModels);
        long infoID = bll.Insert(mainInfoModel, capitalInfoModel, infoContactModel, shortInfoModel, capitalInfoAreaModels, infoResourceModels);
        //以下进行图片的插入


        if (infoID > 0)
        {
            // bool isTof = Page.User.IsInRole("GT1002");
            //if (isTof)
            // {
            string HtmlFile = Tz888.BLL.Info.Common.createStaticPageFileName("Capital", mainInfoModel.InfoCode, infoID);
            Tz888.BLL.Info.MainInfoBLL mainBll = new Tz888.BLL.Info.MainInfoBLL();
            Page.Response.Write(infoID.ToString() + HtmlFile.ToString());
            mainBll.HasHtmlFile(infoID, HtmlFile);
            string actionMsg = "";
            Tz888.BLL.PageStatic.CapitalPageStatic staticobj = new Tz888.BLL.PageStatic.CapitalPageStatic();
            staticobj.CreateStaticPageCapital(infoID.ToString(), ref actionMsg);
            // }
            // Response.Redirect("publishCapital_step2.aspx?code=" + Tz888.Common.DEncrypt.DESEncrypt.Encrypt(infoID.ToString() + "|Capital|" + this.txtCapitalName.Text.Trim() + "|" + txtGovName.Text.Trim()));
            Response.Redirect("publishCapital_step2.aspx?code=" + Tz888.Common.DEncrypt.DESEncrypt.Encrypt(infoID.ToString() + "|Capital|" + this.txtCapitalName.Text.Trim() + "|" + "no"));
        }
        else
        {
            Tz888.Common.MessageBox.Show(this.Page, "发布失败!");
        }
    }
    protected void IbtnSubmit_Click(object sender, EventArgs e)
    {
        //if (Session["valationNo"] == null || ImageCode.Text.ToUpper().Trim() != Session["valationNo"].ToString().ToUpper().Trim() || Session["valationNo"].ToString().Trim() == "")
        //{
        //    //Tz888.Common.MessageBox.Show(this.Page, "验证码错误!");
        //    //Page.ClientScript.RegisterStartupScript(this.GetType(), "myKey", "alert('验证码错误!');", false);

        //    Page.ClientScript.RegisterStartupScript(this.GetType(), "myKey", "ValidErr();", true);
        //    return;
        //}
        //20090811 判断权限
        Tz888.BLL.Login.LoginInfoBLL loginbll = new Tz888.BLL.Login.LoginInfoBLL();
        bool yanzheng = loginbll.yanzheng(Page.User.Identity.Name);

        if (!yanzheng)
        {
            Tz888.Common.MessageBox.Show(this.Page, "发布失败,你没有发布信息的权限!\\n可能是你发布违规信息帐户被锁定了。\\n详情请联系客服。");
            return;
        }
        //-----end--



        //获取投资资源的信息
        Tz888.Model.Info.MainInfoModel               mainInfoModel         = new Tz888.Model.Info.MainInfoModel();               //创建主体信息实体
        Tz888.Model.Info.V124.CapitalInfoModel       capitalInfoModel      = new Tz888.Model.Info.V124.CapitalInfoModel();       //创建投资信息实体
        List <Tz888.Model.Info.CapitalInfoAreaModel> capitalInfoAreaModels = new List <Tz888.Model.Info.CapitalInfoAreaModel>(); //投资区域信息实体列表

        Tz888.Model.Info.ShortInfoModel shortInfoModel = new Tz888.Model.Info.ShortInfoModel();                                  //创建短信息实体
        //以下是文件上传的实体声明
        List <Tz888.Model.Info.InfoResourceModel> infoResourceModels = new List <Tz888.Model.Info.InfoResourceModel>();

        DateTime time_now = DateTime.Now;

        //拟投向区域
        capitalInfoAreaModels = this.ZoneSelect1.CapitalInfoAreaModels;

        //主体信息实体付值


        #region 投资信息实体赋值

        //投资意向详细说明
        capitalInfoModel.ComAbout = Tz888.Common.Utility.PageValidate.TxtToHtml(this.txtCapitalIntent.Value.Trim());
        //资本类型
        //capitalInfoModel.CapitalTypeID = this.rblfinancingTarget.SelectedValue;
        //for (int i = 0; rblfinancingTarget.Items.Count > i; i++)
        //{
        //    if (rblfinancingTarget.Items[i].Selected)
        //    {
        //        capitalInfoModel.CapitalTypeID += rblfinancingTarget.Items[i].Value + ",";
        //    }
        //}
        //单项目可投资金额

        capitalInfoModel.CapitalID = this.rblCurreny.SelectedValue;
        //投资回报率
        capitalInfoModel.RegisteredCapital = this.txtHBao.Text.ToString().Trim();
        //项目介绍提炼
        capitalInfoModel.ComBreif = "";

        capitalInfoModel.CooperationDemandType = "";

        //拟投资行业
        capitalInfoModel.IndustryBID = this.SelectIndustryControl1.IndustryString;
        //投资项目阶段
        //2010-06-23

        capitalInfoModel.stageID = Convert.ToInt32(1);//(this.rblStage.SelectedValue);
        // 是否参与项目方管理
        //2010-06-23
        capitalInfoModel.joinManageID = Convert.ToInt32(1); //(this.rdlJoinManage.SelectedValue);

        //投资方式
        for (int i = 0; chkLstCooperationDemand.Items.Count > i; i++)
        {
            if (chkLstCooperationDemand.Items[i].Selected)
            {
                capitalInfoModel.CooperationDemandType += chkLstCooperationDemand.Items[i].Value + ",";
            }
        }

        //以下是需要添加的参数
        //注册资金
        //capitalInfoModel.RegisteredCapital = "";// this.rblRegisterdollar.SelectedValue;
        //团队规模
        capitalInfoModel.TeamScale = "";            // this.rblTeam.SelectedValue;
        //机构年平均投资事件数
        capitalInfoModel.AverageInvestment = "";    // this.rblPinJ.SelectedValue;
        //机构成功投资事件总数
        capitalInfoModel.SuccessfulInvestment = ""; // this.rblSucess.SelectedValue;
        //投资需求摘要
        capitalInfoModel.InvestmentDemand = Tz888.Common.Utility.PageValidate.TxtToHtml("");

        //添加所属区域

        //capitalInfoModel.SCountryID = this.ZoneSelectControl1.CountryID;
        //capitalInfoModel.SProvinceID = this.ZoneSelectControl1.ProvinceID;
        //capitalInfoModel.SCityID = this.ZoneSelectControl1.CityID;
        //capitalInfoModel.SCountyID = this.ZoneSelectControl1.CountyID;
        capitalInfoModel.SCountryID  = "001";
        capitalInfoModel.SProvinceID = "001";
        capitalInfoModel.SCityID     = "001";
        capitalInfoModel.SCountyID   = "001";



        //项目承办单位
        capitalInfoModel.Prorganizers = "no";
        //文件上传的
        infoResourceModels = FilesUploadControl1.InfoList;


        #endregion


        //这里是其他的实体值
        if (!string.IsNullOrEmpty(this.txtCapitalName.Text.Trim()))
        {
            mainInfoModel.Title = Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtCapitalName.Text.Trim());
        }

        string CountryCode;
        try
        {
            CountryCode = capitalInfoAreaModels[0].CountryCode;
        }
        catch
        {
            CountryCode = "ALL";
        }
        mainInfoModel.InfoCode = Tz888.BLL.Info.Common.CreateInfoCode("Capital", capitalInfoModel.IndustryBID.Split(',')[0], CountryCode, time_now);
        mainInfoModel.publishT = time_now;
        mainInfoModel.Hit      = 0;

        mainInfoModel.IsCore = true;
        //mainInfoModel.LoginName = "cxj";

        mainInfoModel.LoginName          = Page.User.Identity.Name; //用户名称
        mainInfoModel.InfoOriginRoleName = "0";                     //用户角色
        mainInfoModel.GradeID            = "0";
        mainInfoModel.FixPriceID         = "1";
        mainInfoModel.FeeStatus          = 0;

        string keyword = "";
        //if (!string.IsNullOrEmpty(this.txtKeyword1.Text.Trim()))
        //    keyword += Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtKeyword1.Text.Trim()) + ",";
        //if (!string.IsNullOrEmpty(this.txtKeyword2.Text.Trim()))
        //    keyword += Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtKeyword2.Text.Trim()) + ",";
        //if (!string.IsNullOrEmpty(this.txtKeyword3.Text.Trim()))
        //    keyword += Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtKeyword3.Text.Trim()) + ",";

        mainInfoModel.KeyWord  = keyword;
        mainInfoModel.Descript = "";
        if (!string.IsNullOrEmpty(this.txtCapitalName.Text.Trim()))
        {
            mainInfoModel.DisplayTitle = Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtCapitalName.Text.Trim());
        }
        mainInfoModel.FrontDisplayTime  = time_now;
        mainInfoModel.ValidateStartTime = time_now;
        //意向有效期限
        //20100623
        mainInfoModel.ValidateTerm = Convert.ToInt32(this.rdlValiditeTerm.SelectedValue.Trim());

        mainInfoModel.TemplateID = "001";
        mainInfoModel.HtmlFile   = "";

        shortInfoModel.ShortInfoControlID = "CapitalIndex1";
        if (!string.IsNullOrEmpty(this.txtCapitalName.Text.Trim()))
        {
            shortInfoModel.ShortTitle = Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtCapitalName.Text.Trim());
        }
        shortInfoModel.ShortContent = "";
        shortInfoModel.Remark       = "";

        Tz888.BLL.Info.V124.CapitalInfoBLL bll = new Tz888.BLL.Info.V124.CapitalInfoBLL();

        //这里是插入资源投资信息
        //long infoID = bll.Insert(mainInfoModel, capitalInfoModel, this.GetInfoContact(), shortInfoModel, capitalInfoAreaModels, null, infoResourceModels);
        long infoID = bll.Insert(mainInfoModel, capitalInfoModel, this.GetInfoContact(), shortInfoModel, capitalInfoAreaModels, infoResourceModels);
        //以下进行图片的插入


        if (infoID > 0)
        {
            bool isTof = Page.User.IsInRole("GT1002");
            if (isTof)
            {
                string HtmlFile = Tz888.BLL.Info.Common.createStaticPageFileName("Capital", mainInfoModel.InfoCode, infoID);
                Tz888.BLL.Info.MainInfoBLL mainBll = new Tz888.BLL.Info.MainInfoBLL();
                Page.Response.Write(infoID.ToString() + HtmlFile.ToString());
                mainBll.HasHtmlFile(infoID, HtmlFile);
                string actionMsg = "";
                Tz888.BLL.PageStatic.CapitalPageStatic staticobj = new Tz888.BLL.PageStatic.CapitalPageStatic();
                staticobj.CreateStaticPageCapital(infoID.ToString(), ref actionMsg);
            }
            long   _infoID = Convert.ToInt64(infoID);
            string title   = Convert.ToString("投资发布");
            Tz888.Model.Info.InfoContactModel infoContactModel = new Tz888.Model.Info.InfoContactModel(); //创建信息联系方式主体

            string email       = this.txtEmail.Text.Trim();
            string telCountry  = this.txtTelCountry.Text.Trim();
            string telZoneCode = this.txtTelZoneCode.Text.Trim();
            string telNumber   = this.txtTelNumber.Text.Trim();
            //注释掉传真
            string faxCountry  = "0";
            string faxZoneCode = "0";
            string faxNumber   = "0";
            string webSite     = this.txtWebSite.Text.Trim();
            string name        = this.txtLinkMan.Text.Trim();
            string mobile      = this.txtMobile.Text.Trim();
            string address     = this.txtAddress.Text.Trim();
            //注释右邮编
            string postCode = "0";

            //以下是职位
            string position = ""; //this.txtPosition.Text.Trim();
            //投资机构名称
            string organizationName = this.txtGovName.Text.Trim();

            // if (ViewState["OrganizationName"] != null)
            // {
            // infoContactModel.OrganizationName = ViewState["OrganizationName"].ToString();
            // }
            infoContactModel.OrganizationName = organizationName;
            infoContactModel.InfoID           = _infoID;
            infoContactModel.Email            = email;
            infoContactModel.WebSite          = webSite;
            infoContactModel.TelCountryCode   = telCountry;
            infoContactModel.TelStateCode     = telZoneCode;
            infoContactModel.TelNum           = telNumber;
            infoContactModel.FaxCountryCode   = faxCountry;
            infoContactModel.FaxStateCode     = faxZoneCode;
            infoContactModel.FaxNum           = faxNumber;
            infoContactModel.Name             = name;
            infoContactModel.Mobile           = mobile;
            infoContactModel.Address          = address;
            infoContactModel.PostCode         = postCode;
            //以下是职位
            infoContactModel.Position = position;

            Tz888.BLL.Info.InfoContact obj = new Tz888.BLL.Info.InfoContact();

            //这里是更新联系信息
            if (obj.Update(infoContactModel))
            {
                Response.Redirect("publishCapital_step3.aspx?code=" + Tz888.Common.DEncrypt.DESEncrypt.Encrypt(_infoID.ToString() + "|Capital|" + title));
            }
            else
            {
                Tz888.Common.MessageBox.Show(this.Page, "更新联系方式失败!");
            }
            //以下是单独将信息完整度分数插入到Captialinfo中

            Tz888.BLL.Info.V124.CapitalInfoBLL InformationIntegrityUpdate = new Tz888.BLL.Info.V124.CapitalInfoBLL();
            InformationIntegrityUpdate.InsertInformationIntegrity(infoContactModel);


            // Response.Redirect("publishCapital_step2.aspx?code=" + Tz888.Common.DEncrypt.DESEncrypt.Encrypt(infoID.ToString() + "|Capital|" + this.txtCapitalName.Text.Trim() + "|" + txtGovName.Text.Trim()));
            // Response.Redirect("publishCapital_step2.aspx?code=" + Tz888.Common.DEncrypt.DESEncrypt.Encrypt(infoID.ToString() + "|Capital|" + this.txtCapitalName.Text.Trim() + "|" + "no"));
        }
        else
        {
            Tz888.Common.MessageBox.Show(this.Page, "发布失败!");
        }
    }