示例#1
0
        protected async Task HandleValidSubmit()
        {
            EventDetailViewModel.CategoryId = Guid.Parse(SelectedCategoryId);
            ApiResponse <Guid> response;

            if (SelectedEventId == Guid.Empty)
            {
                response = await EventDataService.CreateEvent(EventDetailViewModel);
            }
            else
            {
                response = await EventDataService.UpdateEvent(EventDetailViewModel);
            }
            HandleResponse(response);
        }
示例#2
0
        private void button4_Click(object sender, EventArgs e)
        {
            EventDataService eventDataService = new EventDataService();
            int result = eventDataService.UpdateEvent(Upd_EventName.Text, Upd_Importance.Text, Convert.ToInt32(Upd_EventID.Text), usingUserId);

            if (result > 0)
            {
                MessageBox.Show("Event Updated Succesfully!");

                Upd_EventID.Text         = Upd_EventName.Text = Upd_Importance.Text = null;
                eventListView.DataSource = eventDataService.GetEventList(this.usingUserId);
            }
            else
            {
                MessageBox.Show("Sorry There Was An Error!");
                Upd_EventID.Text         = Upd_EventName.Text = Upd_Importance.Text = null;
                eventListView.DataSource = eventDataService.GetEventList(this.usingUserId);
            }
        }