Esempio n. 1
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);
        }
Esempio n. 2
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);
        }
Esempio n. 3
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);
        }