Ejemplo n.º 1
0
        public int DeleteTranslation(string translationKey)
        {
            int i = 0;

            using (MySqlCommand command = new MySqlCommand())
            {
                i = ExecuteNonQuery(TranslationStringsMySql.DeleteTranslation(translationKey));
            }

            return(i);
        }
Ejemplo n.º 2
0
        public Translation UpdateTranslation(Translation value)
        {
            DataTable   dt          = new DataTable();
            Translation translation = new Translation();

            using (MySqlCommand command = new MySqlCommand())
            {
                dt = GetMultipleQuery(TranslationStringsMySql.UpdateTranslation(value));
            }
            foreach (DataRow ms in dt.Rows)
            {
                translation = Translation.ToObject(ms);
            }

            return(translation);
        }
Ejemplo n.º 3
0
        public List <Translation> GetAllTranslations()
        {
            DataTable          dt             = new DataTable();
            List <Translation> arrTranslation = new List <Translation>();

            using (MySqlCommand command = new MySqlCommand())
            {
                dt = GetMultipleQuery(TranslationStringsMySql.GetAllTranslation());
            }

            foreach (DataRow ms in dt.Rows)
            {
                arrTranslation.Add(Translation.ToObject(ms));
            }

            return(arrTranslation);
        }
Ejemplo n.º 4
0
        public Translation GetTranslationByKey(string key)
        {
            DataTable dt = new DataTable();

            if (key == null || key.Equals(""))
            {
                throw new ArgumentOutOfRangeException();
            }
            Translation translation = new Translation();

            using (MySqlCommand command = new MySqlCommand())
            {
                dt = GetMultipleQuery(TranslationStringsMySql.GetTranslationByKey(key));
            }

            foreach (DataRow ms in dt.Rows)
            {
                translation = Translation.ToObject(ms);
            }

            return(translation);
        }