public async Task <Responce <RegistrationDTO> > Register(string Name, string Email, string City, string Mobile, string Password, string ConfirmPassword, int CityId)
        {
            try
            {
                RegisterRequest registerRequest = new RegisterRequest();
                registerRequest.City            = City;
                registerRequest.Name            = Name.Trim();
                registerRequest.Email           = Email.Trim();
                registerRequest.PhoneNumber     = Mobile;
                registerRequest.Password        = Password.Trim();
                registerRequest.Cityid          = CityId;
                registerRequest.ConfirmPassword = ConfirmPassword.Trim();
                string Json   = JsonConvert.SerializeObject(registerRequest);
                var    result = await restapiHelper.PosyAsync <Responce <RegistrationDTO> >(EndPoint.Account.Register, Json);

                return(result);
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
Exemplo n.º 2
0
        public async Task <List <CitysModel> > GetCities(string UserId)
        {
            List <CitysModel> CityList = new List <CitysModel>();

            CityList = _cityRepo.GetItems();
            try
            {
                if (!CityList.AnyExtended() && _settings.IsOnline)
                {
                    var mobileRequesy = new MobileRequest()
                    {
                        UserId = UserId
                    };
                    string Json     = JsonConvert.SerializeObject(mobileRequesy);
                    var    responce = await restapiHelper.PosyAsync <Responce <List <CityDTO> > >(EndPoint.Complaint.GetCities, Json);

                    if (responce.Success == true)
                    {
                        CityList = responce.ResponeContent.Select(a => a.MapCityModel()).ToList();
                        _cityRepo.InsertOrReplaceAllWithChildren(CityList);
                    }
                    CityList = _cityRepo.GetItems();
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine($"ERROR On GetCities Call:{ex}");
            }
            return(CityList);
        }