Example #1
0
        /// <summary>
        /// Read workflows
        /// </summary>
        /// <param name="ado"></param>
        /// <param name="dto"></param>
        /// <param name="ccnUsername"></param>
        /// <returns></returns>
        internal ADO_readerOutput Read(ADO ado, Workflow_DTO dto, string ccnUsername, string rqsCode = null)
        {
            ADO_readerOutput output = new ADO_readerOutput();

            var inputParams = new List <ADO_inputParams>()
            {
                new ADO_inputParams()
                {
                    name = "@RlsCode", value = dto.RlsCode
                },
                new ADO_inputParams()
                {
                    name = "@CcnUsername", value = ccnUsername
                }
            };

            inputParams.Add(new ADO_inputParams()
            {
                name = "@WrqCurrentRequestOnly", value = dto.WrqCurrentFlagOnly
            });

            if (rqsCode != null)
            {
                inputParams.Add(new ADO_inputParams()
                {
                    name = "@RqsCode", value = rqsCode
                });
            }

            //Call the stored procedure
            output = ado.ExecuteReaderProcedure("Workflow_Read", inputParams);

            //Read the result of the call to the database
            if (output.hasData)
            {
                Log.Instance.Debug("Data found");
            }
            else
            {
                //No data found
                Log.Instance.Debug("No data found");
            }

            //return the list of entities that have been found
            return(output);
        }
Example #2
0
        internal Workflow_DTO Populate(ADO ado, Workflow_DTO dto, string ccnUsername)
        {
            Workflow_ADO     wAdo   = new Workflow_ADO();
            ADO_readerOutput reader = wAdo.Read(ado, dto, ccnUsername, "PUBLISH");

            if (!reader.hasData)
            {
                return(dto);
            }

            return(new Workflow_DTO()
            {
                WrqDatetime = DataAdaptor.ReadDateTime(reader.data[0].WrqDatetime),
                WrqExceptionalFlag = DataAdaptor.ReadBool(reader.data[0].WrqExceptionalFlag),
                WrqReservationFlag = DataAdaptor.ReadBool(reader.data[0].WrqReservationFlag),
                WrqArchiveFlag = DataAdaptor.ReadBool(reader.data[0].WrqArchiveFlag),
                WrqExperimentalFlag = DataAdaptor.ReadBool(reader.data[0].WrqExperimentalFlag)
            });
        }
Example #3
0
        internal ADO_readerOutput ReadPendingLive(ADO ado, string ccnUsername, Workflow_DTO dto)
        {
            ADO_readerOutput output = new ADO_readerOutput();

            var inputParams = new List <ADO_inputParams>()
            {
                new ADO_inputParams()
                {
                    name = "@CcnUsername", value = ccnUsername
                },
                new ADO_inputParams()
                {
                    name = "@LngIsoCode", value = dto.LngIsoCode
                },
                new ADO_inputParams()
                {
                    name = "@LngIsoCodeDefault", value = Configuration_BSO.GetCustomConfig("language.iso.code")
                }
            };

            if (dto.RlsCode != default(int))
            {
                inputParams.Add(new ADO_inputParams()
                {
                    name = "@RlsCode", value = dto.RlsCode
                });
            }

            //Call the stored procedure
            output = ado.ExecuteReaderProcedure("Workflow_ReadPendingLive", inputParams);



            //return the list of entities that have been found
            return(output);
        }