public IList <DemoRow> Get(string id, int code) { const string sql = "IDaoDemo_Get"; using (IDbCommandStoredProcedure cmd = CreateCommandStoredProcedure(sql)) { cmd.AddParameterValue(id); cmd.AddParameterValue(code); return(cmd.Execute <DemoRow>()); } }
public int Ins(DemoRow value) { const string sql = "IDaoDemo_Ins"; using (IDbCommandStoredProcedure cmd = CreateCommandStoredProcedure(sql)) { cmd.AddParameterValue(value.Id); cmd.AddParameterValue(value.Name); cmd.AddParameterValue(value.Note); int cnt; cnt = cmd.ExecuteNonQuery(); if (cnt.Equals(0)) { return(0); } return((int)cmd.ResultOutParameter["MaxCode"]); } }