public void OnClear(object sender, EventArgs e) { currentWorkOrderId = 0; currentWorkOrderPaymentId = 0; searchedForPerson = null; sellerId = 0; customerId = 0; deliveryUserId = 0; deliveryRecipientId = 0; Buyer.Text = String.Empty; WorkOrderDate.Date = DateTime.Now; Seller.SelectedIndex = 1; DeliverTo.Text = ""; DeliveryType.SelectedIndex = 0; //ServiceType.SelectedIndex = 0; this.workOrderList.Clear(); this.arrangementList.Clear(); this.notInInventory.Clear(); this.workOrderInventoryList.Clear(); this.InventoryItemsListView.ItemsSource = workOrderList; }
private void CustomerListView_ItemSelected(object sender, SelectedItemChangedEventArgs e) { ListView lv = sender as ListView; if (lv != null) { PersonAndAddressDTO item = lv.SelectedItem as PersonAndAddressDTO; if (item != null) { FirstName.Text = item.Person.first_name; LastName.Text = item.Person.last_name; Phone.Text = item.Person.phone_primary; Email.Text = item.Person.email; Address.Text = item.Address != null ? item.Address.street_address : String.Empty; Address2.Text = item.Address != null ? item.Address.unit_apt_suite : String.Empty; City.Text = item.Address != null ? item.Address.city : String.Empty; State.SelectedItem = item.Address != null ? item.Address.state : String.Empty; Zip.Text = item.Address != null ? item.Address.zipcode : String.Empty; History.IsEnabled = true; Containers.IsEnabled = true; currentCustomerId = item.Person.person_id; } } }
private void Clear_Clicked(object sender, EventArgs e) { searchedForPerson = null; CustomerName.Text = String.Empty; SiteServiceFromDate.Date = DateTime.MinValue; SiteServiceToDate.Date = DateTime.MinValue; ObservableCollection <WorkOrderInventoryMapDTO> list1 = new ObservableCollection <WorkOrderInventoryMapDTO>(); InventoryList.ItemsSource = list1; }
public TabbedArrangementPage(bool forWorkOrder = false, PersonAndAddressDTO customer = null) { if (customer == null) { customer = new PersonAndAddressDTO(); //don't pass null } this.customer = customer; this.forWorkOrder = forWorkOrder; Initialize(); }
void GetSearchedDeliveryRecipient() { searchedForDeliveryRecipient = ((App)App.Current).searchedForDeliveryRecipient; if (searchedForDeliveryRecipient != null && searchedForDeliveryRecipient.Person.person_id != 0) { DeliverTo.Text = searchedForDeliveryRecipient.Person.CustomerName; ((App)App.Current).searchedForDeliveryRecipient = null; deliveryRecipientId = searchedForDeliveryRecipient.Person.person_id; } }
protected override void OnAppearing() { base.OnAppearing(); searchedForPerson = ((App)App.Current).searchedForPerson; if (searchedForPerson != null && searchedForPerson.Person.person_id != 0) { CustomerName.Text = searchedForPerson.Person.CustomerName; ((App)App.Current).searchedForPerson = null; } }
public TabbedArrangementPage(AddArrangementRequest aar, PersonAndAddressDTO customer = null) { if (customer == null) { customer = new PersonAndAddressDTO(); //don't pass null } this.customer = customer; this.forWorkOrder = true; this.aar = aar; Initialize(); }
void GetSearchedPerson() { if (((App)App.Current).searchedForPerson != null) { searchedForPerson = new PersonAndAddressDTO(); customerId = ((App)App.Current).searchedForPerson.Person.person_id; searchedForPerson.Person.person_id = ((App)App.Current).searchedForPerson.Person.person_id; searchedForPerson.Person.first_name = ((App)App.Current).searchedForPerson.Person.first_name; searchedForPerson.Person.last_name = ((App)App.Current).searchedForPerson.Person.last_name; Buyer.Text = searchedForPerson.Person.CustomerName; ((App)App.Current).searchedForPerson = null; } }
public void Initialize() { InitializeComponent(); MessagingCenter.Subscribe <PersonAndAddressDTO>(this, "SearchCustomer", (arg) => { searchedForPerson = arg as PersonAndAddressDTO; }); MessagingCenter.Subscribe <WorkOrderResponse>(this, "PaymentSuccess", (arg) => { OnClear(null, null); }); }
private void Containers_Clicked(object sender, EventArgs e) { if (currentCustomerId != 0l) { PersonAndAddressDTO p = customersOC.Where(a => a.Person.person_id == currentCustomerId).FirstOrDefault(); if (p.Person.person_id != 0) { if (!PageExists(typeof(CustomerContainerPage))) { Navigation.PushAsync(new CustomerContainerPage(p)); } } } }
private void Clear_Clicked(object sender, EventArgs e) { searchedForPerson = null; CustomerName.Text = String.Empty; WorkOrderFromDate.Date = DateTime.MinValue; WorkOrderToDate.Date = DateTime.MinValue; DeliveredBy.SelectedIndex = -1; WorkOrderPaid.SelectedIndex = -1; WorkOrderSiteService.SelectedIndex = -1; WorkOrderDelivery.SelectedIndex = -1; ObservableCollection <WorkOrderInventoryMapDTO> list1 = new ObservableCollection <WorkOrderInventoryMapDTO>(); InventoryList.ItemsSource = list1; }
public CustomerContainerPage(PersonAndAddressDTO person, bool forWorkOrder = false) { Person = person; this.forWorkOrder = forWorkOrder; InitializeComponent(); FirstName.Text = person.Person.first_name; LastName.Text = person.Person.last_name; Phone.Text = person.Person.phone_primary; //get data - bind to list view customerContainers = new List <CustomerContainerDTO>(); customerContainersOC = new ObservableCollection <CustomerContainerDTO>(); LoadCustomerContainerData(); }
protected override void OnAppearing() { base.OnAppearing(); WorkOrderInventoryItemDTO searchedForInventory = ((App)App.Current).searchedForInventory; if (searchedForInventory != null && searchedForInventory.InventoryId != 0) { if (!siteServiceInventoryList.Contains(searchedForInventory)) { searchedForInventory.Quantity = 1; siteServiceInventoryList.Add(searchedForInventory); ObservableCollection <WorkOrderInventoryItemDTO> list1 = new ObservableCollection <WorkOrderInventoryItemDTO>(); foreach (WorkOrderInventoryItemDTO wo in siteServiceInventoryList) { list1.Add(wo); } SiteServiceInventoryItemsListView.ItemsSource = list1; //SetWorkOrderSalesData(); ((App)App.Current).searchedForInventory = null; } } PersonAndAddressDTO searchedForCustomer = ((App)App.Current).searchedForPerson; if (searchedForCustomer != null && searchedForCustomer.Person.person_id != 0) { customerId = searchedForCustomer.Person.person_id; Customer.Text = searchedForCustomer.Person.CustomerName; ((App)App.Current).searchedForPerson = null; } }
public ArrangementFilterPage(ContentPage initiator, bool showArrangements = true) { Initiator = initiator; if (initiator is WorkOrderPage) { customer = ((WorkOrderPage)initiator).Customer; } this.showArrangements = showArrangements; InitializeComponent(); Type.SelectedIndexChanged += TypeCombo_SelectionChanged; Name.SelectedIndexChanged += NameCombo_SelectionChanged; Size.SelectedIndexChanged += SizeCombo_SelectionChanged; ArrangementInventoryList.ItemSelected += ArrangementInventoryList_ItemSelected; ((App)App.Current).GetInventoryTypes().ContinueWith(a => ShowTypes(a.Result)); }
public AddCustomerRequest(PersonAndAddressDTO customer) { Customer = customer; }
public string ComposeMissingEmail(PersonAndAddressDTO buyer) { string receiptHtml = String.Empty; if (String.IsNullOrEmpty(buyer.Person.first_name)) { buyer.Person.first_name = "missing"; } if (String.IsNullOrEmpty(buyer.Person.last_name)) { buyer.Person.last_name = "missing"; } if (String.IsNullOrEmpty(buyer.Person.street_address)) { buyer.Person.street_address = "missing"; if (buyer.Address != null) { if (!String.IsNullOrEmpty(buyer.Address.street_address)) { buyer.Person.street_address = buyer.Address.street_address; } } } if (String.IsNullOrEmpty(buyer.Person.city)) { buyer.Person.city = "missing"; if (buyer.Address != null) { if (!String.IsNullOrEmpty(buyer.Address.city)) { buyer.Person.city = buyer.Address.city; } } } if (String.IsNullOrEmpty(buyer.Person.zipcode)) { buyer.Person.zipcode = "missing"; if (buyer.Address != null) { if (!String.IsNullOrEmpty(buyer.Address.zipcode)) { buyer.Person.zipcode = buyer.Address.zipcode; } } } if (String.IsNullOrEmpty(buyer.Person.phone_primary)) { buyer.Person.phone_primary = "missing"; } receiptHtml = "<h1> Customer Missing Email </h1>" + "<div> Reach out to this customer and ask them if they'd like to add a valid email address </div>" + "<br/>" + "<div> Customer Information </div>" + "<div> First Name: " + buyer.Person.first_name + "</div>" + "<div> Last Name: " + buyer.Person.last_name + "</div>" + "<div> Address: " + buyer.Person.street_address + "</div>" + "<div> City: " + buyer.Person.city + "</div>" + "<div> Zip: " + buyer.Person.zipcode + "</div>" + "<div> Phone: " + buyer.Person.phone_primary + "</div>"; return(receiptHtml); }
public AddCustomerRequest() { Customer = new PersonAndAddressDTO(); }
public void LoadDeliveryRecipient(PersonAndAddressDTO arg) { searchedForDeliveryRecipient = arg; }
public GetCustomerResponse(PersonAndAddressDTO customer) { Customer = customer; }
//Load and possibly convert data into relevant data lists private void WorkOrderPaymentLoaded(WorkOrderResponse workOrder, WorkOrderPaymentDTO payment) { Device.BeginInvokeOnMainThread(() => { currentWorkOrderId = workOrder.WorkOrder.WorkOrderId; searchedForPerson = new PersonAndAddressDTO(); searchedForPerson.Person.person_id = workOrder.WorkOrder.CustomerId; customerId = searchedForPerson.Person.person_id; currentWorkOrderPaymentId = payment.WorkOrderPaymentId; if (currentWorkOrderPaymentId == 0) { Save.IsEnabled = true; Payment.IsEnabled = true; } else { if (workOrder.WorkOrder.Paid) { InventoryItemsListView.IsEnabled = false; Save.IsEnabled = false; Payment.IsEnabled = false; AddInventory.IsEnabled = false; } else { Save.IsEnabled = true; if (workOrder.WorkOrderList.Count == 0) { Payment.IsEnabled = false; } else { Payment.IsEnabled = true; } } } Buyer.Text = workOrder.WorkOrder.Buyer; sellerId = workOrder.WorkOrder.SellerId; Seller.SelectedIndex = ((App)App.Current).GetPickerIndex(Seller, workOrder.WorkOrder.SellerId); DeliveryType.SelectedIndex = workOrder.WorkOrder.DeliveryType; deliveryUserId = workOrder.WorkOrder.DeliveryUserId; DeliveryPerson.SelectedIndex = ((App)App.Current).GetPickerIndex(DeliveryPerson, workOrder.WorkOrder.DeliveryUserId); DeliveryDate.Date = workOrder.WorkOrder.DeliveryDate; deliveryRecipientId = workOrder.WorkOrder.DeliveryRecipientId; DeliverTo.Text = workOrder.WorkOrder.DeliverTo; WorkOrderDate.Date = workOrder.WorkOrder.CreateDate; workOrderList.Clear(); notInInventory = workOrder.NotInInventory; //convert between duplicate types - refactor foreach (var x in workOrder.WorkOrderList) { WorkOrderInventoryItemDTO dto = new WorkOrderInventoryItemDTO() { WorkOrderId = x.WorkOrderId, InventoryId = x.InventoryId, InventoryName = x.InventoryName, Quantity = x.Quantity, Size = x.Size, GroupId = x.GroupId }; workOrderInventoryList.Add(dto); } foreach (GetArrangementResponse ar in workOrder.Arrangements) { AddArrangementRequest aaReq = new AddArrangementRequest(); aaReq.Arrangement = ar.Arrangement; aaReq.Inventory = ar.Inventory; aaReq.ArrangementInventory = ar.ArrangementList; aaReq.GroupId = ar.Arrangement.ArrangementId; aaReq.NotInInventory = ar.NotInInventory; arrangementList.Add(aaReq); } RedrawInventoryList(); }); }
private void Initialize(TabbedWorkOrderPage tabParent) { InitializeComponent(); TabParent = tabParent; MessagingCenter.Subscribe <WorkOrderInventoryItemDTO>(this, "SearchInventory", (arg) => { searchedForInventory = arg; }); MessagingCenter.Subscribe <PersonAndAddressDTO>(this, "SearchCustomer", (arg) => { searchedForPerson = arg as PersonAndAddressDTO; }); MessagingCenter.Subscribe <PersonAndAddressDTO>(this, "SearchDeliveryRecipient", (arg) => { searchedForDeliveryRecipient = arg as PersonAndAddressDTO; }); orderType.Add(new KeyValuePair <int, string>(0, "Walk In")); orderType.Add(new KeyValuePair <int, string>(1, "Phone")); orderType.Add(new KeyValuePair <int, string>(2, "Email")); OrderType.ItemsSource = orderType; OrderType.SelectedIndex = 0; deliveryTypeList.Add(new KeyValuePair <long, string>(1, "Pickup")); deliveryTypeList.Add(new KeyValuePair <long, string>(2, "Delivery")); deliveryTypeList.Add(new KeyValuePair <long, string>(3, "Site Service")); DeliveryType.ItemsSource = deliveryTypeList; DeliveryType.SelectedIndex = 0; DeliverTo.Text = "Buyer"; buyerChoiceList.Add(new KeyValuePair <int, string>(0, "Pick one")); buyerChoiceList.Add(new KeyValuePair <int, string>(1, "Choose Existing")); buyerChoiceList.Add(new KeyValuePair <int, string>(2, "Create New")); BuyerChoice.ItemsSource = buyerChoiceList; BuyerChoice.SelectedIndex = 0; BuyerChoice.SelectedIndexChanged += BuyerChoice_SelectedIndexChanged; ((App)App.Current).GetUsers().ContinueWith(a => LoadUsers(a.Result)); Save.IsEnabled = true; Save.Clicked += OnSaveWorkOrder; //both buttons are disabled until the work order data is saved Payment.IsEnabled = false; MessagingCenter.Subscribe <WorkOrderResponse>(this, "PaymentSuccess", (arg) => { currentWorkOrderPaymentId = -1; Save.IsEnabled = EnableSave(); Payment.IsEnabled = EnablePayment(); AddInventory.IsEnabled = false; RedrawInventoryList(); //disable arrangement list view item qty text boxes and delete buttons }); }
private void PersonListView_ItemSelected(object sender, SelectedItemChangedEventArgs e) { ListView lv = sender as ListView; if (lv != null) { PersonAndAddressDTO p = new PersonAndAddressDTO(); person = lv.SelectedItem as PersonAndAddressDTO; p.Person.address_id = person.Person.address_id; p.Person.first_name = person.Person.first_name; p.Person.last_name = person.Person.last_name; p.Person.person_id = person.Person.person_id; p.Person.email = person.Person.email; p.Person.phone_primary = person.Person.phone_primary; if (p.Address != null && p.Address.address_id > 0) { p.Address.address_id = person.Address.address_id; p.Address.city = person.Address.city; p.Address.state = person.Address.state; p.Address.street_address = person.Address.street_address; p.Address.zipcode = person.Address.zipcode; } try { int searchedForPersonType = -1; //after we find out a few more things, create a base class for pages //that need to perform search operations if (Initiator as WorkOrderPage != null) { WorkOrderPage page = Initiator as WorkOrderPage; searchedForPersonType = page.SearchedForPersonType; } else if (Initiator as SiteServicePage != null) { SiteServicePage page = Initiator as SiteServicePage; searchedForPersonType = page.SearchedForPersonType; } else if (Initiator as SiteServiceReportPage != null) { SiteServiceReportPage page = Initiator as SiteServiceReportPage; searchedForPersonType = page.SearchedForPersonType; } if (searchedForPersonType == 0) { MessagingCenter.Send <PersonAndAddressDTO>(p, "SearchCustomer"); } else if (searchedForPersonType == 1) { MessagingCenter.Send <PersonAndAddressDTO>(p, "SearchDeliveryRecipient"); } } catch (Exception ex) { int debug = 1; } Navigation.PopAsync(); } }
public GetCustomerResponse() { Customer = new PersonAndAddressDTO(); }
public void LoadCustomer(PersonAndAddressDTO arg) { searchedForPerson = arg; }