public async Task <UserInfoEntity> UpdatePopulationStatus(string chatId, PopulationStatusEnum type, string input)
        {
            var info = await GetUserInfo(chatId);

            info.Resident         = input;
            info.PopulationStatus = type;
            await _context.SaveChangesAsync();

            return(info);
        }
Exemple #2
0
        public static PopulationStatusEnum?GetPopulationEnumByValue(string input)
        {
            var result = new PopulationStatusEnum();

            if (input == "مرکز استان")
            {
                result = PopulationStatusEnum.City;
            }
            else if (input == "شهرستان")
            {
                result = PopulationStatusEnum.Town;
            }
            else if (input == "روستا")
            {
                result = PopulationStatusEnum.Village;
            }

            return(result);
        }
Exemple #3
0
        public static string GetEnumValue(PopulationStatusEnum type)
        {
            var result = "";

            if (type == PopulationStatusEnum.City)
            {
                result = "مرکز استان";
            }
            else if (type == PopulationStatusEnum.Town)
            {
                result = "شهرستان";
            }
            else if (type == PopulationStatusEnum.Village)
            {
                result = "روستا";
            }

            return(result);
        }