/// <summary> /// 更新一条数据 /// </summary> public bool Update(Model.FEETYPE model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update FEETYPE set "); strSql.Append("TYPENAME=:TYPENAME,"); strSql.Append("TYPEGROUP=:TYPEGROUP"); strSql.Append(" where TYPENAME=:TYPENAME "); OracleParameter[] parameters = { new OracleParameter(":TYPENAME", OracleType.VarChar, 30), new OracleParameter(":TYPEGROUP", OracleType.VarChar, 30) }; parameters[0].Value = model.TYPENAME; parameters[1].Value = model.TYPEGROUP; int rows = DbHelperOra.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(Model.FEETYPE model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into FEETYPE("); strSql.Append("TYPENAME,TYPEGROUP)"); strSql.Append(" values ("); strSql.Append(":TYPENAME,:TYPEGROUP)"); OracleParameter[] parameters = { new OracleParameter(":TYPENAME", OracleType.VarChar, 30), new OracleParameter(":TYPEGROUP", OracleType.VarChar, 30) }; parameters[0].Value = model.TYPENAME; parameters[1].Value = model.TYPEGROUP; int rows = DbHelperOra.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 得到一个对象实体 /// </summary> public Model.FEETYPE DataRowToModel(DataRow row) { Model.FEETYPE model = new Model.FEETYPE(); if (row != null) { if (row["TYPENAME"] != null) { model.TYPENAME = row["TYPENAME"].ToString(); } if (row["TYPEGROUP"] != null) { model.TYPEGROUP = row["TYPEGROUP"].ToString(); } } return(model); }
/// <summary> /// 得到一个对象实体 /// </summary> public Model.FEETYPE GetModel(string TYPENAME) { StringBuilder strSql = new StringBuilder(); strSql.Append("select TYPENAME,TYPEGROUP from FEETYPE "); strSql.Append(" where TYPENAME=:TYPENAME "); OracleParameter[] parameters = { new OracleParameter(":TYPENAME", OracleType.VarChar, 30) }; parameters[0].Value = TYPENAME; Model.FEETYPE model = new Model.FEETYPE(); DataSet ds = DbHelperOra.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { return(DataRowToModel(ds.Tables[0].Rows[0])); } else { return(null); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Model.FEETYPE model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(Model.FEETYPE model) { return(dal.Add(model)); }