Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }