Ejemplo n.º 1
0
    /// <summary>
    /// 修改事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        Tz888.Model.Info.MerchantSetModel model = new Tz888.Model.Info.MerchantSetModel();

        //model.InfoContactModel = this.MerchantInfoAddressInfo1.InfoContact; //用户控件
        //model.InfoContactManModels = this.MerchantInfoAddressInfo1.InfoContactMans;

        #region 招商信息实体
        // model.InfoContactModel.Position=this
        model.MerchantInfoModel.MerchantTypeID    = "";// this.rblMerchantType.SelectedValue;
        model.MerchantInfoModel.CountryCode       = this.ZoneSelectControl1.CountryID;
        model.MerchantInfoModel.ProvinceID        = this.ZoneSelectControl1.ProvinceID;
        model.MerchantInfoModel.CityID            = this.ZoneSelectControl1.CityID;
        model.MerchantInfoModel.CountyID          = this.ZoneSelectControl1.CountyID;
        model.MerchantInfoModel.IndustryClassList = this.SelectIndustryControl1.IndustryString;
        model.MerchantInfoModel.CapitalCurrency   = this.ddlCapitalCurrency.SelectedValue;
        model.MerchantInfoModel.CapitalTotal      = Convert.ToDecimal(this.txtCapitalTotal.Text.Trim());
        model.MerchantInfoModel.MerchantCurrency  = ""; //this.ddlMerchantCurrency.SelectedValue;
        model.MerchantInfoModel.MerchantTotal     = ""; //this.ddlMerchantTotal.SelectedValue;


        //项目现状及规划
        model.MerchantInfoModel.ProjectStatus = "";// txtProjectStatus.Text;
        //项目优势及市场分析
        model.MerchantInfoModel.Market = Tz888.Common.Utility.PageValidate.TxtToHtml("");
        //地方经济指标描述
        model.MerchantInfoModel.EconomicIndicators = Tz888.Common.Utility.PageValidate.TxtToHtml("");
        //投资环境描述
        model.MerchantInfoModel.InvestmentEnvironment = Tz888.Common.Utility.PageValidate.TxtToHtml("");
        //经济效益分析
        model.MerchantInfoModel.Benefit = Tz888.Common.Utility.PageValidate.TxtToHtml("");

        model.MerchantInfoModel.ZoneAbout = Tz888.Common.Utility.PageValidate.TxtToHtml(Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtZoneAbout.Value.ToString()));
        if (ViewState["ZoneAboutBrief"] != null)
        {
            model.MerchantInfoModel.ZoneAboutBrief = ViewState["ZoneAboutBrief"].ToString();
        }
        //if (!string.IsNullOrEmpty(model.MerchantInfoModel.ReceiveOrganization))
        //    this.MerchantInfoAddressInfo1.Undertaker = model.MerchantInfoModel.ReceiveOrganization.Trim();
        //else
        //this.MerchantInfoAddressInfo1.Undertaker = "";
        ViewState["ZoneAboutBrief"] = model.MerchantInfoModel.ZoneAboutBrief;

        model.MerchantInfoModel.CooperationDemandType = "";

        //for (int i = 0; cblCooperationDemandType.Items.Count > i; i++)
        //{
        //    if (cblCooperationDemandType.Items[i].Selected)
        //    {
        //        model.MerchantInfoModel.CooperationDemandType += cblCooperationDemandType.Items[i].Value + ",";
        //    }
        //}
        #endregion
        model.MainInfoModel.InfoID = Convert.ToInt64(this.ViewState["InfoID"]);
        if (!string.IsNullOrEmpty(this.txtMerchantTopic.Text.Trim()))
        {
            model.MainInfoModel.Title = Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtMerchantTopic.Text.Trim());
        }
        model.MainInfoModel.publishT = Convert.ToDateTime(this.ViewState["PublishT"]);

        model.MainInfoModel.LoginName = ""; //用户名称

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

        model.MainInfoModel.KeyWord           = Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(keyword);
        model.MainInfoModel.Descript          = "";
        model.MainInfoModel.DisplayTitle      = Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtMerchantTopic.Text.Trim());
        model.MainInfoModel.FrontDisplayTime  = System.DateTime.Now;
        model.MainInfoModel.ValidateStartTime = System.DateTime.Now;
        //model.MainInfoModel.ValidateTerm = Convert.ToInt32(this.ddlValiditeTerm.SelectedValue.Trim());
        //项目有效期限
        model.MainInfoModel.ValidateTerm = Convert.ToInt32(this.rdlValiditeTerm.SelectedValue.Trim());

        model.MainInfoModel.TemplateID = "001";
        model.MainInfoModel.HtmlFile   = ViewState["HtmlFile"].ToString();

        model.ShortInfoModel.ShortInfoControlID = Convert.ToString(ViewState["ShortInfoControlID"]);
        if (ViewState["ShortTitle"] != null)
        {
            model.ShortInfoModel.ShortTitle = ViewState["ShortTitle"].ToString();
        }
        if (ViewState["ShortContent"] != null)
        {
            model.ShortInfoModel.ShortContent = ViewState["ShortContent"].ToString();
        }

        model.ShortInfoModel.Remark = "";

        model.InfoContactModel.Address          = txtAddress.Text.ToString().Trim();
        model.InfoContactModel.Email            = txtEmail.Text.ToString().Trim();
        model.InfoContactModel.Mobile           = txtMobile.Text.ToString().Trim();
        model.InfoContactModel.OrganizationName = txtCompanyName.Text.ToString().Trim();
        model.InfoContactModel.Name             = txtName.Text.ToString().Trim();
        model.InfoContactModel.TelCountryCode   = txtTelCountry.Text.ToString().Trim();
        model.InfoContactModel.TelStateCode     = txtTelZoneCode.Text.ToString().Trim();
        model.InfoContactModel.TelNum           = txtTelNumber.Text.ToString().Trim();


        List <Tz888.Model.Info.InfoResourceModel> infoResourceModels;
        infoResourceModels = FilesUploadControl1.InfoList;
        //List<Tz888.Model.Info.InfoResourceModel> infoResourceModels = Tz888.Common.InfoResourceManage.ImageTransfer("Image", "Merchant", Tz888.Common.ResourceType.Image, Tz888.Common.ResourceProperty.InfoImage, FilesUploadControl1.InfoList);
        if (infoResourceModels != null)
        {
            model.InfoResourceModels.AddRange(infoResourceModels);
        }

        Tz888.BLL.Info.MarchantInfoBLL bll = new Tz888.BLL.Info.MarchantInfoBLL();
        if (bll.Update(model))
        {
            bool isTof = Page.User.IsInRole("GT1002");
            if (isTof)
            {
                if (string.IsNullOrEmpty(model.MainInfoModel.HtmlFile.Trim()))
                {
                    model.MainInfoModel.HtmlFile = Tz888.BLL.Info.Common.createStaticPageFileName("Merchant", model.MainInfoModel.InfoCode, model.MainInfoModel.InfoID);
                }
                Tz888.BLL.Info.MainInfoBLL mainBll = new Tz888.BLL.Info.MainInfoBLL();
                mainBll.HasHtmlFile(model.MainInfoModel.InfoID, model.MainInfoModel.HtmlFile);
                string actionMsg = "";
                Tz888.BLL.PageStatic.MerchantPageStatic staticobj = new Tz888.BLL.PageStatic.MerchantPageStatic();
                staticobj.CreateStaticPageMerchant(model.MainInfoModel.InfoID.ToString(), ref actionMsg);
            }
            Tz888.Common.MessageBox.ShowAndRedirect(this.Page, "修改信息成功!", "./ResourceManage_Audit.aspx");
        }
        else
        {
            Tz888.Common.MessageBox.ShowAndRedirect(this.Page, "修改信息失败!", "./ResourceManage_Audit.aspx");
        }
    }
