コード例 #1
0
        /// <summary>
        /// 获取一个完整的招商信息实体
        /// </summary>
        /// <param name="InfoID"></param>
        /// <returns></returns>
        public Tz888.Model.Info.MerchantSetModel GetIntegrityModel(long InfoID)
        {
            Tz888.Model.Info.MerchantSetModel model = new MerchantSetModel();

            //获取主要信息
            MainInfoDAL obj1 = new MainInfoDAL();

            model.MainInfoModel = obj1.GetModel(InfoID);

            //获取投资资源个性信息
            model.MerchantInfoModel = this.GetModel(InfoID);

            //获取信息联系方式
            InfoContactDAL obj3 = new InfoContactDAL();

            model.InfoContactModel = obj3.GetModel(InfoID);

            //获取招商信息联系人
            //InfoContactManDAL obj4 = new InfoContactManDAL();
            //model.InfoContactManModels = obj4.GetModelList(InfoID);

            //获取招商信息相关资源
            InfoResourceDAL obj5 = new InfoResourceDAL();

            model.InfoResourceModels = obj5.GetModelList(InfoID);

            //短信息
            ShortInfoDAL obj6 = new ShortInfoDAL();

            model.ShortInfoModel = obj6.GetModel(InfoID);

            return(model);
        }
コード例 #2
0
    public string getInfoResourceById(long infoID)
    {
        string resStr  = "";
        string tempStr = "<li><a href=\"#ResURL\"><div class=\"pic\"><img src=\"/CommonV3/img/res_ad2.gif\" alt=\"#ResType\"></div>#ResTitle</a></li>";

        //string tempStr = "<li>[#ResType]<a href='#ResURL' alt='#ResT2'>#ResTitle</a>——#ResDec</li>";
        Tz888.SQLServerDAL.Info.InfoResourceDAL   bll    = new Tz888.SQLServerDAL.Info.InfoResourceDAL();
        List <Tz888.Model.Info.InfoResourceModel> models = bll.GetModelList(infoID);

        if (models != null)
        {
            foreach (Tz888.Model.Info.InfoResourceModel ResModel in models)
            {
                string temp     = tempStr;
                string restype  = "image";
                string fileName = ResModel.ResourceAddr.Trim();
                if (fileName != "")
                {
                    fileName = "http://images.topfo.com/" + ResModel.ResourceAddr;
                }
                else
                {
                    fileName = "#";
                }
                if (fileName.IndexOf(".doc") > 0 || fileName.IndexOf(".ppt") > 0 || fileName.IndexOf(".pdf") > 0)
                {
                    restype = "file";
                }
                temp = temp.Replace("#ResType", restype == "image" ? "点击查看图片" : "点击下载文件");
                temp = temp.Replace("#ResURL", fileName.Trim());
                //temp = temp.Replace("#ResDec", ResModel.ResourceDescrib);
                temp    = temp.Replace("#ResTitle", ResModel.ResourceTitle);
                resStr += temp;
            }
        }
        if (resStr.Trim() == "")
        {
            resStr = "<li>无相关附件</li>";
        }
        return(resStr);
    }
コード例 #3
0
        /// <summary>
        /// 获取一个完整的投资资源信息实体
        /// </summary>
        /// <param name="InfoID"></param>
        /// <returns></returns>
        public Tz888.Model.Info.CapitalSetModel GetIntegrityModel(long InfoID)
        {
            Tz888.Model.Info.CapitalSetModel model = new CapitalSetModel();

            //获取主要信息
            MainInfoDAL obj1 = new MainInfoDAL();

            model.MainInfoModel = obj1.GetModel(InfoID);

            //获取投资资源个性信息
            model.CapitalInfoModel = this.GetModel(InfoID);

            //获取信息联系方式
            InfoContactDAL obj3 = new InfoContactDAL();

            model.InfoContactModel = obj3.GetModel(InfoID);

            //获取投资信息联系人
            InfoContactManDAL obj4 = new InfoContactManDAL();

            model.InfoContactManModels = obj4.GetModelList(InfoID);

            //获取信息相关资源
            InfoResourceDAL obj5 = new InfoResourceDAL();

            model.InfoResourceModels = obj5.GetModelList(InfoID);

            //获取信息投资区域
            CapitalInfoAreaDAL obj6 = new CapitalInfoAreaDAL();

            model.CapitalInfoAreaModels = obj6.GetModelList(InfoID);

            //短信息
            ShortInfoDAL obj7 = new ShortInfoDAL();

            model.ShortInfoModel = obj7.GetModel(InfoID);

            return(model);
        }
