Пример #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();
            }
        }
Пример #2
0
        /// <summary>
        /// Execute
        /// </summary>
        /// <returns></returns>
        protected override bool Execute()
        {
            //Validation of parameters and user have been successful. We may now proceed to read from the database
            var adoCopyright = new Copyright_ADO();

            //Copyrights are returned as an ADO result
            ADO_readerOutput result = adoCopyright.Read(Ado, DTO);

            if (!result.hasData)
            {
                return(false);
            }

            Response.data = result.data;

            return(true);
        }