/// <summary> /// 更新一条数据 /// </summary> public bool Update(CZB.Model.FX_PolicyDetail model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update FX_PolicyDetail set "); strSql.Append("PolicyId=@PolicyId,"); strSql.Append("InsuranceTypeId=@InsuranceTypeId,"); strSql.Append("InsuranceTypeDetail=@InsuranceTypeDetail,"); strSql.Append("TotalAmount=@TotalAmount,"); strSql.Append("CreateTime=@CreateTime,"); strSql.Append("UpdateTime=@UpdateTime,"); strSql.Append("IsUse=@IsUse"); strSql.Append(" where PolicyDetailsId=@PolicyDetailsId"); SqlParameter[] parameters = { new SqlParameter("@PolicyId", SqlDbType.Int, 4), new SqlParameter("@InsuranceTypeId", SqlDbType.Int, 4), new SqlParameter("@InsuranceTypeDetail", SqlDbType.NVarChar, 100), new SqlParameter("@TotalAmount", SqlDbType.Decimal, 9), new SqlParameter("@CreateTime", SqlDbType.DateTime), new SqlParameter("@UpdateTime", SqlDbType.DateTime), new SqlParameter("@IsUse", SqlDbType.Int, 4), new SqlParameter("@PolicyDetailsId", SqlDbType.Int, 4) }; parameters[0].Value = model.PolicyId; parameters[1].Value = model.InsuranceTypeId; parameters[2].Value = model.InsuranceTypeDetail; parameters[3].Value = model.TotalAmount; parameters[4].Value = model.CreateTime; parameters[5].Value = model.UpdateTime; parameters[6].Value = model.IsUse; parameters[7].Value = model.PolicyDetailsId; int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(CZB.Model.FX_PolicyDetail model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into FX_PolicyDetail("); strSql.Append("PolicyId,InsuranceTypeId,InsuranceTypeDetail,TotalAmount,CreateTime,UpdateTime,IsUse)"); strSql.Append(" values ("); strSql.Append("@PolicyId,@InsuranceTypeId,@InsuranceTypeDetail,@TotalAmount,@CreateTime,@UpdateTime,@IsUse)"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@PolicyId", SqlDbType.Int, 4), new SqlParameter("@InsuranceTypeId", SqlDbType.Int, 4), new SqlParameter("@InsuranceTypeDetail", SqlDbType.NVarChar, 100), new SqlParameter("@TotalAmount", SqlDbType.Decimal, 9), new SqlParameter("@CreateTime", SqlDbType.DateTime), new SqlParameter("@UpdateTime", SqlDbType.DateTime), new SqlParameter("@IsUse", SqlDbType.Int, 4) }; parameters[0].Value = model.PolicyId; parameters[1].Value = model.InsuranceTypeId; parameters[2].Value = model.InsuranceTypeDetail; parameters[3].Value = model.TotalAmount; parameters[4].Value = model.CreateTime; parameters[5].Value = model.UpdateTime; parameters[6].Value = model.IsUse; 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_PolicyDetail model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(CZB.Model.FX_PolicyDetail model) { return(dal.Add(model)); }