private async Task <CustomerData> CustomerToData(Customer customer) { CustomerData data = new CustomerData(); data.iD = customer.ID; data.USER_ID = customer.USER_ID; data.Address = customer.ADDRESS; data.FirstName = customer.FIRST_NAME; data.LastName = customer.LAST_NAME; data.Phone_Num = customer.PHONE_NO; try { data.Credit_Card = Statics.Decrypt(customer.CREDIT_CARD_NUMBER, ENCRIPTION_PHRASE); } catch { data.Credit_Card = customer.CREDIT_CARD_NUMBER; } try { data.Image = ImageRestorer.GetBitmapFrom64baseString(customer.IMAGE); } catch (Exception) { data.Image = ImageRestorer.GetBitmapFrom64baseString(ImageRestorer.UnformatImage64BaseString(BASE_64_IMAGE_ABSENCE_IMAGE)); }//FormatException data = await UtilityClassUserTreatent(data, customer) as CustomerData; return(data); }
private async Task <AirlineCompanyData> AirlineCompanyToData(AirlineCompany airline) { return(await Task.Run(async() => { AirlineCompanyData data = new AirlineCompanyData(); data.iD = airline.ID; data.USER_ID = airline.USER_ID; data.Adorning = airline.ADORNING; data.AirlineName = airline.AIRLINE_NAME; data.BaseCountryName = (await _dao.GetOneById <Country>(airline.COUNTRY_CODE)).COUNTRY_NAME; try { data.Image = ImageRestorer.GetBitmapFrom64baseString(airline.IMAGE); } catch (Exception) { data.Image = ImageRestorer.GetBitmapFrom64baseString(ImageRestorer.UnformatImage64BaseString(BASE_64_IMAGE_ABSENCE_IMAGE)); } data = await UtilityClassUserTreatent(data, airline) as AirlineCompanyData; return data; })); }