コード例 #4
0
        /// <summary>
        /// 修改投资资源
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool Update(Tz888.Model.Info.CapitalSetModel model)
        {
            SqlParameter[] parameters =
            {
                //主表信息
                new SqlParameter("@InfoID",                SqlDbType.BigInt,           8),
                new SqlParameter("@Title",                 SqlDbType.VarChar,        100),
                new SqlParameter("@publishT",              SqlDbType.DateTime),
                new SqlParameter("@LoginName",             SqlDbType.Char,            10),

                new SqlParameter("@KeyWord",               SqlDbType.VarChar,         50),
                new SqlParameter("@Descript",              SqlDbType.VarChar,        100),
                new SqlParameter("@DisplayTitle",          SqlDbType.VarChar,         50),
                new SqlParameter("@FrontDisplayTime",      SqlDbType.SmallDateTime),
                new SqlParameter("@ValidateStartTime",     SqlDbType.SmallDateTime),
                new SqlParameter("@ValidateTerm",          SqlDbType.Int,              4),
                new SqlParameter("@TemplateID",            SqlDbType.Char,            10),
                //new SqlParameter("@HtmlFile", SqlDbType.VarChar,100),
                new SqlParameter("@AuditingStatus",        SqlDbType.TinyInt,          8),

                //投资资源表信息
                new SqlParameter("@ComAbout",              SqlDbType.VarChar,         -1),
                new SqlParameter("@ComBreif",              SqlDbType.VarChar,         -1),
                new SqlParameter("@IndustryBID",           SqlDbType.Char,            10),
                new SqlParameter("@CooperationDemandType", SqlDbType.Char,            30),
                new SqlParameter("@currency",              SqlDbType.Char,            10),
                new SqlParameter("@CapitalID",             SqlDbType.Char,            10),
                new SqlParameter("@CapitalTypeID",         SqlDbType.Char,            10),

                //联系信息
                new SqlParameter("@ComName",               SqlDbType.VarChar,        100),
                new SqlParameter("@LinkMan",               SqlDbType.VarChar,         20),
                new SqlParameter("@TelCountryCode",        SqlDbType.Char,             6),
                new SqlParameter("@TelStateCode",          SqlDbType.Char,             8),
                new SqlParameter("@TelNum",                SqlDbType.VarChar,        100),
                new SqlParameter("@FaxCountryCode",        SqlDbType.Char,             6),
                new SqlParameter("@FaxStateCode",          SqlDbType.Char,             8),
                new SqlParameter("@FaxNum",                SqlDbType.VarChar,        100),
                new SqlParameter("@Mobile",                SqlDbType.VarChar,         30),
                new SqlParameter("@Address",               SqlDbType.VarChar,        100),
                new SqlParameter("@PostCode",              SqlDbType.VarChar,         10),
                new SqlParameter("@Email",                 SqlDbType.VarChar,         50),
                new SqlParameter("@WebSite",               SqlDbType.VarChar,        200),

                //短信息
                new SqlParameter("@ShortInfoControlID",    SqlDbType.Char,            20),
                new SqlParameter("@ShortTitle",            SqlDbType.VarChar,        100),
                new SqlParameter("@ShortContent",          SqlDbType.VarChar,        100),
                new SqlParameter("@strRemark",             SqlDbType.VarChar,         50),
                new SqlParameter("@IsVip",                 SqlDbType.Int),

                //投资资源表信息 2010-7-7修改
                new SqlParameter("@RegisteredCapital",     SqlDbType.Char,            30),
                new SqlParameter("@TeamScale",             SqlDbType.Char,            30),
                new SqlParameter("@AverageInvestment",     SqlDbType.Char,            30),
                new SqlParameter("@SuccessfulInvestment",  SqlDbType.Char,            30),
                new SqlParameter("@InvestmentDemand",      SqlDbType.VarChar,        100),
                new SqlParameter("@Prorganizers",          SqlDbType.VarChar,        100),
                new SqlParameter("@CountryID",             SqlDbType.Char,            30),
                new SqlParameter("@ProvinceID",            SqlDbType.Char,            30),
                new SqlParameter("@CityID",                SqlDbType.Char,            30),
                new SqlParameter("@CountyID",              SqlDbType.Char,            30),
                new SqlParameter("@Position",              SqlDbType.VarChar, 50)
            };
            parameters[0].Value = model.MainInfoModel.InfoID;
            parameters[1].Value = model.MainInfoModel.Title;
            parameters[2].Value = model.MainInfoModel.publishT;
            parameters[3].Value = model.MainInfoModel.LoginName;

            parameters[4].Value  = model.MainInfoModel.KeyWord;
            parameters[5].Value  = model.MainInfoModel.Descript;
            parameters[6].Value  = model.MainInfoModel.DisplayTitle;
            parameters[7].Value  = model.MainInfoModel.FrontDisplayTime;
            parameters[8].Value  = model.MainInfoModel.ValidateStartTime;
            parameters[9].Value  = model.MainInfoModel.ValidateTerm;
            parameters[10].Value = model.MainInfoModel.TemplateID;
            //parameters[11].Value = model.MainInfoModel.HtmlFile;
            parameters[11].Value = model.MainInfoModel.AuditingStatus;

            parameters[12].Value = model.CapitalInfoModel.ComAbout;
            parameters[13].Value = model.CapitalInfoModel.ComBreif;
            parameters[14].Value = model.CapitalInfoModel.IndustryBID;
            parameters[15].Value = model.CapitalInfoModel.CooperationDemandType;
            parameters[16].Value = model.CapitalInfoModel.Currency;
            parameters[17].Value = model.CapitalInfoModel.CapitalID;
            parameters[18].Value = model.CapitalInfoModel.CapitalTypeID;

            parameters[19].Value = model.InfoContactModel.OrganizationName;
            parameters[20].Value = model.InfoContactModel.Name;
            parameters[21].Value = model.InfoContactModel.TelCountryCode;
            parameters[22].Value = model.InfoContactModel.TelStateCode;
            parameters[23].Value = model.InfoContactModel.TelNum;
            parameters[24].Value = model.InfoContactModel.FaxCountryCode;
            parameters[25].Value = model.InfoContactModel.FaxStateCode;
            parameters[26].Value = model.InfoContactModel.FaxNum;
            parameters[27].Value = model.InfoContactModel.Mobile;
            parameters[28].Value = model.InfoContactModel.Address;
            parameters[29].Value = model.InfoContactModel.PostCode;
            parameters[30].Value = model.InfoContactModel.Email;
            parameters[31].Value = model.InfoContactModel.WebSite;

            parameters[32].Value = model.ShortInfoModel.ShortInfoControlID;
            parameters[33].Value = model.ShortInfoModel.ShortTitle;
            parameters[34].Value = model.ShortInfoModel.ShortContent;
            parameters[35].Value = model.ShortInfoModel.Remark;
            parameters[36].Value = model.CapitalInfoModel.IsVip;

            parameters[37].Value = model.CapitalInfoModel.RegisteredCapital;
            parameters[38].Value = model.CapitalInfoModel.TeamScale;
            parameters[39].Value = model.CapitalInfoModel.AverageInvestment;
            parameters[40].Value = model.CapitalInfoModel.SuccessfulInvestment;
            parameters[41].Value = model.CapitalInfoModel.InvestmentDemand;
            parameters[42].Value = model.CapitalInfoModel.Prorganizers;
            parameters[43].Value = model.CapitalInfoModel.SCountryID;
            parameters[44].Value = model.CapitalInfoModel.SProvinceID;
            parameters[45].Value = model.CapitalInfoModel.SCityID;
            parameters[46].Value = model.CapitalInfoModel.SCountyID;
            parameters[47].Value = model.InfoContactModel.Position;

            bool ReturnValue = false;
            long infoID      = model.MainInfoModel.InfoID;

            using (SqlConnection sqlConn = DbHelperSQL.GetSqlConnection())
            {
                sqlConn.Open();
                SqlTransaction sqlTran = sqlConn.BeginTransaction();
                try
                {
                    int rowsAffected;
                    //插入投资资源信息
                    DbHelperSQL.RunProcedure(sqlConn, sqlTran, "CapitalInfoTab_Update", parameters, out rowsAffected);

                    string countrycode = "";
                    string ProvinceID  = "";
                    string CityID      = "";
                    string countyID    = "";

                    //为投资资源更新投资区域信息
                    Tz888.SQLServerDAL.Info.CapitalInfoAreaDAL obj1 = new CapitalInfoAreaDAL();
                    obj1.DeleteByInfoID(sqlConn, sqlTran, infoID);
                    if (model.CapitalInfoAreaModels != null)
                    {
                        foreach (Tz888.Model.Info.CapitalInfoAreaModel tmpModel in model.CapitalInfoAreaModels)
                        {
                            tmpModel.InfoID = infoID;
                            obj1.Insert(sqlConn, sqlTran, tmpModel);

                            if (!string.IsNullOrEmpty(tmpModel.CountryCode))
                            {
                                countrycode += tmpModel.CountryCode.Trim() + ",";
                            }
                            if (!string.IsNullOrEmpty(tmpModel.ProvinceID))
                            {
                                ProvinceID += tmpModel.ProvinceID.Trim() + ",";
                            }
                            if (!string.IsNullOrEmpty(tmpModel.CityID))
                            {
                                CityID += tmpModel.CityID.Trim() + ",";
                            }
                            if (!string.IsNullOrEmpty(tmpModel.CountyID))
                            {
                                countyID += tmpModel.CountyID.Trim() + ",";
                            }
                        }
                    }

                    //为投资资源更新联系人信息
                    Tz888.SQLServerDAL.Info.InfoContactManDAL obj2 = new InfoContactManDAL();
                    obj2.DeleteByInfoID(sqlConn, sqlTran, infoID);
                    if (model.InfoContactManModels != null)
                    {
                        foreach (Tz888.Model.Info.InfoContactManModel tmpModel in model.InfoContactManModels)
                        {
                            tmpModel.InfoID = infoID;
                            obj2.InsertContactMan(sqlConn, sqlTran, tmpModel);
                        }
                    }

                    //为投资信息添加多个资源
                    Tz888.SQLServerDAL.Info.InfoResourceDAL obj3 = new InfoResourceDAL();
                    obj3.DeleteByInfoID(sqlConn, sqlTran, infoID);
                    if (model.InfoResourceModels != null)
                    {
                        foreach (Tz888.Model.Info.InfoResourceModel tmpModel in model.InfoResourceModels)
                        {
                            tmpModel.InfoID = infoID;
                            obj3.InsertInfoResource(sqlConn, sqlTran, tmpModel);
                        }
                    }
                    ReturnValue = true;

                    //序列化投资区域信息
                    this.CapitalInfoAreaQuery(infoID, countrycode, ProvinceID, CityID, countyID);

                    sqlTran.Commit();
                }
                catch
                {
                    sqlTran.Rollback();
                    ReturnValue = false;
                }
                finally
                {
                    sqlConn.Close();
                }
            }
            return(ReturnValue);
        }
