예제 #1
0
 private void RebindBookingData()
 {
     if (_seletedCustomerId > 0)
     {
         Globals.IsBusy = true;
         DataServiceHelper.ListBookingAsync(Globals.UserLogin.UserOrganisationId, null, null, null, null, null, _seletedCustomerId, null, null, null, ListBookingCompleted);
     }
 }
예제 #2
0
        private void RebindBookingData()
        {
            int?siteId = null;

            if (ucSitePicker.SiteId > 0)
            {
                siteId = ucSitePicker.SiteId;
            }


            DateTime?fromDate = null;

            if (uiDateFrom.SelectedDate.HasValue)
            {
                fromDate = uiDateFrom.SelectedDate.Value;
            }
            DateTime?toDate = null;

            if (uiDateTo.SelectedDate.HasValue)
            {
                toDate = uiDateTo.SelectedDate.Value;
            }

            string statusIds = string.Empty;

            if (chkNew.IsChecked == true)
            {
                statusIds += ((int)BookingStatus.New).ToString() + ",";
            }
            if (chkProcessing.IsChecked == true)
            {
                statusIds += ((int)BookingStatus.Processing).ToString() + ",";
            }
            if (chkContract.IsChecked == true)
            {
                statusIds += ((int)BookingStatus.Contract).ToString() + ",";
            }
            if (chkCancelled.IsChecked == true)
            {
                statusIds += ((int)BookingStatus.Cancelled).ToString() + ",";
            }

            string customer = txtCustomer.Text;

            if (!string.IsNullOrEmpty(customer))
            {
                customer = customer.Trim();
            }
            else
            {
                customer = null;
            }

            if (!string.IsNullOrEmpty(statusIds))
            {
                statusIds = statusIds.Substring(0, statusIds.Length - 1);
            }
            else
            {
                statusIds = null;
            }

            Globals.IsBusy = true;
            DataServiceHelper.ListBookingAsync(Globals.UserLogin.UserOrganisationId, siteId, null, null, null, statusIds, null,
                                               customer, fromDate, toDate, ListBookingCompleted);
        }