コード例 #1
0
        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);
        }
コード例 #2
0
        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();
        }
コード例 #3
0
        public void AddWelcomePackReceiver(WelcomePackReceiverDTO welcomePackReceiverDTO)
        {
            var welcomePackReceiver = MapperExtension.mapper.Map <WelcomePackReceiverDTO, WelcomePackReceiver>(welcomePackReceiverDTO);

            _db.WelcomePackReceivers.Add(welcomePackReceiver);
            _db.SaveChanges();
        }
コード例 #4
0
ファイル: GuestAdd.xaml.cs プロジェクト: 2644783865/ssd-cms
        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");
            }
        }
コード例 #5
0
ファイル: WelcomePackBLL.cs プロジェクト: 2644783865/ssd-cms
 public bool EditWelcomePackReceiver(WelcomePackReceiverDTO welcomepackreceiver)
 {
     try
     {
         _repository.EditWelcomePackReceiver(welcomepackreceiver);
     }
     catch
     {
         return(false);
     }
     return(true);
 }
コード例 #6
0
 public IHttpActionResult EditWelcomePackReceiver([FromBody] WelcomePackReceiverDTO receiver)
 {
     if (string.IsNullOrEmpty(receiver.Type))
     {
         return(BadRequest());
     }
     if (_bll.EditWelcomePackReceiver(receiver))
     {
         return(Ok());
     }
     return(InternalServerError());
 }