コード例 #5
0
        public long Insert(
            Tz888.Model.Info.MainInfoModel mainInfoModel,
            Tz888.Model.Info.CapitalInfoModel capitalInfoModel,
            Tz888.Model.Info.InfoContactModel infoContactModel,
            Tz888.Model.Info.ShortInfoModel shortInfoModel,
            List <Tz888.Model.Info.CapitalInfoAreaModel> capitalInfoAreaModels,
            // List<Tz888.Model.Info.InfoContactManModel> infoContactManModels,
            List <Tz888.Model.Info.InfoResourceModel> infoResourceModels
            )
        {
            SqlParameter[] parameters =
            {
                //---------------------资源信息主体----------------------
                new SqlParameter("@InfoID",                  SqlDbType.BigInt,           8),
                new SqlParameter("@Title",                   SqlDbType.VarChar,        100),
                new SqlParameter("@InfoCode",                SqlDbType.Char,            30),
                new SqlParameter("@publishT",                SqlDbType.DateTime),
                new SqlParameter("@Hit",                     SqlDbType.BigInt,           8),

                new SqlParameter("@IsCore",                  SqlDbType.Bit,              1),
                new SqlParameter("@IndexOrderNum",           SqlDbType.BigInt,           8),
                new SqlParameter("@IndexTopValidateDate",    SqlDbType.Int,              4),
                new SqlParameter("@IndexPicInfoNum",         SqlDbType.BigInt,           8),
                new SqlParameter("@InfoTypeOrderNum",        SqlDbType.BigInt,           8),
                new SqlParameter("@InfoTypeTopValidateDate", SqlDbType.Int,              4),
                new SqlParameter("@InfoTypePicInfoNum",      SqlDbType.BigInt,           8),
                new SqlParameter("@LoginName",               SqlDbType.Char,            16),
                new SqlParameter("@InfoOriginRoleName",      SqlDbType.Char,            10),
                new SqlParameter("@GradeID",                 SqlDbType.Char,            10),
                new SqlParameter("@FixPriceID",              SqlDbType.Char,            10),

                new SqlParameter("@FeeStatus",               SqlDbType.TinyInt,          1),

                new SqlParameter("@KeyWord",                 SqlDbType.VarChar,         50),
                new SqlParameter("@Descript",                SqlDbType.VarChar,        100),
                new SqlParameter("@DisplayTitle",            SqlDbType.VarChar,         50),
                new SqlParameter("@FrontDisplayTime",        SqlDbType.SmallDateTime),
                new SqlParameter("@ValidateStartTime",       SqlDbType.SmallDateTime),
                new SqlParameter("@ValidateTerm",            SqlDbType.Int,              4),
                new SqlParameter("@TemplateID",              SqlDbType.Char,            10),
                new SqlParameter("@HtmlFile",                SqlDbType.VarChar,        100),

                //---------------------------END---------------------------

                //--------------------投资资源个性信息---------------------

                new SqlParameter("@ComAbout",                SqlDbType.VarChar,         -1),
                new SqlParameter("@ComBreif",                SqlDbType.VarChar,         -1),
                //new SqlParameter("@CountryCode", SqlDbType.Char,10),
                //new SqlParameter("@ProvinceID", SqlDbType.Char,10),
                //new SqlParameter("@CityID", SqlDbType.Char,10),
                //new SqlParameter("@CountyID", SqlDbType.Char,10),
                new SqlParameter("@IndustryBID",             SqlDbType.Char,            10),
                new SqlParameter("@CooperationDemandType",   SqlDbType.Char,            30),
                new SqlParameter("@currency",                SqlDbType.Char,            10),
                new SqlParameter("@CapitalID",               SqlDbType.Char,            10),
                new SqlParameter("@CapitalTypeID",           SqlDbType.Char,            10),

                //---------------------------END---------------------------

                //-----------------------资源联系信息--------------------------

                new SqlParameter("@ComName",                 SqlDbType.VarChar,         40),
                new SqlParameter("@LinkMan",                 SqlDbType.VarChar,         20),
                new SqlParameter("@TelCountryCode",          SqlDbType.Char,             3),
                new SqlParameter("@TelStateCode",            SqlDbType.Char,             4),
                new SqlParameter("@TelNum",                  SqlDbType.VarChar,         60),
                new SqlParameter("@FaxCountryCode",          SqlDbType.Char,             3),
                new SqlParameter("@FaxStateCode",            SqlDbType.Char,             4),
                new SqlParameter("@FaxNum",                  SqlDbType.VarChar,         60),

                new SqlParameter("@Mobile",                  SqlDbType.VarChar,         30),
                new SqlParameter("@Address",                 SqlDbType.VarChar,        100),
                new SqlParameter("@PostCode",                SqlDbType.VarChar,         10),
                new SqlParameter("@Email",                   SqlDbType.VarChar,         50),
                new SqlParameter("@WebSite",                 SqlDbType.VarChar,        200),

                //---------------------------END---------------------------

                //-------------------------短信息--------------------------

                new SqlParameter("@ShortInfoControlID",      SqlDbType.Char,            20),
                new SqlParameter("@ShortTitle",              SqlDbType.VarChar,        100),
                new SqlParameter("@ShortContent",            SqlDbType.VarChar,        100),
                new SqlParameter("@strRemark",               SqlDbType.VarChar,         50),

                //---------------------------END---------------------------
                new SqlParameter("@RegisteredCapital",       SqlDbType.Char,            30),
            };

            parameters[0].Direction = ParameterDirection.Output;
            parameters[1].Value     = mainInfoModel.Title;
            parameters[2].Value     = mainInfoModel.InfoCode;
            parameters[3].Value     = mainInfoModel.publishT;
            parameters[4].Value     = mainInfoModel.Hit;

            parameters[5].Value  = mainInfoModel.IsCore;
            parameters[6].Value  = mainInfoModel.IndexOrderNum;
            parameters[7].Value  = mainInfoModel.IndexTopValidateDate;
            parameters[8].Value  = mainInfoModel.IndexPicInfoNum;
            parameters[9].Value  = mainInfoModel.InfoTypeOrderNum;
            parameters[10].Value = mainInfoModel.InfoTypeTopValidateDate;
            parameters[11].Value = mainInfoModel.InfoTypePicInfoNum;
            parameters[12].Value = mainInfoModel.LoginName;
            parameters[13].Value = mainInfoModel.InfoOriginRoleName;
            parameters[14].Value = mainInfoModel.GradeID;
            parameters[15].Value = mainInfoModel.FixPriceID;
            parameters[16].Value = mainInfoModel.FeeStatus;

            parameters[17].Value = mainInfoModel.KeyWord;
            parameters[18].Value = mainInfoModel.Descript;
            parameters[19].Value = mainInfoModel.DisplayTitle;
            parameters[20].Value = mainInfoModel.FrontDisplayTime;
            parameters[21].Value = mainInfoModel.ValidateStartTime;
            parameters[22].Value = mainInfoModel.ValidateTerm;
            parameters[23].Value = mainInfoModel.TemplateID;
            parameters[24].Value = mainInfoModel.HtmlFile;

            parameters[25].Value = capitalInfoModel.ComAbout;
            parameters[26].Value = capitalInfoModel.ComBreif;
            //parameters[25].Value = capitalInfoModel.CountryCode;
            //parameters[26].Value = capitalInfoModel.ProvinceID;
            //parameters[27].Value = capitalInfoModel.CityID;
            //parameters[28].Value = capitalInfoModel.CountyID;
            parameters[27].Value = capitalInfoModel.IndustryBID;
            parameters[28].Value = capitalInfoModel.CooperationDemandType;
            parameters[29].Value = capitalInfoModel.Currency;
            parameters[30].Value = capitalInfoModel.CapitalID;
            parameters[31].Value = capitalInfoModel.CapitalTypeID;

            parameters[32].Value = infoContactModel.OrganizationName;
            parameters[33].Value = infoContactModel.Name;
            parameters[34].Value = infoContactModel.TelCountryCode;
            parameters[35].Value = infoContactModel.TelStateCode;
            parameters[36].Value = infoContactModel.TelNum;
            parameters[37].Value = infoContactModel.FaxCountryCode;
            parameters[38].Value = infoContactModel.FaxStateCode;
            parameters[39].Value = infoContactModel.FaxNum;
            parameters[40].Value = infoContactModel.Mobile;
            parameters[41].Value = infoContactModel.Address;
            parameters[42].Value = infoContactModel.PostCode;
            parameters[43].Value = infoContactModel.Email;
            parameters[44].Value = infoContactModel.WebSite;

            parameters[45].Value = shortInfoModel.ShortInfoControlID;
            parameters[46].Value = shortInfoModel.ShortTitle;
            parameters[47].Value = shortInfoModel.ShortContent;
            parameters[48].Value = shortInfoModel.Remark;
            parameters[49].Value = capitalInfoModel.IsVip;
            parameters[50].Value = capitalInfoModel.RegisteredCapital;

            int  rowsAffected;
            long infoID;

            using (SqlConnection sqlConn = DbHelperSQL.GetSqlConnection())
            {
                sqlConn.Open();
                SqlTransaction sqlTran = sqlConn.BeginTransaction();
                try
                {
                    //插入投资资源信息
                    DbHelperSQL.RunProcedure(sqlConn, sqlTran, SP_CapitalInfoInfo_Insert, parameters, out rowsAffected);
                    infoID = (long)parameters[0].Value;
                    if (infoID < 0)
                    {
                        throw new Exception();
                    }

                    string countrycode = "";
                    string ProvinceID  = "";
                    string CityID      = "";
                    string countyID    = "";

                    if (capitalInfoAreaModels != null)
                    {
                        //为投资信息添加多个投资区域
                        Tz888.SQLServerDAL.Info.CapitalInfoAreaDAL obj1 = new CapitalInfoAreaDAL();
                        foreach (Tz888.Model.Info.CapitalInfoAreaModel model in capitalInfoAreaModels)
                        {
                            model.InfoID = infoID;
                            obj1.Insert(sqlConn, sqlTran, model);

                            if (!string.IsNullOrEmpty(model.CountryCode))
                            {
                                countrycode += model.CountryCode.Trim() + ",";
                            }
                            if (!string.IsNullOrEmpty(model.ProvinceID))
                            {
                                ProvinceID += model.ProvinceID.Trim() + ",";
                            }
                            if (!string.IsNullOrEmpty(model.CityID))
                            {
                                CityID += model.CityID.Trim() + ",";
                            }
                            if (!string.IsNullOrEmpty(model.CountyID))
                            {
                                countyID += model.CountyID.Trim() + ",";
                            }
                        }

                        //序列化投资区域信息
                        this.CapitalInfoAreaQuery(infoID, countrycode, ProvinceID, CityID, countyID);
                    }

                    //if (infoContactManModels != null)
                    //{
                    //    //为投资资源添加多个联系人
                    //    Tz888.SQLServerDAL.Info.InfoContactManDAL obj2 = new InfoContactManDAL();
                    //    foreach (Tz888.Model.Info.InfoContactManModel model in infoContactManModels)
                    //    {
                    //        model.InfoID = infoID;
                    //        obj2.InsertContactMan(sqlConn, sqlTran, model);
                    //    }
                    //}

                    if (infoResourceModels != null)
                    {
                        //为投资信息添加多个资源
                        Tz888.SQLServerDAL.Info.InfoResourceDAL obj3 = new InfoResourceDAL();
                        foreach (Tz888.Model.Info.InfoResourceModel model in infoResourceModels)
                        {
                            model.InfoID = infoID;
                            obj3.InsertInfoResource(sqlConn, sqlTran, model);
                        }
                    }

                    sqlTran.Commit();
                }
                catch
                {
                    sqlTran.Rollback();
                    infoID = -1;
                }
                finally
                {
                    sqlConn.Close();
                }
            }

            return(infoID);
        }
