111,098
社区成员




public DataSet get_doc(string cuid,int doctype)
{
SqlParameter[] pars ={
MakeInParam("@cuid",SqlDbType.NVarChar,200,cuid),
MakeInParam("@doctype",SqlDbType.TinyInt,4,doctype),
};
return RunProc("select a.*, b.flow_name, c.node_name, c.node_type_id, c.node_order_id, c.node_next_id from t_doc a, t_flow b, t_node c where a.df = 0 and a.cu in (@cuid) and a.st in ( 0,1,4 ) and a.doc_type = @doctype and a.flow_id *= b.flow_id and a.node_id *= c.node_id order by a.doc_id desc", pars, "t_doc123");
}
public DataSet RunProc(string procN, SqlParameter[] prams, string tbN)
{
SqlDataAdapter dap = CreateDataAdaper(procN, prams);
DataSet ds = new DataSet();
dap.Fill(ds, tbN);
this.Close();
return ds;
}
private SqlDataAdapter CreateDataAdaper(string procN, SqlParameter[] prams)
{
this.Open();
SqlDataAdapter dap = new SqlDataAdapter(procN,con);
dap.SelectCommand.CommandType = CommandType.Text;
if (prams != null)
{
foreach (SqlParameter parameter in prams)
dap.SelectCommand.Parameters.Add(parameter);
}
dap.SelectCommand.Parameters.Add(new SqlParameter("ReturnValue", SqlDbType.Int, 4,
ParameterDirection.ReturnValue, false, 0, 0,
string.Empty, DataRowVersion.Default, null));
return dap;
}
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}