public static T GetObjectFormDb <T>(string pname, bool ByteFormat = false, string logid = "") { T local = default(T); Dictionary <string, object> args = new Dictionary <string, object> { { "type", "GetObjectFormDb" }, { "pname", pname }, { "logid", logid } }; object obj2 = ProjAgent.ProjExec(ExecType.PLMHelper, args); if (obj2 == null) { return(local); } if (ByteFormat) { return(PLMSerializer.FromBytes <T>(PLMSerializer.FromXML <byte[]>(obj2.ToString()))); } return(PLMSerializer.FromXML <T>(obj2.ToString())); }
private static object DbHelper(string type, Guid session, string sqlstr, Assembly callassm2, List <DbParameter2> parameters = null, CommandType commandType = CommandType.Text, string ConnectionString = null, DbProviderType providerType = DbProviderType.Oracle, DataTable dt = null, string idcol = "id", string statecol = "__status", string CurrentUserID = "", IList <string> listSql = null, IList <IList <DbParameter2> > listParameters = null, IList <CommandType> listCommandType = null, object tag = null) { Dictionary <string, object> args = new Dictionary <string, object> { { "type", type }, { "session", session }, { "sqlstr", sqlstr }, { "parameters", parameters }, { "commandType", commandType }, { "ConnectionString", ConnectionString }, { "providerType", providerType } }; Assembly entryAssembly = Assembly.GetEntryAssembly(); if (entryAssembly == null) { entryAssembly = callassm2; } args.Add("callassm", entryAssembly.GetName().Name); args.Add("dt", dt); args.Add("idcol", idcol); args.Add("statecol", statecol); args.Add("CurrentUserID", CurrentUserID); args.Add("listSql", listSql); args.Add("listParameters", listParameters); args.Add("listCommandType", listCommandType); args.Add("tag", tag); return(ProjAgent.ProjExec(ExecType.PLMHelper, args)); }