public void AddUserDevice(AddUserDeviceRequestModel model)
 {
     _dbContext.MltpUserDevice.Add(new MltpUserDevice
     {
         AppId        = model.AppId,
         CreateDate   = DateTime.Now,
         PhoneModel   = model.PhoneModel,
         PhoneVersion = model.PhoneVersion,
         Platform     = model.Platform,
         UserId       = model.UserId
     });
     _dbContext.SaveChanges();
 }
        public async Task <ResponseItem> AddUserDevice(AddUserDeviceRequestModel model)
        {
            HttpClient client = await GetClient();

            string url = ApiConfiguration.WebApiUrl + "Common/" + "AddUserDevice";

            var responce = await client.PostAsync(url,
                                                  new StringContent(JsonConvert.SerializeObject(model),
                                                                    Encoding.UTF8, "application/json"));

            var mobileResult = await responce.Content.ReadAsStringAsync();

            var result = JsonConvert.DeserializeObject <ResponseItem>(mobileResult);

            return(result);
        }
        public ResponseItem AddUserDevice(AddUserDeviceRequestModel model)
        {
            ResponseItem result = new ResponseItem();

            result.Result = true;
            try
            {
                _userWf.AddUserDevice(model);
                result.Message = "Success";
            }
            catch (System.Exception ex)
            {
                result.Result  = false;
                result.Message = ex.Message;
            }

            return(result);
        }
Esempio n. 4
0
 public void AddUserDevice(AddUserDeviceRequestModel model)
 {
     _userUow.AddUserDevice(model);
 }