public List <FactoryStatistic> GetFactoryStatistics(DateTime?from = null, DateTime?to = null) { List <FactoryStatistic> result = new List <FactoryStatistic>(); if (!from.HasValue) { from = DateTime.Now.AddDays(-1); } if (!to.HasValue) { to = DateTime.Now.AddDays(1); } try { OracleDao dao = new OracleDao(Configs.ConnectionString); OracleCommand command = dao.GetSprocCommand("idemia.SP_GETFactoryStats"); command.Parameters.Add(dao.CreateParameter("PFROM", from)); command.Parameters.Add(dao.CreateParameter("PTO", to)); command.Parameters.Add(dao.CreateOutputParameter("RESULTSET", OracleDbType.RefCursor)); result = dao.GetCBOList <FactoryStatistic>(command); } catch (Exception ex) { } return(result); }
public List <RequestStatus> GetRequestStatuses(int?Id = null, string name = null, int?StartIndex = 0, int PageSize = 50) { List <RequestStatus> dtos = new List <RequestStatus>(); try { OracleDao dao = new OracleDao(Configs.ConnectionString); OracleCommand command = dao.GetSprocCommand("idemia.SP_GETRequestStatuses"); command.Parameters.Add(dao.CreateParameter("pID", Id)); command.Parameters.Add(dao.CreateParameter("PNAME", name)); command.Parameters.Add(dao.CreateParameter("pSTARTINDEX", StartIndex)); command.Parameters.Add(dao.CreateParameter("pPageSize", PageSize)); command.Parameters.Add(dao.CreateOutputParameter("RESULTSET", OracleDbType.RefCursor)); if (command.Connection.State == System.Data.ConnectionState.Closed) { command.Connection.Open(); } dtos = dao.GetCBOList <RequestStatus>(command); } //end try catch (Exception ex) { } return(dtos); }
public List <User> GetUsers(int?Id = null, string name = null, int?StartIndex = 0, int PageSize = 50) { List <User> dtos = new List <User>(); try { OracleDao dao = new OracleDao(Configs.ConnectionString); OracleCommand command = dao.GetSprocCommand("idemia.SP_GETUsers"); command.Parameters.Add(dao.CreateParameter("pID", Id)); command.Parameters.Add(dao.CreateParameter("PNAME", name)); command.Parameters.Add(dao.CreateParameter("pSTARTINDEX", StartIndex)); command.Parameters.Add(dao.CreateParameter("pPageSize", PageSize)); command.Parameters.Add(dao.CreateOutputParameter("RESULTSET", OracleDbType.RefCursor)); dtos = dao.GetCBOList <User>(command); }//end try catch (Exception ex) { } return(dtos); }