コード例 #6
0
    protected void BtnOk_Click(object sender, ImageClickEventArgs e)
    {
        Tz888.BLL.Info.ProjectInfoBLL     projectObj       = new Tz888.BLL.Info.ProjectInfoBLL();
        Tz888.Model.Info.MainInfoModel    mainInfoModel    = new Tz888.Model.Info.MainInfoModel();              //创建主体信息实体
        Tz888.Model.Info.ProjectInfoModel projectInfoModel = new Tz888.Model.Info.ProjectInfoModel();           //创建融资信息实体
        Tz888.Model.Info.ShortInfoModel   sortInfoModel    = new Tz888.Model.Info.ShortInfoModel();             //创建短信息实体

        List <Tz888.Model.Common.IndustryModel> industryModels = new List <Tz888.Model.Common.IndustryModel>(); //融资行业实体列表
        DateTime time_Now = DateTime.Now;

        industryModels = this.SelectIndustryControl1.IndustryModels;

        projectInfoModel.CountryCode     = this.ZoneSelectControl1.CountryID;
        projectInfoModel.ProvinceID      = this.ZoneSelectControl1.ProvinceID;
        projectInfoModel.CityID          = this.ZoneSelectControl1.CityID;
        projectInfoModel.CountyID        = this.ZoneSelectControl1.CountyID;
        projectInfoModel.ProjectName     = this.txtProjectName.Value.Trim();
        projectInfoModel.RecTime         = DateTime.Now;
        projectInfoModel.CapitalCurrency = "CNY";
        projectInfoModel.ProjectCurrency = "CNY";

        if (!string.IsNullOrEmpty(this.txtCapitalTotal.Text.Trim()))
        {
            projectInfoModel.CapitalTotal = Convert.ToDecimal(this.txtCapitalTotal.Text.Trim()); //投资总额
        }
        projectInfoModel.CapitalID = this.rbtnCapital.SelectedValue.Trim();                      //融资金额
        //项目说明
        projectInfoModel.ComAbout = Tz888.Common.Utility.PageValidate.TxtToHtml(this.txtProIntro.Value.Trim());
        //行业
        foreach (Tz888.Model.Common.IndustryModel model in industryModels)
        {
            projectInfoModel.IndustryBID += model.IndustryBID + ",";
        }
        projectInfoModel.CooperationDemandType = "10";//股权融资

        projectInfoModel.financingID    = rbtnObj.SelectedValue;
        projectInfoModel.SellStockShare = Convert.ToInt32(txtSellStockShare.Text.Trim()); //出让股份
        string returnmodelid = "";                                                        //退出方式

        for (int i = 0; i < chkReturn.Items.Count; i++)
        {
            if (chkReturn.Items[i].Selected)
            {
                returnmodelid += chkReturn.Items[i].Value + ",";
            }
        }
        projectInfoModel.ReturnModeID = returnmodelid;
        if (rbtnObj.SelectedValue != "")
        {
            projectInfoModel.financingID = rbtnObj.SelectedValue.Trim();//融资对象
        }
        //-----------------------------------主表信息-------------
        if (!string.IsNullOrEmpty(this.txtProjectName.Value))
        {
            mainInfoModel.Title = Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtProjectName.Value);
        }

        mainInfoModel.InfoCode = Tz888.BLL.Info.Common.CreateInfoCode("Project", industryModels[0].IndustryBID, this.ZoneSelectControl1.CountryID, time_Now);
        mainInfoModel.publishT = time_Now;
        mainInfoModel.Hit      = 0;

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

        string keyword = "";

        mainInfoModel.Descript = "";
        if (!string.IsNullOrEmpty(this.txtProjectName.Value.Trim()))
        {
            mainInfoModel.DisplayTitle = Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtProjectName.Value.Trim());
        }
        mainInfoModel.FrontDisplayTime  = time_Now;
        mainInfoModel.ValidateStartTime = time_Now;
        mainInfoModel.ValidateTerm      = Convert.ToInt32(this.rbtnValiDate.SelectedValue.Trim());
        mainInfoModel.TemplateID        = "001";
        mainInfoModel.HtmlFile          = "";

        //------------------------
        sortInfoModel.ShortInfoControlID = "ProjectIndex1";
        sortInfoModel.ShortTitle         = Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtProjectName.Value.Trim());
        sortInfoModel.ShortContent       = "";
        sortInfoModel.Remark             = "";

        long infoID = projectObj.PublishProjectGQ1(mainInfoModel, projectInfoModel, sortInfoModel);

        if (infoID > 0)
        {
            string HtmlFile = Tz888.BLL.Info.Common.createStaticPageFileName("Project", mainInfoModel.InfoCode, infoID);
            Tz888.BLL.Info.MainInfoBLL mainBll = new Tz888.BLL.Info.MainInfoBLL();
            mainBll.HasHtmlFile(infoID, HtmlFile);

            //补充信息

            projectInfoModel.ProjectAbout       = txtProjectAbout.Value.Trim();
            projectInfoModel.marketAbout        = txtMarketAbout.Value.Trim();
            projectInfoModel.competitioAbout    = txtCompetitioAbout.Value.Trim();
            projectInfoModel.BussinessModeAbout = txtBussinessModeAbout.Value.Trim();
            projectInfoModel.ManageTeamAbout    = txtManageTeamAbout.Value.Trim();
            projectInfoModel.InfoID             = infoID;
            projectObj.PublishProjectGQ2(projectInfoModel);


            //添加附件
            List <Tz888.Model.Info.InfoResourceModel> infoResourceModels = new List <Tz888.Model.Info.InfoResourceModel>();
            infoResourceModels = this.ImageUploadControl1.InfoList;
            if (infoResourceModels != null)
            {
                Tz888.SQLServerDAL.Info.InfoResourceDAL obj2 = new Tz888.SQLServerDAL.Info.InfoResourceDAL();
                foreach (Tz888.Model.Info.InfoResourceModel ResModel in infoResourceModels)
                {
                    ResModel.InfoID = infoID;
                    obj2.Insert(ResModel);
                }
            }

            //联系信息
            Tz888.BLL.Info.InfoContact        dal   = new Tz888.BLL.Info.InfoContact();
            Tz888.Model.Info.InfoContactModel model = new Tz888.Model.Info.InfoContactModel();

            model.InfoID           = infoID;
            model.OrganizationName = txtCompanyName.Value.Trim();
            model.Name             = txtLinkMan.Value.Trim();
            model.Career           = txtCareer.Value.Trim();
            model.TelStateCode     = txtTelStateCode.Value.Trim();
            model.TelNum           = txtTel.Value.Trim();
            model.Mobile           = txtMobile.Value.Trim();
            model.Address          = txtAddress.Value.Trim();
            model.WebSite          = txtWebSite.Value.Trim();
            model.Email            = txtEmail.Value.Trim();
            bool b = dal.Add(model);
            {
                Tz888.Common.MessageBox.Show(this.Page, "发布成功!");
            }
        }
        else
        {
            Tz888.Common.MessageBox.Show(this.Page, "发布失败!");
        }
    }
