Esempio n. 1
0
        internal Copyright_DTO_Create ReadFromValue(string CprValue)
        {
            ADO Ado = new ADO("defaultConnection");

            try
            {
                Copyright_DTO_Create dto = new Copyright_DTO_Create();

                Copyright_ADO      cAdo    = new Copyright_ADO();
                Copyright_DTO_Read readDTO = new Copyright_DTO_Read();
                readDTO.CprValue = CprValue;
                var retval = cAdo.Read(Ado, readDTO);
                if (retval.hasData)
                {
                    dto.CprCode  = retval.data[0].CprCode;
                    dto.CprValue = CprValue;
                    dto.CprUrl   = retval.data[0].CprUrl;
                }

                return(dto);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                Ado.Dispose();
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Reads a Copyright
        /// </summary>
        /// <param name="ado"></param>
        /// <param name="copyright"></param>
        /// <returns></returns>
        internal ADO_readerOutput Read(ADO ado, Copyright_DTO_Read copyright)
        {
            ADO_readerOutput output = new ADO_readerOutput();

            List <ADO_inputParams> paramList = new List <ADO_inputParams>();

            if (!string.IsNullOrEmpty(copyright.CprCode))
            {
                paramList.Add(new ADO_inputParams()
                {
                    name = "@CprCode", value = copyright.CprCode
                });
            }

            if (!string.IsNullOrEmpty(copyright.CprValue))
            {
                paramList.Add(new ADO_inputParams()
                {
                    name = "@CprValue", value = copyright.CprValue
                });
            }


            //Call the stored procedure
            output = ado.ExecuteReaderProcedure("System_Settings_Copyright_Read", paramList);

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