/// <summary> /// 增加一条数据 /// </summary> public bool Add(Model.FCASE_PRIORITY model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into FCASE_PRIORITY("); strSql.Append("PID,OURNO,PRIOR_DATE,PRIOR_NUM,PRIOR_COUNTRY)"); strSql.Append(" values ("); strSql.Append(":PID,:OURNO,:PRIOR_DATE,:PRIOR_NUM,:PRIOR_COUNTRY)"); OracleParameter[] parameters = { new OracleParameter(":PID", OracleType.VarChar, 20), new OracleParameter(":OURNO", OracleType.VarChar, 30), new OracleParameter(":PRIOR_DATE", OracleType.DateTime), new OracleParameter(":PRIOR_NUM", OracleType.VarChar, 30), new OracleParameter(":PRIOR_COUNTRY", OracleType.VarChar, 50) }; parameters[0].Value = model.PID; parameters[1].Value = model.OURNO; parameters[2].Value = model.PRIOR_DATE; parameters[3].Value = model.PRIOR_NUM; parameters[4].Value = model.PRIOR_COUNTRY; int rows = DbHelperOra.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 得到一个对象实体 /// </summary> public Model.FCASE_PRIORITY DataRowToModel(DataRow row) { Model.FCASE_PRIORITY model = new Model.FCASE_PRIORITY(); if (row != null) { if (row["PID"] != null) { model.PID = row["PID"].ToString(); } if (row["OURNO"] != null) { model.OURNO = row["OURNO"].ToString(); } if (row["PRIOR_DATE"] != null && row["PRIOR_DATE"].ToString() != "") { model.PRIOR_DATE = DateTime.Parse(row["PRIOR_DATE"].ToString()); } if (row["PRIOR_NUM"] != null) { model.PRIOR_NUM = row["PRIOR_NUM"].ToString(); } if (row["PRIOR_COUNTRY"] != null) { model.PRIOR_COUNTRY = row["PRIOR_COUNTRY"].ToString(); } } return(model); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Model.FCASE_PRIORITY model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update FCASE_PRIORITY set "); strSql.Append("PID=:PID,"); strSql.Append("OURNO=:OURNO,"); strSql.Append("PRIOR_DATE=:PRIOR_DATE,"); strSql.Append("PRIOR_NUM=:PRIOR_NUM,"); strSql.Append("PRIOR_COUNTRY=:PRIOR_COUNTRY"); strSql.Append(" where PID=:PID "); OracleParameter[] parameters = { new OracleParameter(":PID", OracleType.VarChar, 20), new OracleParameter(":OURNO", OracleType.VarChar, 30), new OracleParameter(":PRIOR_DATE", OracleType.DateTime), new OracleParameter(":PRIOR_NUM", OracleType.VarChar, 30), new OracleParameter(":PRIOR_COUNTRY", OracleType.VarChar, 50) }; parameters[0].Value = model.PID; parameters[1].Value = model.OURNO; parameters[2].Value = model.PRIOR_DATE; parameters[3].Value = model.PRIOR_NUM; parameters[4].Value = model.PRIOR_COUNTRY; int rows = DbHelperOra.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 得到一个对象实体 /// </summary> public Model.FCASE_PRIORITY GetModel(string PID) { StringBuilder strSql = new StringBuilder(); strSql.Append("select PID,OURNO,PRIOR_DATE,PRIOR_NUM,PRIOR_COUNTRY from FCASE_PRIORITY "); strSql.Append(" where PID=:PID "); OracleParameter[] parameters = { new OracleParameter(":PID", OracleType.VarChar, 20) }; parameters[0].Value = PID; Model.FCASE_PRIORITY model = new Model.FCASE_PRIORITY(); 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.FCASE_PRIORITY model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(Model.FCASE_PRIORITY model) { return(dal.Add(model)); }