Example #1
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(CZB.Model.FX_InsureParaDetail model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update FX_InsureParaDetail set ");
            strSql.Append("ParaCode=@ParaCode,");
            strSql.Append("InsureCode=@InsureCode,");
            strSql.Append("ParaValue=@ParaValue,");
            strSql.Append("CityCode=@CityCode");
            strSql.Append(" where InsureParaDetailsId=@InsureParaDetailsId");
            SqlParameter[] parameters =
            {
                new SqlParameter("@ParaCode",            SqlDbType.NVarChar, 50),
                new SqlParameter("@InsureCode",          SqlDbType.NVarChar, 50),
                new SqlParameter("@ParaValue",           SqlDbType.NVarChar, 50),
                new SqlParameter("@CityCode",            SqlDbType.NVarChar, 50),
                new SqlParameter("@InsureParaDetailsId", SqlDbType.Int, 4)
            };
            parameters[0].Value = model.ParaCode;
            parameters[1].Value = model.InsureCode;
            parameters[2].Value = model.ParaValue;
            parameters[3].Value = model.CityCode;
            parameters[4].Value = model.InsureParaDetailsId;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #2
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(CZB.Model.FX_InsureParaDetail model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into FX_InsureParaDetail(");
            strSql.Append("ParaCode,InsureCode,ParaValue,CityCode)");
            strSql.Append(" values (");
            strSql.Append("@ParaCode,@InsureCode,@ParaValue,@CityCode)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters =
            {
                new SqlParameter("@ParaCode",   SqlDbType.NVarChar, 50),
                new SqlParameter("@InsureCode", SqlDbType.NVarChar, 50),
                new SqlParameter("@ParaValue",  SqlDbType.NVarChar, 50),
                new SqlParameter("@CityCode",   SqlDbType.NVarChar, 50)
            };
            parameters[0].Value = model.ParaCode;
            parameters[1].Value = model.InsureCode;
            parameters[2].Value = model.ParaValue;
            parameters[3].Value = model.CityCode;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(CZB.Model.FX_InsureParaDetail model)
 {
     return(dal.Update(model));
 }
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(CZB.Model.FX_InsureParaDetail model)
 {
     return(dal.Add(model));
 }