コード例 #7
0
        public bool Update(Tz888.Model.Info.MerchantSetModel model)
        {
            SqlParameter[] parameters =
            {
                //主表信息
                new SqlParameter("@InfoID",                SqlDbType.BigInt,           8),
                new SqlParameter("@Title",                 SqlDbType.VarChar,        100),
                new SqlParameter("@publishT",              SqlDbType.DateTime),
                new SqlParameter("@LoginName",             SqlDbType.Char,            10), //4

                new SqlParameter("@KeyWord",               SqlDbType.VarChar,         50),
                new SqlParameter("@Descript",              SqlDbType.VarChar,        100),
                new SqlParameter("@DisplayTitle",          SqlDbType.VarChar,         50),
                new SqlParameter("@FrontDisplayTime",      SqlDbType.SmallDateTime),
                new SqlParameter("@ValidateStartTime",     SqlDbType.SmallDateTime),
                new SqlParameter("@ValidateTerm",          SqlDbType.Int,              4),
                new SqlParameter("@TemplateID",            SqlDbType.Char,            10),
                new SqlParameter("@HtmlFile",              SqlDbType.VarChar,        100),                    //8

                //招商信息
                new SqlParameter("@MerchantTypeID",        SqlDbType.Char,            10),
                new SqlParameter("@IndustryClassList",     SqlDbType.VarChar,        150),
                new SqlParameter("@CapitalCurrency",       SqlDbType.Char,            10),
                new SqlParameter("@CapitalTotal",          SqlDbType.Float,            8),
                new SqlParameter("@MerchantCurrency",      SqlDbType.Char,            10),
                new SqlParameter("@MerchantTotal",         SqlDbType.Char,            10),
                new SqlParameter("@CooperationDemandType", SqlDbType.VarChar,         30),
                new SqlParameter("@CountryCode",           SqlDbType.Char,            10),
                new SqlParameter("@ProvinceID",            SqlDbType.Char,            10),
                new SqlParameter("@CityID",                SqlDbType.Char,            10),
                new SqlParameter("@CountyID",              SqlDbType.Char,            10),
                new SqlParameter("@ZoneAbout",             SqlDbType.VarChar,         -1),
                new SqlParameter("@ZoneAboutBrief",        SqlDbType.VarChar,         -1),
                new SqlParameter("@ReceiveOrganization",   SqlDbType.VarChar,        100),
                new SqlParameter("@MerchantOrganization",  SqlDbType.Int,              4),                          //15

                //联系信息
                new SqlParameter("@Organization",          SqlDbType.VarChar,        100),
                new SqlParameter("@LinkMan",               SqlDbType.VarChar,         20),
                new SqlParameter("@TelCountryCode",        SqlDbType.Char,             6),
                new SqlParameter("@TelStateCode",          SqlDbType.Char,             8),
                new SqlParameter("@TelNum",                SqlDbType.VarChar,        100),
                new SqlParameter("@FaxCountryCode",        SqlDbType.Char,             6),
                new SqlParameter("@FaxStateCode",          SqlDbType.Char,             8),
                new SqlParameter("@FaxNum",                SqlDbType.VarChar,        100),
                new SqlParameter("@Mobile",                SqlDbType.VarChar,         30),
                new SqlParameter("@Address",               SqlDbType.VarChar,        100),
                new SqlParameter("@PostCode",              SqlDbType.VarChar,         10),
                new SqlParameter("@Email",                 SqlDbType.VarChar,         50),
                new SqlParameter("@WebSite",               SqlDbType.VarChar,        200), //13

                //短信息表
                new SqlParameter("@ShortInfoControlID",    SqlDbType.Char,            20),
                new SqlParameter("@ShortTitle",            SqlDbType.VarChar,        100),
                new SqlParameter("@ShortContent",          SqlDbType.VarChar,        100),
                new SqlParameter("@strRemark",             SqlDbType.VarChar,         50),
                //2010-06-11新增的
                new SqlParameter("@PriceByUser",           SqlDbType.Int,              4),


                //这里是2010-06-11 添加政府招商的参数 有5个参数
                new SqlParameter("@EconomicIndicators",    SqlDbType.NVarChar,       100),
                new SqlParameter("@InvestmentEnvironment", SqlDbType.NVarChar,       100),
                new SqlParameter("@ProjectStatus",         SqlDbType.NVarChar,       100),
                new SqlParameter("@Market",                SqlDbType.NVarChar,       100),
                new SqlParameter("@Benefit",               SqlDbType.NVarChar,       100), //10

                new SqlParameter("@InformationIntegrity",  SqlDbType.Int,              8),
                new SqlParameter("@Position",              SqlDbType.VarChar,         50),
                new SqlParameter("@Merchanreturns",        SqlDbType.Int,              8),
            };
            parameters[0].Value = model.MainInfoModel.InfoID;
            parameters[1].Value = model.MainInfoModel.Title;
            parameters[2].Value = model.MainInfoModel.publishT;
            parameters[3].Value = model.MainInfoModel.LoginName;

            parameters[4].Value  = model.MainInfoModel.KeyWord;
            parameters[5].Value  = model.MainInfoModel.Descript;
            parameters[6].Value  = model.MainInfoModel.DisplayTitle;
            parameters[7].Value  = model.MainInfoModel.FrontDisplayTime;
            parameters[8].Value  = model.MainInfoModel.ValidateStartTime;
            parameters[9].Value  = model.MainInfoModel.ValidateTerm;
            parameters[10].Value = model.MainInfoModel.TemplateID;
            parameters[11].Value = model.MainInfoModel.HtmlFile;

            parameters[12].Value = model.MerchantInfoModel.MerchantTypeID;
            parameters[13].Value = model.MerchantInfoModel.IndustryClassList;
            parameters[14].Value = model.MerchantInfoModel.CapitalCurrency;
            parameters[15].Value = model.MerchantInfoModel.CapitalTotal;
            parameters[16].Value = model.MerchantInfoModel.MerchantCurrency;
            parameters[17].Value = model.MerchantInfoModel.MerchantTotal;
            parameters[18].Value = model.MerchantInfoModel.CooperationDemandType;
            parameters[19].Value = model.MerchantInfoModel.CountryCode;
            parameters[20].Value = model.MerchantInfoModel.ProvinceID;
            parameters[21].Value = model.MerchantInfoModel.CityID;
            parameters[22].Value = model.MerchantInfoModel.CountyID;
            parameters[23].Value = model.MerchantInfoModel.ZoneAbout;
            parameters[24].Value = model.MerchantInfoModel.ZoneAboutBrief;
            parameters[25].Value = model.MerchantInfoModel.ReceiveOrganization;
            parameters[26].Value = model.MerchantInfoModel.MerchantOrganization;

            parameters[27].Value = model.InfoContactModel.OrganizationName;
            parameters[28].Value = model.InfoContactModel.Name;
            parameters[29].Value = model.InfoContactModel.TelCountryCode;
            parameters[30].Value = model.InfoContactModel.TelStateCode;
            parameters[31].Value = model.InfoContactModel.TelNum;
            parameters[32].Value = model.InfoContactModel.FaxCountryCode;
            parameters[33].Value = model.InfoContactModel.FaxStateCode;
            parameters[34].Value = model.InfoContactModel.FaxNum;
            parameters[35].Value = model.InfoContactModel.Mobile;
            parameters[36].Value = model.InfoContactModel.Address;
            parameters[37].Value = model.InfoContactModel.PostCode;
            parameters[38].Value = model.InfoContactModel.Email;
            parameters[39].Value = model.InfoContactModel.WebSite;


            parameters[40].Value = model.ShortInfoModel.ShortInfoControlID;
            parameters[41].Value = model.ShortInfoModel.ShortTitle;
            parameters[42].Value = model.ShortInfoModel.ShortContent;
            parameters[43].Value = model.ShortInfoModel.Remark;



            //2010-06-11以下是根据需求添加的
            parameters[44].Value = 1;
            parameters[45].Value = model.MerchantInfoModel.EconomicIndicators;
            parameters[46].Value = model.MerchantInfoModel.InvestmentEnvironment;
            parameters[47].Value = model.MerchantInfoModel.ProjectStatus;
            parameters[48].Value = model.MerchantInfoModel.Market;
            parameters[49].Value = model.MerchantInfoModel.Benefit;
            //添加信息完整度
            parameters[50].Value = model.MerchantInfoModel.InformationIntegrity;
            //2010-06-11以下是招商联系人职位
            parameters[51].Value = model.InfoContactModel.Position;
            parameters[52].Value = model.MerchantInfoModel.Merchanreturns;
            //End

            bool ReturnValue = false;
            long infoID      = model.MainInfoModel.InfoID;

            using (SqlConnection sqlConn = DbHelperSQL.GetSqlConnection())
            {
                sqlConn.Open();
                SqlTransaction sqlTran = sqlConn.BeginTransaction();
                try
                {
                    int rowsAffected;
                    //修改招商信息
                    DbHelperSQL.RunProcedure(sqlConn, sqlTran, "MerchantInfoTab_Update", parameters, out rowsAffected);

                    //为招商信息更新联系人信息
                    Tz888.SQLServerDAL.Info.InfoContactManDAL obj2 = new InfoContactManDAL();
                    obj2.DeleteByInfoID(sqlConn, sqlTran, infoID);
                    //if (model.InfoContactManModels != null)
                    //{
                    //    foreach (Tz888.Model.Info.InfoContactManModel tmpModel in model.InfoContactManModels)
                    //    {
                    //        tmpModel.InfoID = infoID;
                    //        obj2.InsertContactMan(sqlConn, sqlTran, tmpModel);
                    //    }
                    //}

                    //为招商信息添加多个资源
                    Tz888.SQLServerDAL.Info.InfoResourceDAL obj3 = new InfoResourceDAL();
                    obj3.DeleteByInfoID(sqlConn, sqlTran, infoID);
                    if (model.InfoResourceModels != null)
                    {
                        foreach (Tz888.Model.Info.InfoResourceModel tmpModel in model.InfoResourceModels)
                        {
                            tmpModel.InfoID = infoID;
                            obj3.InsertInfoResource(sqlConn, sqlTran, tmpModel);
                        }
                    }
                    sqlTran.Commit();
                    ReturnValue = true;
                }
                catch
                {
                    sqlTran.Rollback();
                    ReturnValue = false;
                }
                finally
                {
                    sqlConn.Close();
                }
            }
            return(ReturnValue);
        }
