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

            strSql.Append("update FX_InsuranceType set ");
            strSql.Append("InsuranceName=@InsuranceName,");
            strSql.Append("InsurancrMoney=@InsurancrMoney");
            strSql.Append(" where InsuranceTypeId=@InsuranceTypeId ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@InsuranceName",   SqlDbType.NVarChar, 50),
                new SqlParameter("@InsurancrMoney",  SqlDbType.Int,       4),
                new SqlParameter("@InsuranceTypeId", SqlDbType.Int, 4)
            };
            parameters[0].Value = model.InsuranceName;
            parameters[1].Value = model.InsurancrMoney;
            parameters[2].Value = model.InsuranceTypeId;

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #2
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(CZB.Model.FX_InsuranceType model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into FX_InsuranceType(");
            strSql.Append("InsuranceTypeId,InsuranceName,InsurancrMoney)");
            strSql.Append(" values (");
            strSql.Append("@InsuranceTypeId,@InsuranceName,@InsurancrMoney)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@InsuranceTypeId", SqlDbType.Int,       4),
                new SqlParameter("@InsuranceName",   SqlDbType.NVarChar, 50),
                new SqlParameter("@InsurancrMoney",  SqlDbType.Int, 4)
            };
            parameters[0].Value = model.InsuranceTypeId;
            parameters[1].Value = model.InsuranceName;
            parameters[2].Value = model.InsurancrMoney;

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(CZB.Model.FX_InsuranceType model)
 {
     return(dal.Update(model));
 }
コード例 #4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(CZB.Model.FX_InsuranceType model)
 {
     return(dal.Add(model));
 }