/// <summary> /// 更新一条数据 /// </summary> public bool Update(Mod_TS_USER_ROLE model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update TS_USER_ROLE set "); strSql.Append("C_USER_ID=:C_USER_ID,"); strSql.Append("C_ROLE_ID=:C_ROLE_ID"); strSql.Append(" where C_ID=:C_ID "); OracleParameter[] parameters = { new OracleParameter(":C_USER_ID", OracleDbType.Varchar2, 100), new OracleParameter(":C_ROLE_ID", OracleDbType.Varchar2, 100), new OracleParameter(":C_ID", OracleDbType.Varchar2, 100) }; parameters[0].Value = model.C_USER_ID; parameters[1].Value = model.C_ROLE_ID; parameters[2].Value = model.C_ID; int rows = DbHelperOra.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(Mod_TS_USER_ROLE model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into TS_USER_ROLE("); strSql.Append("C_ID,C_USER_ID,C_ROLE_ID)"); strSql.Append(" values ("); strSql.Append(":C_ID,:C_USER_ID,:C_ROLE_ID)"); OracleParameter[] parameters = { new OracleParameter(":C_ID", OracleDbType.Varchar2, 100), new OracleParameter(":C_USER_ID", OracleDbType.Varchar2, 100), new OracleParameter(":C_ROLE_ID", OracleDbType.Varchar2, 100) }; parameters[0].Value = model.C_ID; parameters[1].Value = model.C_USER_ID; parameters[2].Value = model.C_ROLE_ID; int rows = DbHelperOra.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 得到一个对象实体 /// </summary> public Mod_TS_USER_ROLE DataRowToModel(DataRow row) { Mod_TS_USER_ROLE model = new Mod_TS_USER_ROLE(); if (row != null) { if (row["C_ID"] != null) { model.C_ID = row["C_ID"].ToString(); } if (row["C_USER_ID"] != null) { model.C_USER_ID = row["C_USER_ID"].ToString(); } if (row["C_ROLE_ID"] != null) { model.C_ROLE_ID = row["C_ROLE_ID"].ToString(); } } return(model); }
/// <summary> /// 得到一个对象实体 /// </summary> public Mod_TS_USER_ROLE GetModel(string C_ID) { StringBuilder strSql = new StringBuilder(); strSql.Append("select C_ID,C_USER_ID,C_ROLE_ID from TS_USER_ROLE "); strSql.Append(" where C_ID=:C_ID "); OracleParameter[] parameters = { new OracleParameter(":C_ID", OracleDbType.Varchar2, 100) }; parameters[0].Value = C_ID; Mod_TS_USER_ROLE model = new Mod_TS_USER_ROLE(); 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(Mod_TS_USER_ROLE model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(Mod_TS_USER_ROLE model) { return(dal.Add(model)); }