コード例 #8
0
        /// <summary>
        /// 添加招商资源信息
        /// </summary>
        /// <param name="mainInfoModel">资源信息主体</param>
        /// <param name="merchantInfoModel">招商资源个性信息</param>
        /// <param name="infoContactModel">资源联系信息</param>
        /// <param name="shortInfoModel">资源短信息</param>
        /// <param name="infoContactManModels">多联系人列表</param>
        /// <returns>招商资源ID</returns>
        public long Insert(
            Tz888.Model.Info.MainInfoModel mainInfoModel,
            Tz888.Model.Info.MerchantInfoModel merchantInfoModel,
            Tz888.Model.Info.InfoContactModel infoContactModel,
            Tz888.Model.Info.ShortInfoModel shortInfoModel,
            // List<Tz888.Model.Info.InfoContactManModel> infoContactManModels,
            List <Tz888.Model.Info.InfoResourceModel> infoResourceModels
            )
        {
            SqlParameter[] parameters =
            {
                //---------------------资源信息主体----------------------
                new SqlParameter("@InfoID",                  SqlDbType.BigInt,           8),
                new SqlParameter("@Title",                   SqlDbType.VarChar,        100),
                new SqlParameter("@InfoCode",                SqlDbType.Char,            30),
                new SqlParameter("@publishT",                SqlDbType.DateTime),
                new SqlParameter("@Hit",                     SqlDbType.BigInt,           8),

                new SqlParameter("@IsCore",                  SqlDbType.Bit,              1),
                new SqlParameter("@IndexOrderNum",           SqlDbType.BigInt,           8),
                new SqlParameter("@IndexTopValidateDate",    SqlDbType.Int,              4),
                new SqlParameter("@IndexPicInfoNum",         SqlDbType.BigInt,           8),
                new SqlParameter("@InfoTypeOrderNum",        SqlDbType.BigInt,           8),
                new SqlParameter("@InfoTypeTopValidateDate", SqlDbType.Int,              4),
                new SqlParameter("@InfoTypePicInfoNum",      SqlDbType.BigInt,           8),
                new SqlParameter("@LoginName",               SqlDbType.Char,            16),
                new SqlParameter("@InfoOriginRoleName",      SqlDbType.Char,            10),
                new SqlParameter("@GradeID",                 SqlDbType.Char,            10),
                new SqlParameter("@FixPriceID",              SqlDbType.Char,            10),

                new SqlParameter("@FeeStatus",               SqlDbType.TinyInt,          1),

                new SqlParameter("@KeyWord",                 SqlDbType.VarChar,         50),
                new SqlParameter("@Descript",                SqlDbType.VarChar,        100),
                new SqlParameter("@DisplayTitle",            SqlDbType.VarChar,         50),
                new SqlParameter("@FrontDisplayTime",        SqlDbType.SmallDateTime),
                new SqlParameter("@ValidateStartTime",       SqlDbType.SmallDateTime),
                new SqlParameter("@ValidateTerm",            SqlDbType.Int,              4),
                new SqlParameter("@TemplateID",              SqlDbType.Char,            10),
                new SqlParameter("@HtmlFile",                SqlDbType.VarChar,        100),


                //---------------------------END---------------------------

                //--------------------招商资源个性信息---------------------

                new SqlParameter("@MerchantTypeID",          SqlDbType.Char,            10),
                new SqlParameter("@IndustryClassList",       SqlDbType.VarChar,        150),
                new SqlParameter("@CapitalCurrency",         SqlDbType.Char,            10),
                new SqlParameter("@CapitalTotal",            SqlDbType.Float,            8),
                new SqlParameter("@MerchantCurrency",        SqlDbType.Char,            10),
                new SqlParameter("@MerchantTotal",           SqlDbType.Char,            10),
                new SqlParameter("@CooperationDemandType",   SqlDbType.VarChar,         30),
                new SqlParameter("@CountryCode",             SqlDbType.Char,            10),
                new SqlParameter("@ProvinceID",              SqlDbType.Char,            10),
                new SqlParameter("@CityID",                  SqlDbType.Char,            10),
                new SqlParameter("@CountyID",                SqlDbType.Char,            10),
                new SqlParameter("@ZoneAbout",               SqlDbType.VarChar,         -1),
                new SqlParameter("@ZoneAboutBrief",          SqlDbType.VarChar,         -1),
                new SqlParameter("@ReceiveOrganization",     SqlDbType.VarChar,        100),
                new SqlParameter("@MerchantOrganization",    SqlDbType.Int,              4),


                //---------------------------END---------------------------

                //-----------------------资源联系信息--------------------------

                new SqlParameter("@Organization",            SqlDbType.VarChar,         40),
                new SqlParameter("@LinkMan",                 SqlDbType.VarChar,         20),
                new SqlParameter("@TelCountryCode",          SqlDbType.Char,             3),
                new SqlParameter("@TelStateCode",            SqlDbType.Char,             4),
                new SqlParameter("@TelNum",                  SqlDbType.VarChar,         60),
                new SqlParameter("@FaxCountryCode",          SqlDbType.Char,             3),
                new SqlParameter("@FaxStateCode",            SqlDbType.Char,             4),
                new SqlParameter("@FaxNum",                  SqlDbType.VarChar,         60),

                new SqlParameter("@Mobile",                  SqlDbType.VarChar,         30),
                new SqlParameter("@Address",                 SqlDbType.VarChar,        100),
                new SqlParameter("@PostCode",                SqlDbType.VarChar,         10),
                new SqlParameter("@Email",                   SqlDbType.VarChar,         50),
                new SqlParameter("@WebSite",                 SqlDbType.VarChar,        200),

                //---------------------------END---------------------------

                //-------------------------短信息--------------------------

                new SqlParameter("@ShortInfoControlID",      SqlDbType.Char,            20),
                new SqlParameter("@ShortTitle",              SqlDbType.VarChar,        100),
                new SqlParameter("@ShortContent",            SqlDbType.VarChar,        100),
                new SqlParameter("@strRemark",               SqlDbType.VarChar,         50),
                //这里是2010-06-01 添加政府招商的参数 有5个参数
                new SqlParameter("@EconomicIndicators",      SqlDbType.NVarChar,       100),
                new SqlParameter("@InvestmentEnvironment",   SqlDbType.NVarChar,       100),
                new SqlParameter("@ProjectStatus",           SqlDbType.NVarChar,       100),
                new SqlParameter("@Market",                  SqlDbType.NVarChar,       100),
                new SqlParameter("@Benefit",                 SqlDbType.NVarChar,       100),
                //新添加结束处
                //这里是2010-06-02添加政府招商联系信息的参数
                new SqlParameter("@Position",                SqlDbType.VarChar,         50),
                //这里是2010-06-08添加信息完整度
                new SqlParameter("@InformationIntegrity",    SqlDbType.Int,              8),
                new SqlParameter("@Merchanreturns",          SqlDbType.Int, 8)


                //---------------------------END---------------------------
            };

            //---------------------资源信息主体参数----------------------
            parameters[0].Direction = ParameterDirection.Output;
            parameters[1].Value     = mainInfoModel.Title;
            parameters[2].Value     = mainInfoModel.InfoCode;
            parameters[3].Value     = mainInfoModel.publishT;
            parameters[4].Value     = mainInfoModel.Hit;

            parameters[5].Value  = mainInfoModel.IsCore;
            parameters[6].Value  = mainInfoModel.IndexOrderNum;
            parameters[7].Value  = mainInfoModel.IndexTopValidateDate;
            parameters[8].Value  = mainInfoModel.IndexPicInfoNum;
            parameters[9].Value  = mainInfoModel.InfoTypeOrderNum;
            parameters[10].Value = mainInfoModel.InfoTypeTopValidateDate;
            parameters[11].Value = mainInfoModel.InfoTypePicInfoNum;
            parameters[12].Value = mainInfoModel.LoginName;
            parameters[13].Value = mainInfoModel.InfoOriginRoleName;
            parameters[14].Value = mainInfoModel.GradeID;
            parameters[15].Value = mainInfoModel.FixPriceID;
            parameters[16].Value = mainInfoModel.FeeStatus;

            parameters[17].Value = mainInfoModel.KeyWord;
            parameters[18].Value = mainInfoModel.Descript;
            parameters[19].Value = mainInfoModel.DisplayTitle;
            parameters[20].Value = mainInfoModel.FrontDisplayTime;
            parameters[21].Value = mainInfoModel.ValidateStartTime;
            parameters[22].Value = mainInfoModel.ValidateTerm;
            parameters[23].Value = mainInfoModel.TemplateID;
            parameters[24].Value = mainInfoModel.HtmlFile;



            //End
            parameters[25].Value = merchantInfoModel.MerchantTypeID;
            parameters[26].Value = merchantInfoModel.IndustryClassList;
            parameters[27].Value = merchantInfoModel.CapitalCurrency;
            parameters[28].Value = merchantInfoModel.CapitalTotal;
            parameters[29].Value = merchantInfoModel.MerchantCurrency;
            parameters[30].Value = merchantInfoModel.MerchantTotal;
            parameters[31].Value = merchantInfoModel.CooperationDemandType;
            parameters[32].Value = merchantInfoModel.CountryCode;
            parameters[33].Value = merchantInfoModel.ProvinceID;
            parameters[34].Value = merchantInfoModel.CityID;
            parameters[35].Value = merchantInfoModel.CountyID;
            parameters[36].Value = merchantInfoModel.ZoneAbout;
            parameters[37].Value = merchantInfoModel.ZoneAboutBrief;
            parameters[38].Value = merchantInfoModel.ReceiveOrganization;
            parameters[39].Value = merchantInfoModel.MerchantOrganization;
            //2010-06-01以下是根据需求添加的
            parameters[57].Value = merchantInfoModel.EconomicIndicators;
            parameters[58].Value = merchantInfoModel.InvestmentEnvironment;
            parameters[59].Value = merchantInfoModel.ProjectStatus;
            parameters[60].Value = merchantInfoModel.Market;
            parameters[61].Value = merchantInfoModel.Benefit;
            //添加信息完整度
            parameters[63].Value = merchantInfoModel.InformationIntegrity;
            //End



            parameters[40].Value = infoContactModel.OrganizationName;
            parameters[41].Value = infoContactModel.Name;
            parameters[42].Value = infoContactModel.TelCountryCode;
            parameters[43].Value = infoContactModel.TelStateCode;
            parameters[44].Value = infoContactModel.TelNum;
            parameters[45].Value = infoContactModel.FaxCountryCode;
            parameters[46].Value = infoContactModel.FaxStateCode;
            parameters[47].Value = infoContactModel.FaxNum;
            parameters[48].Value = infoContactModel.Mobile;
            parameters[49].Value = infoContactModel.Address;
            parameters[50].Value = infoContactModel.PostCode;
            parameters[51].Value = infoContactModel.Email;
            parameters[52].Value = infoContactModel.WebSite;
            //2010-06-02以下是招商联系人职位
            parameters[62].Value = infoContactModel.Position;
            //end

            parameters[53].Value = shortInfoModel.ShortInfoControlID;
            parameters[54].Value = shortInfoModel.ShortTitle;
            parameters[55].Value = shortInfoModel.ShortContent;
            parameters[56].Value = shortInfoModel.Remark;
            parameters[64].Value = merchantInfoModel.Merchanreturns;
            int  rowsAffected;
            long infoID;

            using (SqlConnection sqlConn = DbHelperSQL.GetSqlConnection())
            {
                sqlConn.Open();
                SqlTransaction sqlTran = sqlConn.BeginTransaction();
                try
                {
                    //插入招商资源信息插如方法
                    DbHelperSQL.RunProcedure(sqlConn, sqlTran, SP_MarchantInfo_Insert, parameters, out rowsAffected);
                    infoID = (long)parameters[0].Value;
                    if (infoID < 0)
                    {
                        throw new Exception();
                    }

                    //注释掉多个联系人
                    //if (infoContactManModels != null)
                    //{
                    //    //为招商资源添加多个联系人
                    //    Tz888.SQLServerDAL.Info.InfoContactManDAL obj1 = new InfoContactManDAL();
                    //    foreach (Tz888.Model.Info.InfoContactManModel model in infoContactManModels)
                    //    {
                    //        model.InfoID = infoID;
                    //        obj1.InsertContactMan(sqlConn, sqlTran, model);
                    //    }
                    //}

                    if (infoResourceModels != null)
                    {
                        //为招商信息添加多个资源
                        Tz888.SQLServerDAL.Info.InfoResourceDAL obj2 = new InfoResourceDAL();
                        foreach (Tz888.Model.Info.InfoResourceModel model in infoResourceModels)
                        {
                            model.InfoID = infoID;
                            obj2.InsertInfoResource(sqlConn, sqlTran, model);
                        }
                    }

                    sqlTran.Commit();
                }
                catch
                {
                    sqlTran.Rollback();
                    infoID = -1;
                }
                finally
                {
                    sqlConn.Close();
                }
            }

            return(infoID);
        }
