Exemplo n.º 1
0
        /// <summary>
        /// Find method.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Language Find(int id)
        {
            var langDac = new LanguageDAC();
            var result  = langDac.SelectById(id);

            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Find by language culture
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Language FindByLangCulture(string langcult)
        {
            var langDac = new LanguageDAC();
            var result  = langDac.SelectByLanguageCulture(langcult);

            return(result);
        }
Exemplo n.º 3
0
        public bool Insert(string LanguageCode, string Name)
        {
            LanguageDAC languageComponent = new LanguageDAC();
            int         LanguageId        = 0;

            return(languageComponent.InsertNewLanguage(ref LanguageId, LanguageCode, Name));
        }
Exemplo n.º 4
0
        /// <summary>
        /// FindAll method.
        /// </summary>
        /// <returns></returns>
        public List <Language> All()
        {
            var langDac = new LanguageDAC();
            var result  = langDac.Select();

            return(result);
        }
Exemplo n.º 5
0
        public List <Language> GetAll()
        {
            LanguageDAC     _languageComponent = new LanguageDAC();
            IDataReader     reader             = _languageComponent.GetAllLanguage().CreateDataReader();
            List <Language> _languageList      = new List <Language>();

            while (reader.Read())
            {
                if (_languageList == null)
                {
                    _languageList = new List <Language>();
                }
                Language _language = new Language();
                if (reader["LanguageId"] != DBNull.Value)
                {
                    _language.LanguageId = Convert.ToInt32(reader["LanguageId"]);
                }
                if (reader["LanguageCode"] != DBNull.Value)
                {
                    _language.LanguageCode = Convert.ToString(reader["LanguageCode"]);
                }
                if (reader["Name"] != DBNull.Value)
                {
                    _language.Name = Convert.ToString(reader["Name"]);
                }
                _language.NewRecord = false;
                _languageList.Add(_language);
            }
            reader.Close();
            return(_languageList);
        }
Exemplo n.º 6
0
        public Language GetByCode(string LanguageCode)
        {
            LanguageDAC _languageComponent = new LanguageDAC();
            IDataReader reader             = _languageComponent.GetByCodeLanguage(LanguageCode);
            Language    _language          = null;

            while (reader.Read())
            {
                _language = new Language();
                if (reader["LanguageId"] != DBNull.Value)
                {
                    _language.LanguageId = Convert.ToInt32(reader["LanguageId"]);
                }
                if (reader["LanguageCode"] != DBNull.Value)
                {
                    _language.LanguageCode = Convert.ToString(reader["LanguageCode"]);
                }
                if (reader["Name"] != DBNull.Value)
                {
                    _language.Name = Convert.ToString(reader["Name"]);
                }
                _language.NewRecord = false;
            }
            reader.Close();
            return(_language);
        }
Exemplo n.º 7
0
        public bool Insert(Language language)
        {
            int         autonumber        = 0;
            LanguageDAC languageComponent = new LanguageDAC();
            bool        endedSuccessfuly  = languageComponent.InsertNewLanguage(ref autonumber, language.LanguageCode, language.Name);

            if (endedSuccessfuly)
            {
                language.LanguageId = autonumber;
            }
            return(endedSuccessfuly);
        }
Exemplo n.º 8
0
        /// Esta abstracciones están acá si quieren poner los datos en el servicio REST
        #region Abstracciones de Datos
        private static Language ObtenerIdioma(string languageCulture)
        {
            LanguageDAC languageDAC = new LanguageDAC();

            return(languageDAC.SelectByLanguageCulture(languageCulture));
        }
Exemplo n.º 9
0
        /// <summary>
        /// Update method.
        /// </summary>
        /// <param name="lang"></param>
        public void Edit(Language lang)
        {
            var langDac = new LanguageDAC();

            langDac.UpdateById(lang);
        }
Exemplo n.º 10
0
        /// <summary>
        /// Delete method.
        /// </summary>
        /// <param name="id"></param>
        public void Remove(int id)
        {
            var langDac = new LanguageDAC();

            langDac.DeleteById(id);
        }
Exemplo n.º 11
0
        /// <summary>
        /// Add method.
        /// </summary>
        /// <param name="lang"></param>
        /// <returns></returns>
        public Language Add(Language lang)
        {
            var langDac = new LanguageDAC();

            return(langDac.Create(lang));
        }
Exemplo n.º 12
0
        public bool Update(string LanguageCode, string Name, int Original_LanguageId)
        {
            LanguageDAC languageComponent = new LanguageDAC();

            return(languageComponent.UpdateLanguage(LanguageCode, Name, Original_LanguageId));
        }
Exemplo n.º 13
0
        public bool Update(Language language, int old_languageId)
        {
            LanguageDAC languageComponent = new LanguageDAC();

            return(languageComponent.UpdateLanguage(language.LanguageCode, language.Name, old_languageId));
        }
Exemplo n.º 14
0
        public int UpdateDataset(System.Data.DataSet dataset)
        {
            LanguageDAC languagecomponent = new LanguageDAC();

            return(languagecomponent.UpdateDataset(dataset));
        }
Exemplo n.º 15
0
        public void Delete(int Original_LanguageId)
        {
            LanguageDAC languageComponent = new LanguageDAC();

            languageComponent.DeleteLanguage(Original_LanguageId);
        }