示例#1
0
        public bool Insert(AbstractAuthors abstractauthors)
        {
            int autonumber = 0;
            AbstractAuthorsDAC abstractauthorsComponent = new AbstractAuthorsDAC();
            bool endedSuccessfuly = abstractauthorsComponent.InsertNewAbstractAuthors(ref autonumber, abstractauthors.AbstractId, abstractauthors.FirstName, abstractauthors.FamilyName, abstractauthors.Title, abstractauthors.Degree, abstractauthors.Email, abstractauthors.Address, abstractauthors.PhoneNumber, abstractauthors.AffilitationDepartment, abstractauthors.AffilitationInstitutionHospital, abstractauthors.AffilitationCity, abstractauthors.AffilitationCountry, abstractauthors.Country, abstractauthors.POBox, abstractauthors.ZipCode, abstractauthors.City, abstractauthors.IsMainAuthor, abstractauthors.PhoneNumberAreaCode);

            if (endedSuccessfuly)
            {
                abstractauthors.AbstractAuthorId = autonumber;
            }
            return(endedSuccessfuly);
        }
示例#2
0
        public AbstractAuthors GetByID(int _abstractAuthorId)
        {
            AbstractAuthorsDAC _abstractAuthorsComponent = new AbstractAuthorsDAC();
            IDataReader        reader           = _abstractAuthorsComponent.GetByIDAbstractAuthors(_abstractAuthorId);
            AbstractAuthors    _abstractAuthors = null;

            while (reader.Read())
            {
                _abstractAuthors = new AbstractAuthors();
                if (reader["AbstractAuthorId"] != DBNull.Value)
                {
                    _abstractAuthors.AbstractAuthorId = Convert.ToInt32(reader["AbstractAuthorId"]);
                }
                if (reader["AbstractId"] != DBNull.Value)
                {
                    _abstractAuthors.AbstractId = Convert.ToInt32(reader["AbstractId"]);
                }
                if (reader["FirstName"] != DBNull.Value)
                {
                    _abstractAuthors.FirstName = Convert.ToString(reader["FirstName"]);
                }
                if (reader["FamilyName"] != DBNull.Value)
                {
                    _abstractAuthors.FamilyName = Convert.ToString(reader["FamilyName"]);
                }
                if (reader["Title"] != DBNull.Value)
                {
                    _abstractAuthors.Title = Convert.ToString(reader["Title"]);
                }
                if (reader["Degree"] != DBNull.Value)
                {
                    _abstractAuthors.Degree = Convert.ToString(reader["Degree"]);
                }
                if (reader["Email"] != DBNull.Value)
                {
                    _abstractAuthors.Email = Convert.ToString(reader["Email"]);
                }
                if (reader["Address"] != DBNull.Value)
                {
                    _abstractAuthors.Address = Convert.ToString(reader["Address"]);
                }
                if (reader["PhoneNumber"] != DBNull.Value)
                {
                    _abstractAuthors.PhoneNumber = Convert.ToString(reader["PhoneNumber"]);
                }
                if (reader["AffilitationDepartment"] != DBNull.Value)
                {
                    _abstractAuthors.AffilitationDepartment = Convert.ToString(reader["AffilitationDepartment"]);
                }
                if (reader["AffilitationInstitutionHospital"] != DBNull.Value)
                {
                    _abstractAuthors.AffilitationInstitutionHospital = Convert.ToString(reader["AffilitationInstitutionHospital"]);
                }
                if (reader["AffilitationCity"] != DBNull.Value)
                {
                    _abstractAuthors.AffilitationCity = Convert.ToString(reader["AffilitationCity"]);
                }
                if (reader["AffilitationCountry"] != DBNull.Value)
                {
                    _abstractAuthors.AffilitationCountry = Convert.ToString(reader["AffilitationCountry"]);
                }
                if (reader["Country"] != DBNull.Value)
                {
                    _abstractAuthors.Country = Convert.ToString(reader["Country"]);
                }
                if (reader["POBox"] != DBNull.Value)
                {
                    _abstractAuthors.POBox = Convert.ToString(reader["POBox"]);
                }
                if (reader["ZipCode"] != DBNull.Value)
                {
                    _abstractAuthors.ZipCode = Convert.ToString(reader["ZipCode"]);
                }
                if (reader["City"] != DBNull.Value)
                {
                    _abstractAuthors.City = Convert.ToString(reader["City"]);
                }
                if (reader["IsMainAuthor"] != DBNull.Value)
                {
                    _abstractAuthors.IsMainAuthor = Convert.ToBoolean(reader["IsMainAuthor"]);
                }
                if (reader["PhoneNumberAreaCode"] != DBNull.Value)
                {
                    _abstractAuthors.PhoneNumberAreaCode = Convert.ToString(reader["PhoneNumberAreaCode"]);
                }
                _abstractAuthors.NewRecord = false;
            }
            reader.Close();
            return(_abstractAuthors);
        }
示例#3
0
        public bool Update(AbstractAuthors abstractauthors, int old_abstractAuthorId)
        {
            AbstractAuthorsDAC abstractauthorsComponent = new AbstractAuthorsDAC();

            return(abstractauthorsComponent.UpdateAbstractAuthors(abstractauthors.AbstractId, abstractauthors.FirstName, abstractauthors.FamilyName, abstractauthors.Title, abstractauthors.Degree, abstractauthors.Email, abstractauthors.Address, abstractauthors.PhoneNumber, abstractauthors.AffilitationDepartment, abstractauthors.AffilitationInstitutionHospital, abstractauthors.AffilitationCity, abstractauthors.AffilitationCountry, abstractauthors.Country, abstractauthors.POBox, abstractauthors.ZipCode, abstractauthors.City, abstractauthors.IsMainAuthor, abstractauthors.PhoneNumberAreaCode, old_abstractAuthorId));
        }