コード例 #9
0
ファイル: zq2.aspx.cs プロジェクト: 262734254/topfomember
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        Tz888.BLL.Info.ProjectInfoBLL     dal   = new Tz888.BLL.Info.ProjectInfoBLL();
        Tz888.Model.Info.ProjectInfoModel model = new Tz888.Model.Info.ProjectInfoModel();
        model.marketAbout = txtMarketAbout.Value.Trim();
        decimal CompanyNG = 0;

        if (Tz888.Common.Utility.PageValidate.IsNumber(txtCompanyNG.Value.Trim()))
        {
            CompanyNG = Convert.ToDecimal(txtCompanyNG.Value.Trim());
        }
        model.CompanyNG = CompanyNG;
        decimal CompanyTotalDebet = 0;

        if (Tz888.Common.Utility.PageValidate.IsNumber(txtCompanyTotalDebet.Value.Trim()))
        {
            CompanyTotalDebet = Convert.ToDecimal(txtCompanyTotalDebet.Value.Trim());
        }
        model.CompanyTotalDebet = CompanyTotalDebet;


        decimal CompanyYearIncome = 0;

        if (Tz888.Common.Utility.PageValidate.IsNumber(txtCompanyYearIncome.Value.Trim()))
        {
            CompanyYearIncome = Convert.ToDecimal(txtCompanyYearIncome.Value.Trim());
        }
        model.CompanyYearIncome = CompanyYearIncome;

        decimal CompanyTotalCapital = 0;

        if (Tz888.Common.Utility.PageValidate.IsNumber(txtCompanyTotalCapital.Value.Trim()))
        {
            CompanyYearIncome = Convert.ToDecimal(txtCompanyTotalCapital.Value.Trim());
        }
        model.CompanyTotalCapital = CompanyTotalCapital;

        model.InfoID = _infoID;
        bool b = dal.PublishProjectZQ2(model);

        //Response.Write(b.ToString());
        if (b)
        {
            //为信息添加多个资源
            List <Tz888.Model.Info.InfoResourceModel> infoResourceModels = new List <Tz888.Model.Info.InfoResourceModel>();//资源信息实体
            infoResourceModels = FilesUploadControl1.InfoList;
            if (infoResourceModels != null)
            {
                if (infoResourceModels != null)
                {
                    Tz888.SQLServerDAL.Info.InfoResourceDAL obj2 = new Tz888.SQLServerDAL.Info.InfoResourceDAL();
                    foreach (Tz888.Model.Info.InfoResourceModel ResModel in infoResourceModels)
                    {
                        ResModel.InfoID = _infoID;
                        obj2.Insert(ResModel);
                    }
                }
            }

            Response.Redirect("ContactInfo.aspx?code=" + this.Page.Request.QueryString["code"].ToString());
        }
    }