Ejemplo n.º 2
0
    protected void btnSend_Click(object sender, EventArgs e)
    {
        Tz888.Model.Info.MerchantSetModel model = new Tz888.Model.Info.MerchantSetModel();

        model.InfoContactModel     = this.MerchantInfoAddressInfo1.InfoContact;
        model.InfoContactManModels = this.MerchantInfoAddressInfo1.InfoContactMans;

        #region 招商信息实体
        model.MerchantInfoModel.MerchantTypeID = this.rblMerchantType.SelectedValue;
        model.MerchantInfoModel.CountryCode    = this.ZoneSelectControl1.CountryID;
        model.MerchantInfoModel.ProvinceID     = this.ZoneSelectControl1.ProvinceID;
        model.MerchantInfoModel.CityID         = this.ZoneSelectControl1.CityID;
        model.MerchantInfoModel.CountyID       = this.ZoneSelectControl1.CountyID;

        model.MerchantInfoModel.IndustryClassList = this.SelectIndustryControl1.IndustryString;
        model.MerchantInfoModel.CapitalCurrency   = this.ddlCapitalCurrency.SelectedValue;
        try
        {
            model.MerchantInfoModel.CapitalTotal = Convert.ToDecimal(this.txtCapitalTotal.Text.Trim());
        }
        catch
        {
            model.MerchantInfoModel.CapitalTotal = 0;
        }
        model.MerchantInfoModel.MerchantCurrency = this.ddlMerchantCurrency.SelectedValue;
        model.MerchantInfoModel.MerchantTotal    = this.ddlMerchantTotal.SelectedValue;
        model.MerchantInfoModel.ZoneAbout        = Tz888.Common.Utility.PageValidate.TxtToHtml(this.txtZoneAbout.Value.ToString());
        model.MerchantInfoModel.ZoneAboutBrief   = Tz888.Common.Utility.PageValidate.TxtToHtml(this.txtZoneAboutBrf.Value.Trim());
        try
        {
            model.MerchantInfoModel.ReceiveOrganization = this.MerchantInfoAddressInfo1.Undertaker.Trim();
        }
        catch {}

        model.MerchantInfoModel.CooperationDemandType = "";

        for (int i = 0; cblCooperationDemandType.Items.Count > i; i++)
        {
            if (cblCooperationDemandType.Items[i].Selected)
            {
                model.MerchantInfoModel.CooperationDemandType += cblCooperationDemandType.Items[i].Value + ",";
            }
        }

        #endregion

        model.MainInfoModel.InfoID = Convert.ToInt64(this.ViewState["InfoID"]);
        if (!string.IsNullOrEmpty(this.txtMerchantTopic.Text.Trim()))
        {
            model.MainInfoModel.Title = this.txtMerchantTopic.Text.Trim();
        }
        model.MainInfoModel.publishT = Convert.ToDateTime(this.ViewState["PublishT"]);

        model.MainInfoModel.LoginName = ViewState["UserName"].ToString();

        model.MainInfoModel.ApproveTime = DateTime.Now;
        model.MainInfoModel.ApproveBy   = Session["loginName"].ToString();

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

        model.MainInfoModel.KeyWord           = keyword;
        model.MainInfoModel.Descript          = this.txtDescript.Text.Trim();
        model.MainInfoModel.DisplayTitle      = this.txtDisplayTitle.Text.Trim();
        model.MainInfoModel.FrontDisplayTime  = Convert.ToDateTime(ViewState["FrontDisplayTime"]);
        model.MainInfoModel.ValidateStartTime = Convert.ToDateTime(ViewState["ValidateStartTime"]);
        model.MainInfoModel.ValidateTerm      = Convert.ToInt32(this.ddlValiditeTerm.SelectedValue.Trim());
        model.MainInfoModel.TemplateID        = "001";
        model.MainInfoModel.HtmlFile          = ViewState["HtmlFile"].ToString();

        model.ShortInfoModel.ShortInfoControlID = Convert.ToString(ViewState["ShortInfoControlID"]);
        model.ShortInfoModel.ShortTitle         = this.txtShortTitle.Text.Trim();

        model.ShortInfoModel.ShortContent = this.txtShortContent.Text.Trim();
        model.ShortInfoModel.Remark       = "";

        byte AuditingOrigin = Convert.ToByte(ViewState["AuditingStatus"]);
        byte AuditingStatus = 0;

        if (this.rdAudit.Checked)
        {
            AuditingStatus = 0;
        }
        if (this.rdPass.Checked)
        {
            AuditingStatus = 1;
        }
        if (this.rdNopass.Checked)
        {
            AuditingStatus = 2;
        }

        model.MainInfoModel.AuditingStatus = AuditingStatus;

        List <Tz888.Model.Info.InfoResourceModel> infoResourceModels = Tz888.Common.InfoResourceManage.ImageTransfer("Image", "Merchant", Tz888.Common.ResourceType.Image, Tz888.Common.ResourceProperty.InfoImage, ImageUploadControl1.InfoList);
        if (infoResourceModels != null)
        {
            model.InfoResourceModels.AddRange(infoResourceModels);
        }

        string actionMsg   = "";
        string InfoCode    = ViewState["InfoCode"].ToString();
        string strHtmlFile = ViewState["HtmlFile"].ToString();
        bool   IsSuccess;
        long   InfoID  = Convert.ToInt64(ViewState["InfoID"]);
        bool   HasDone = false;
        bool   AllHasDone;

        Tz888.BLL.Info.MarchantInfoBLL merchantBll = new Tz888.BLL.Info.MarchantInfoBLL();
        Tz888.BLL.Info.MainInfoBLL     mainBll     = new Tz888.BLL.Info.MainInfoBLL();

        AllHasDone = merchantBll.Update(model);

        #region 定价
        HasDone = mainBll.HasFixPrice(InfoID, "1", Session["loginName"].ToString());
        if (!HasDone)
        {
            AllHasDone = false;//修改失败
        }
        #endregion

        #region 审核

        string AuditingRemark = "";


        Tz888.Model.Info.InfoAuditModel auditModel = new Tz888.Model.Info.InfoAuditModel();

        switch (AuditingOrigin)
        {
        case 0:
            switch (AuditingStatus)
            {
            case 0:
                break;

            case 1:
                AuditingRemark = "未审核->审核通过";

                #region 写入操作记录
                //需要生成文件
                strHtmlFile = Tz888.BLL.Info.Common.createStaticPageFileName(theInfoType, InfoCode, InfoID);
                //更改审核状态,同时记录操作
                HasDone = mainBll.HasAuditing(InfoID, AuditingStatus, true, Convert.ToInt32(this.tbHits.Text.Trim()), model.MainInfoModel.LoginName,
                                              AuditingRemark, strHtmlFile, "", 0, 0);

                if (!HasDone)
                {
                    AllHasDone = false;
                }
                #endregion

                #region 写入信息审核记录
                auditModel                = new Tz888.Model.Info.InfoAuditModel();
                auditModel.InfoID         = model.MainInfoModel.InfoID;
                auditModel.InfoTypeID     = theInfoType;
                auditModel.LoginName      = model.MainInfoModel.LoginName;
                auditModel.PostDate       = System.DateTime.Now;
                auditModel.Title          = model.MainInfoModel.Title;
                auditModel.FeedbackStatus = 0;         //0,可修改|1,即将删除
                auditModel.FeedBackNote   = "";
                auditModel.AuditStatus    = AuditingStatus;
                auditModel.AuditingDate   = System.DateTime.Now;
                auditModel.AuditingBy     = Session["LoginName"].ToString();
                auditModel.AuditingRemark = AuditingRemark;
                auditModel.Memo           = "";
                HasDone = mainBll.InfoAuditNote(auditModel);
                #endregion

                #region 生成静态化文件
                Tz888.BLL.PageStatic.MerchantPageStatic staticobj = new Tz888.BLL.PageStatic.MerchantPageStatic();
                IsSuccess = staticobj.CreateStaticPageMerchant(model.MainInfoModel.InfoID.ToString(), ref actionMsg);
                //if (!IsSuccess)
                //    AllHasDone = false;
                #endregion

                break;

            case 2:
                AuditingRemark = "未审核->审核未通过";

                #region 写入操作记录
                HasDone = mainBll.HasAuditing(InfoID, AuditingStatus, true, Convert.ToInt32(this.tbHits.Text.Trim()), model.MainInfoModel.LoginName,
                                              AuditingRemark, "", "", 0, 0);

                if (!HasDone)
                {
                    AllHasDone = false;
                }

                #endregion

                #region 写入信息审核记录
                auditModel                = new Tz888.Model.Info.InfoAuditModel();
                auditModel.InfoID         = model.MainInfoModel.InfoID;
                auditModel.InfoTypeID     = theInfoType;
                auditModel.LoginName      = model.MainInfoModel.LoginName;
                auditModel.PostDate       = System.DateTime.Now;
                auditModel.Title          = model.MainInfoModel.Title;
                auditModel.FeedbackStatus = Convert.ToInt32(this.rblFeedbackStatus.SelectedValue.Trim());
                auditModel.FeedBackNote   = this.tbAuditingRemark.Text.Trim();
                auditModel.AuditStatus    = AuditingStatus;
                auditModel.AuditingDate   = System.DateTime.Now;
                auditModel.AuditingBy     = Session["LoginName"].ToString();
                auditModel.AuditingRemark = AuditingRemark;
                auditModel.Memo           = "";
                HasDone = mainBll.InfoAuditNote(auditModel);

                if (!HasDone)
                {
                    AllHasDone = false;
                }
                #endregion

                break;

            default:
                break;
            }
            break;

        case 1:
            switch (AuditingStatus)
            {
            case 0:
                AuditingRemark = "审核通过->未审核";

                #region 写入操作记录
                //更改审核状态,同时记录操作
                HasDone = mainBll.HasAuditing(InfoID, AuditingStatus, true, Convert.ToInt32(this.tbHits.Text.Trim()), model.MainInfoModel.LoginName,
                                              AuditingRemark, "", "", 0, 0);
                if (!HasDone)
                {
                    AllHasDone = false;
                }
                #endregion

                #region 写入信息审核记录
                auditModel                = new Tz888.Model.Info.InfoAuditModel();
                auditModel.InfoID         = model.MainInfoModel.InfoID;
                auditModel.InfoTypeID     = theInfoType;
                auditModel.LoginName      = model.MainInfoModel.LoginName;
                auditModel.PostDate       = System.DateTime.Now;
                auditModel.Title          = model.MainInfoModel.Title;
                auditModel.FeedbackStatus = 0;
                auditModel.FeedBackNote   = "";
                auditModel.AuditStatus    = AuditingStatus;
                auditModel.AuditingDate   = System.DateTime.Now;
                auditModel.AuditingBy     = Session["LoginName"].ToString();
                auditModel.AuditingRemark = AuditingRemark;
                auditModel.Memo           = "";
                HasDone = mainBll.InfoAuditNote(auditModel);

                if (!HasDone)
                {
                    AllHasDone = false;
                }
                #endregion

                #region  除已生成的文件

                //删除静态化文件

                #endregion

                break;

            case 1:
                #region 生成静态化文件
                Tz888.BLL.PageStatic.MerchantPageStatic staticobj = new Tz888.BLL.PageStatic.MerchantPageStatic();
                IsSuccess = staticobj.CreateStaticPageMerchant(model.MainInfoModel.InfoID.ToString(), ref actionMsg);
                //if (!IsSuccess)
                //    AllHasDone = false;
                #endregion
                break;

            case 2:
                AuditingRemark = "审核通过->审核未通过";

                #region 写入操作记录
                //更改审核状态,同时记录操作
                HasDone = mainBll.HasAuditing(InfoID, AuditingStatus, true, Convert.ToInt32(this.tbHits.Text.Trim()), model.MainInfoModel.LoginName,
                                              AuditingRemark, "", "", 0, 0);
                if (!HasDone)
                {
                    AllHasDone = false;
                }
                #endregion

                #region 写入信息审核记录
                auditModel                = new Tz888.Model.Info.InfoAuditModel();
                auditModel.InfoID         = model.MainInfoModel.InfoID;
                auditModel.InfoTypeID     = theInfoType;
                auditModel.LoginName      = model.MainInfoModel.LoginName;
                auditModel.PostDate       = System.DateTime.Now;
                auditModel.Title          = model.MainInfoModel.Title;
                auditModel.FeedbackStatus = Convert.ToInt32(this.rblFeedbackStatus.SelectedValue.Trim());
                auditModel.FeedBackNote   = this.tbAuditingRemark.Text.Trim();
                auditModel.AuditStatus    = AuditingStatus;
                auditModel.AuditingDate   = System.DateTime.Now;
                auditModel.AuditingBy     = Session["LoginName"].ToString();
                auditModel.AuditingRemark = AuditingRemark;
                auditModel.Memo           = "";
                HasDone = mainBll.InfoAuditNote(auditModel);

                if (!HasDone)
                {
                    AllHasDone = false;
                }
                #endregion

                #region  除已生成的文件

                //删除静态化文件

                #endregion

                break;

            default:
                break;
            }
            break;

        case 2:
            switch (AuditingOrigin)
            {
            case 0:
                AuditingRemark = "审核未通过->未审核";

                #region 写入操作记录
                HasDone = mainBll.HasAuditing(InfoID, AuditingStatus, true, Convert.ToInt32(this.tbHits.Text.Trim()), model.MainInfoModel.LoginName,
                                              AuditingRemark, "", "", 0, 0);

                if (!HasDone)
                {
                    AllHasDone = false;
                }
                #endregion

                #region 写入信息审核记录
                auditModel                = new Tz888.Model.Info.InfoAuditModel();
                auditModel.InfoID         = model.MainInfoModel.InfoID;
                auditModel.InfoTypeID     = theInfoType;
                auditModel.LoginName      = model.MainInfoModel.LoginName;
                auditModel.PostDate       = System.DateTime.Now;
                auditModel.Title          = model.MainInfoModel.Title;
                auditModel.FeedbackStatus = 0;
                auditModel.FeedBackNote   = "";
                auditModel.AuditStatus    = AuditingStatus;
                auditModel.AuditingDate   = System.DateTime.Now;
                auditModel.AuditingBy     = Session["LoginName"].ToString();
                auditModel.AuditingRemark = AuditingRemark;
                auditModel.Memo           = "";
                HasDone = mainBll.InfoAuditNote(auditModel);

                if (!HasDone)
                {
                    AllHasDone = false;
                }
                #endregion

                break;

            case 1:
                AuditingRemark = "审核未通过->审核通过";

                #region 写入操作记录
                strHtmlFile = Tz888.BLL.Info.Common.createStaticPageFileName(theInfoType, InfoCode, InfoID);

                HasDone = mainBll.HasAuditing(InfoID, AuditingStatus, true, Convert.ToInt32(this.tbHits.Text.Trim()), model.MainInfoModel.LoginName,
                                              AuditingRemark, strHtmlFile, "", 0, 0);

                if (!HasDone)
                {
                    AllHasDone = false;
                }
                #endregion

                #region 写入信息审核记录
                auditModel                = new Tz888.Model.Info.InfoAuditModel();
                auditModel.InfoID         = model.MainInfoModel.InfoID;
                auditModel.InfoTypeID     = theInfoType;
                auditModel.LoginName      = model.MainInfoModel.LoginName;
                auditModel.PostDate       = System.DateTime.Now;
                auditModel.Title          = model.MainInfoModel.Title;
                auditModel.FeedbackStatus = 0;
                auditModel.FeedBackNote   = "";
                auditModel.AuditStatus    = AuditingStatus;
                auditModel.AuditingDate   = System.DateTime.Now;
                auditModel.AuditingBy     = Session["LoginName"].ToString();
                auditModel.AuditingRemark = AuditingRemark;
                auditModel.Memo           = "";
                HasDone = mainBll.InfoAuditNote(auditModel);

                if (!HasDone)
                {
                    AllHasDone = false;
                }
                #endregion

                #region 生成静态化文件
                Tz888.BLL.PageStatic.MerchantPageStatic staticobj = new Tz888.BLL.PageStatic.MerchantPageStatic();
                IsSuccess = staticobj.CreateStaticPageMerchant(model.MainInfoModel.InfoID.ToString(), ref actionMsg);

                //if (!IsSuccess)
                //    AllHasDone = false;
                #endregion

                break;

            case 2:
                break;

            default:
                break;
            }
            break;

        default:
            break;
        }

        #endregion

        #region 邮件通知

        #endregion

        if (AllHasDone)
        {
            string theUrlReferrer = ViewState["strPrePage"].ToString();
            Response.Redirect("ModifyStatus.aspx?InfoID=" + InfoID.ToString() + "&Type=" + theInfoType + "&PrePage=" + theUrlReferrer + "&msg=" + actionMsg);
        }
        else
        {
            Response.Write("<script>alert('变更失败!');history.back(-1);</script>");
        }
    }
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        Tz888.Model.Info.MerchantSetModel model = new Tz888.Model.Info.MerchantSetModel();

        model.InfoContactModel = this.MerchantInfoAddressInfo1.InfoContact;
        //  model.InfoContactManModels = this.MerchantInfoAddressInfo1.InfoContactMans;

        #region 招商信息实体
        model.MerchantInfoModel.MerchantTypeID = this.rblMerchantType.SelectedValue;
        model.MerchantInfoModel.CountryCode    = this.ZoneSelectControl1.CountryID;
        model.MerchantInfoModel.ProvinceID     = this.ZoneSelectControl1.ProvinceID;
        model.MerchantInfoModel.CityID         = this.ZoneSelectControl1.CityID;
        model.MerchantInfoModel.CountyID       = this.ZoneSelectControl1.CountyID;

        model.MerchantInfoModel.IndustryClassList = this.SelectIndustryControl1.IndustryString;
        model.MerchantInfoModel.CapitalCurrency   = this.ddlCapitalCurrency.SelectedValue;
        model.MerchantInfoModel.CapitalTotal      = Convert.ToDecimal(this.txtCapitalTotal.Text.Trim());
        model.MerchantInfoModel.MerchantCurrency  = this.ddlMerchantCurrency.SelectedValue;
        model.MerchantInfoModel.MerchantTotal     = this.ddlMerchantTotal.SelectedValue;
        model.MerchantInfoModel.ZoneAbout         = this.txtZoneAbout.Value.ToString();
        model.MerchantInfoModel.ZoneAboutBrief    = ViewState["ZoneAboutBrief"].ToString();
        if (MerchantInfoAddressInfo1.Undertaker != null)
        {
            model.MerchantInfoModel.ReceiveOrganization = this.MerchantInfoAddressInfo1.Undertaker.Trim();
        }

        model.MerchantInfoModel.CooperationDemandType = "";

        for (int i = 0; cblCooperationDemandType.Items.Count > i; i++)
        {
            if (cblCooperationDemandType.Items[i].Selected)
            {
                model.MerchantInfoModel.CooperationDemandType += cblCooperationDemandType.Items[i].Value + ",";
            }
        }

        #endregion

        model.MainInfoModel.InfoID = Convert.ToInt64(this.ViewState["InfoID"]);
        if (!string.IsNullOrEmpty(this.txtMerchantTopic.Text.Trim()))
        {
            model.MainInfoModel.Title = this.txtMerchantTopic.Text.Trim();
        }
        model.MainInfoModel.publishT = Convert.ToDateTime(this.ViewState["PublishT"]);

        model.MainInfoModel.LoginName = ""; //用户名称

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

        model.MainInfoModel.KeyWord           = keyword;
        model.MainInfoModel.Descript          = "";
        model.MainInfoModel.DisplayTitle      = this.txtMerchantTopic.Text.Trim();
        model.MainInfoModel.FrontDisplayTime  = System.DateTime.Now;
        model.MainInfoModel.ValidateStartTime = System.DateTime.Now.AddDays(1);
        model.MainInfoModel.ValidateTerm      = Convert.ToInt32(this.ddlValiditeTerm.SelectedValue.Trim());
        model.MainInfoModel.TemplateID        = "001";
        model.MainInfoModel.HtmlFile          = ViewState["HtmlFile"].ToString();

        model.ShortInfoModel.ShortInfoControlID = Convert.ToString(ViewState["ShortInfoControlID"]);
        model.ShortInfoModel.ShortTitle         = ViewState["ShortTitle"].ToString();
        model.ShortInfoModel.ShortContent       = ViewState["ShortContent"].ToString();
        model.ShortInfoModel.Remark             = "";

        List <Tz888.Model.Info.InfoResourceModel> infoResourceModels = Tz888.Common.InfoResourceManage.ImageTransfer("Image", "Merchant", Tz888.Common.ResourceType.Image, Tz888.Common.ResourceProperty.InfoImage, ImageUploadControl1.InfoList);
        if (infoResourceModels != null)
        {
            model.InfoResourceModels.AddRange(infoResourceModels);
        }

        Tz888.BLL.Info.MarchantInfoBLL bll = new Tz888.BLL.Info.MarchantInfoBLL();

        if (bll.Update(model))
        {
            Tz888.Common.MessageBox.ShowAndRedirect(this.Page, "修改信息成功!", Request.Url.ToString());
        }
        else
        {
            Tz888.Common.MessageBox.ShowAndRedirect(this.Page, "修改信息失败!", Request.Url.ToString());
        }
    }