/// <summary> /// 对象实体绑定数据 /// </summary> public MesWeb.Model.T_FlowRelation ReaderBind(IDataReader dataReader) { MesWeb.Model.T_FlowRelation model = new MesWeb.Model.T_FlowRelation(); object ojb; ojb = dataReader["FlowRelationID"]; if (ojb != null && ojb != DBNull.Value) { model.FlowRelationID = (int)ojb; } ojb = dataReader["AuthenticID"]; if (ojb != null && ojb != DBNull.Value) { model.AuthenticID = (int)ojb; } ojb = dataReader["ApplicationItemID"]; if (ojb != null && ojb != DBNull.Value) { model.ApplicationItemID = (int)ojb; } ojb = dataReader["FlowID"]; if (ojb != null && ojb != DBNull.Value) { model.FlowID = (int)ojb; } return(model); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(MesWeb.Model.T_FlowRelation model) { Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetStoredProcCommand("T_FlowRelation_Update"); db.AddInParameter(dbCommand, "FlowRelationID", DbType.Int32, model.FlowRelationID); db.AddInParameter(dbCommand, "AuthenticID", DbType.Int32, model.AuthenticID); db.AddInParameter(dbCommand, "ApplicationItemID", DbType.Int32, model.ApplicationItemID); db.AddInParameter(dbCommand, "FlowID", DbType.Int32, model.FlowID); db.ExecuteNonQuery(dbCommand); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(MesWeb.Model.T_FlowRelation model) { Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetStoredProcCommand("T_FlowRelation_ADD"); db.AddOutParameter(dbCommand, "FlowRelationID", DbType.Int32, 4); db.AddInParameter(dbCommand, "AuthenticID", DbType.Int32, model.AuthenticID); db.AddInParameter(dbCommand, "ApplicationItemID", DbType.Int32, model.ApplicationItemID); db.AddInParameter(dbCommand, "FlowID", DbType.Int32, model.FlowID); db.ExecuteNonQuery(dbCommand); return((int)db.GetParameterValue(dbCommand, "FlowRelationID")); }
/// <summary> /// 得到一个对象实体 /// </summary> public MesWeb.Model.T_FlowRelation GetModel(int FlowRelationID) { Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetStoredProcCommand("T_FlowRelation_GetModel"); db.AddInParameter(dbCommand, "FlowRelationID", DbType.Int32, FlowRelationID); MesWeb.Model.T_FlowRelation model = null; using (IDataReader dataReader = db.ExecuteReader(dbCommand)) { if (dataReader.Read()) { model = ReaderBind(dataReader); } } return(model); }
/// <summary> /// 得到一个对象实体 /// </summary> public MesWeb.Model.T_FlowRelation DataRowToModel(DataRow row) { MesWeb.Model.T_FlowRelation model = new MesWeb.Model.T_FlowRelation(); if (row != null) { if (row["FlowRelationID"] != null && row["FlowRelationID"].ToString() != "") { model.FlowRelationID = int.Parse(row["FlowRelationID"].ToString()); } if (row["AuthenticID"] != null && row["AuthenticID"].ToString() != "") { model.AuthenticID = int.Parse(row["AuthenticID"].ToString()); } if (row["ApplicationItemID"] != null && row["ApplicationItemID"].ToString() != "") { model.ApplicationItemID = int.Parse(row["ApplicationItemID"].ToString()); } if (row["FlowID"] != null && row["FlowID"].ToString() != "") { model.FlowID = int.Parse(row["FlowID"].ToString()); } } return(model); }