コード例 #10
0
    //[WebMethod]
    public string getInfoResourceById(long infoID, string InfoOriginRoleName, decimal MainPointCount, int FixPriceID, bool bIsTofMember)
    {
        string resStr  = "";
        string tempStr = "<li>[#ResType]<a href='#ResURL' alt='#ResT2'>#ResTitle</a>——#ResDec</li>";

        Tz888.SQLServerDAL.Info.InfoResourceDAL   bll    = new Tz888.SQLServerDAL.Info.InfoResourceDAL();
        List <Tz888.Model.Info.InfoResourceModel> models = bll.GetModelList(infoID);

        if (models != null)
        {
            int nameNum = 0;
            foreach (Tz888.Model.Info.InfoResourceModel ResModel in models)
            {
                nameNum++;

                if (ResModel.ResourceDescrib.Trim() == "")
                {
                    ResModel.ResourceDescrib = "文件" + nameNum.ToString();
                }
                if (ResModel.ResourceTitle.Trim() == "")
                {
                    ResModel.ResourceTitle = "文件" + nameNum.ToString();
                }

                string temp     = tempStr;
                string restype  = "image";
                string fileName = ResModel.ResourceAddr.Trim();
                if (fileName != "")
                {
                    fileName = "http://images.topfo.com/" + ResModel.ResourceAddr;
                }
                if (fileName.IndexOf(".doc") > 0 || fileName.IndexOf(".ppt") > 0 || fileName.IndexOf(".pdf") > 0)
                {
                    restype = "file";
                }

                if (MainPointCount > 0 && FixPriceID > 1)//收费资源
                {
                    temp = temp.Replace("#ResType", restype == "image" ? "图片" : "文件");
                    //temp = temp.Replace("#ResT2", restype == "image" ? "点击查看图片" : "点击下载文件");
                    if (bIsTofMember == true)          //是否登录
                    {
                        if (InfoOriginRoleName == "0") //判断是否购买
                        {
                            temp = temp.Replace("#ResURL", "#");
                            temp = temp.Replace("#ResT2", "购买后才能下载");
                        }
                        else
                        {
                            temp = temp.Replace("#ResURL", fileName.Trim());
                            temp = temp.Replace("#ResT2", restype == "image" ? "点击查看图片" : "点击下载文件");
                        }
                    }
                    else
                    {
                        temp = temp.Replace("#ResURL", "#");
                        temp = temp.Replace("#ResT2", "登录后才能下载");
                    }
                    temp = temp.Replace("#ResDec", ResModel.ResourceDescrib);
                    temp = temp.Replace("#ResTitle", ResModel.ResourceTitle);
                }
                else//免费资源
                {
                    temp = temp.Replace("#ResType", restype == "image" ? "图片" : "文件");
                    temp = temp.Replace("#ResT2", restype == "image" ? "点击查看图片" : "点击下载文件");
                    temp = temp.Replace("#ResURL", fileName.Trim());
                    temp = temp.Replace("#ResDec", ResModel.ResourceDescrib);
                    temp = temp.Replace("#ResTitle", ResModel.ResourceTitle);
                }
                resStr += temp;
            }
        }
        if (resStr.Trim() == "")
        {
            resStr = "<li>无相关附件</li>";
        }
        //resStr = "<div class=\"lcontentbox\"><div class=\"ctop\"><ul><li>相关附件 </li></ul></div><div class=\"introbox\"><ul style=\" margin-left:20px;\">" + resStr;
        //resStr += "</ul></div></div>";

        return(resStr);
    }