/// <summary> /// Method to bind the autocomplete list /// </summary> /// <param name="pillsReminderModelCol"></param> private void BindPillsinAutoCompleteList(PillsReminderModelCol pillsReminderModelCol) { List <string> autoCompleteLst = new List <string>(); PillsReminderModel objPillsPillsReminderModel; foreach (var item in pillsReminderModelCol) { objPillsPillsReminderModel = new PillsReminderModel { PillName = item.PillName, NumberOfPills = item.NumberOfPills }; autoCompleteLst.Add(objPillsPillsReminderModel.PillName); } acbDrugSearch.ItemsSource = autoCompleteLst; }
/// <summary> /// Constructor /// </summary> public PillEditItemViewModel() { if (App.ObjBrandingResponse != null) { PrimaryColour = Utilities.GetColorFromHexa(App.ObjBrandingResponse.payload.branding_data.appearance.primary_colour); SecondaryColour = Utilities.GetColorFromHexa(App.ObjBrandingResponse.payload.branding_data.appearance.secondary_colour); FontColor = Utilities.GetColorFromHexa(App.ObjBrandingResponse.payload.branding_data.appearance.font_colour); } else { PrimaryColour = SecondaryColour = Utilities.GetColorFromHexa(RxConstants.PrimaryColourCode); FontColor = Utilities.GetColorFromHexa(RxConstants.FontColourCode); } App.IsEditCancelled = true; if (App.HeaderPillsReminder.Equals("daily morning")) { objPillsReminderModelToDaply = App.DailyMorningPillsCollection[App.SelectedIndexToEdit]; } if (App.HeaderPillsReminder.Equals("daily afternoon")) { objPillsReminderModelToDaply = App.DailyAfternoonPillsCollection[App.SelectedIndexToEdit]; } if (App.HeaderPillsReminder.Equals("daily evening")) { objPillsReminderModelToDaply = App.DailyEveningPillsCollection[App.SelectedIndexToEdit]; } if (App.HeaderPillsReminder.Equals("daily night")) { objPillsReminderModelToDaply = App.DailyNightPillsCollection[App.SelectedIndexToEdit]; } if (App.HeaderPillsReminder.Equals("weekly")) { objPillsReminderModelToDaply = App.WeeklyPillsCollection[App.SelectedIndexToEdit]; } if (App.HeaderPillsReminder.Equals("monthly")) { objPillsReminderModelToDaply = App.MonthlyPillsCollection[App.SelectedIndexToEdit]; } if (App.HeaderPillsReminder.Equals("every 28 days")) { objPillsReminderModelToDaply = App.Every28DaysPillsCollection[App.SelectedIndexToEdit]; } qty = objPillsReminderModelToDaply.NumberOfPills; qty = qty.Replace(" x ", string.Empty); _pillName = objPillsReminderModelToDaply.PillName; _buttonValue = "Update"; }
/// <summary> /// Delete pills /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void DeletePill(object sender, RoutedEventArgs e) { popupConfirm.IsOpen = true; LayoutRoot.IsHitTestVisible = false; objPillsReminderModel = (sender as MenuItem).DataContext as PillsReminderModel; }
/// <summary> /// Get the selected item /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void PillsReminderList_SelectionChanged(object sender, SelectionChangedEventArgs e) { popupConfirm.IsOpen = true; LayoutRoot.IsHitTestVisible = false; objPillsReminderModel = (sender as ListBox).SelectedItem as PillsReminderModel; }