public async Task <bool> EditWelcomePackReceiverAsync(WelcomePackReceiverDTO welcomePackReceiver) { var path = Properties.Resources.editWelcomePackReceiverPath; var result = await _apiHelper.Put(path, welcomePackReceiver); return(result != null && result.ResponseType == ResponseType.Success); }
public void EditWelcomePackReceiver(WelcomePackReceiverDTO welcomePackReceiverDTO) { var welcomePackReceiver = MapperExtension.mapper.Map <WelcomePackReceiverDTO, WelcomePackReceiver>(welcomePackReceiverDTO); _db.Entry(_db.WelcomePackReceivers.Find(welcomePackReceiverDTO.WelcomePackReceiverId)).CurrentValues.SetValues(welcomePackReceiver); _db.SaveChanges(); }
public void AddWelcomePackReceiver(WelcomePackReceiverDTO welcomePackReceiverDTO) { var welcomePackReceiver = MapperExtension.mapper.Map <WelcomePackReceiverDTO, WelcomePackReceiver>(welcomePackReceiverDTO); _db.WelcomePackReceivers.Add(welcomePackReceiver); _db.SaveChanges(); }
private async void Button_Add(object sender, RoutedEventArgs e) { ProgressSpin.IsActive = true; if (ValidateForm()) { using (IWelcomePackCore core = new WelcomePackCore()) { bool result = false; var guestModel = new WelcomePackReceiverDTO() { FirstName = FirstNameBox.Text, LastName = LastNameBox.Text, Type = TypeNameBox.Text, ConferenceId = UserCredentials.Conference.ConferenceId }; result = await core.AddWelcomePackReceiverAsync(guestModel); if (result) { MessageBox.Show("Success"); Close(); } else { MessageBox.Show("Failure"); } } } else { MessageBox.Show("Form invalid"); } }
public bool EditWelcomePackReceiver(WelcomePackReceiverDTO welcomepackreceiver) { try { _repository.EditWelcomePackReceiver(welcomepackreceiver); } catch { return(false); } return(true); }
public IHttpActionResult EditWelcomePackReceiver([FromBody] WelcomePackReceiverDTO receiver) { if (string.IsNullOrEmpty(receiver.Type)) { return(BadRequest()); } if (_bll.EditWelcomePackReceiver(receiver)) { return(Ok()); } return(InternalServerError()); }