예제 #1
0
        public async Task <ApiResult> Insert(InsertEvent request)
        {
            request.CompanyUid = await _currentCompanyProvider.GetCompanyUid();

            request.UserUid = _currentUserProvider.GetUserUid();

            return(await _mediator.Send(request));
        }
예제 #2
0
        internal async Task InsertAsync(InsertEvent insertEvent)
        {
            var response = await _container.CreateItemAsync(JObject.Parse(insertEvent.JsonEntity), new PartitionKey(insertEvent.EntityPartitionKey));

            if (response.StatusCode != HttpStatusCode.Created)
            {
                throw new Exception($"Insert error: ({response.StatusCode})");
            }
        }
예제 #3
0
 protected override void InsertItem(int index, T item)
 {
     if (InsertEvent != null)
     {
         if (!InsertEvent.Invoke(index, item))
         {
             return;
         }
     }
     base.InsertItem(index, item);
 }
예제 #4
0
 public CreateEvent(string issueId = null)
 {
     InitializeComponent();
     if (LoggedInUser.userType.Equals(Constants.UserType.PUBLIC) || LoggedInUser.userType.Equals(Constants.UserType.AUTHORITY))
     {
         base.OnBackButtonPressed();
     }
     this.IssueID     = issueId;
     aPIService       = RestService.For <IAPIService>(Constants.mongoDBBaseUrl);
     insertEvent      = new InsertEvent();
     newEventResponse = new Event();
 }
예제 #5
0
        public static void WriteOfflineEvent(InsertEvent eventJson)
        {
            if (eventJson == null)
            {
                return;
            }
            List <InsertEvent> eventList = new List <InsertEvent> {
            };

            if (Application.Current.Properties.ContainsKey(Constants.mongoDBofflineEvents))
            {
                eventList = (List <InsertEvent>)Application.Current.Properties[Constants.mongoDBofflineEvents];
            }
            eventList.Add(eventJson);
            Application.Current.Properties[Constants.mongoDBofflineEvents] = null;
            Application.Current.Properties[Constants.mongoDBofflineEvents] = JsonConvert.SerializeObject(eventList);
            Application.Current.SavePropertiesAsync();
        }
예제 #6
0
 public void OnInsert(object sender, CollectionChangeEventArgs e)
 {
     InsertEvent?.Invoke(sender, e);
 }
예제 #7
0
        public async Task PostReminder(Reminder reminder)
        {
            await _reminderTable.InsertAsync(reminder);

            InsertEvent?.Invoke(reminder);
        }
예제 #8
0
 public override Task Handle(InsertEvent <User> p_event)
 {
     return(Task.CompletedTask);
 }
예제 #9
0
        private void insert(int index, int actionId)
        {
            _actionArray[index] = actionId;

            InsertEvent.Invoke(index, _actionArray[index]);
        }