private async void AutoSugBoxEmps_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) { ProgressRingAutosuggestionLoad.IsActive = true; ProgressRingAutosuggestionLoad.Visibility = Visibility.Visible; string QueryItem = args.QueryText.ToString(); if (String.IsNullOrEmpty(QueryItem)) { await EmployeeSync.GetAllEmployeesAsnc(EmployeeCharacters, "All"); await LeaveTransactionGetPostPut.GetLeaveTransactionAsnc(LeaveTransactions, "All", "1"); Passwordresetframe.Visibility = Visibility.Collapsed; } else { await EmployeeSync.GetAutosuggestEmployeesAsnc(EmployeeCharacters, QueryItem); await LeaveTransactionGetPostPut.GetLeaveTransactionAsnc(LeaveTransactions, EmployeeCharacters[0].EmpId, "1"); Passwordresetframe.Visibility = Visibility.Visible; Passwordresetframe.Navigate(typeof(PasswordResetAdmin), EmployeeCharacters[0].EmpId); } ProgressRingAutosuggestionLoad.IsActive = false; ProgressRingAutosuggestionLoad.Visibility = Visibility.Collapsed; }
private async void EmployessListview_ItemClick(object sender, ItemClickEventArgs e) { var SelectedEmployee = (EmployeeMaster)e.ClickedItem; await LeaveTransactionGetPostPut.GetLeaveTransactionAsnc(LeaveTransactions, SelectedEmployee.EmpId.ToString(), "1"); Passwordresetframe.Visibility = Visibility.Visible; Passwordresetframe.Navigate(typeof(PasswordResetAdmin), SelectedEmployee._id.Oid.ToString()); }
private async void Page_Loaded(object sender, RoutedEventArgs e) { ProgressRingFormLoad.IsActive = true; ProgressRingFormLoad.Visibility = Visibility.Visible; await EmployeeSync.GetAllEmployeesAsnc(EmployeeCharacters, "All"); await LeaveTransactionGetPostPut.GetLeaveTransactionAsnc(LeaveTransactions, "All", "1"); ProgressRingFormLoad.IsActive = false; ProgressRingFormLoad.Visibility = Visibility.Collapsed; }
private async void ButtonCancel_Click(object sender, RoutedEventArgs e) { var SelectedSender = (FrameworkElement)sender; var SelectedItem = (Leavetransaction)SelectedSender.DataContext; //Update the data working code string condition = SelectedItem._id.Oid.ToString(); string empid = SelectedItem.EmpId.ToString(); string setValue = String.Format("{{\"$set\":{{\"LeaveStatus\":\"{0}\"}}}}", "-1"); await LeaveTransactionGetPostPut.LeaveTransactionPutAsync(condition, setValue); await LeaveTransactionGetPostPut.GetLeaveTransactionAsnc(LeaveTransactions, empid, "1"); }
private async void AutoSugBoxEmps_Unloaded(object sender, RoutedEventArgs e) { ProgressRingAutosuggestionLoad.IsActive = true; ProgressRingAutosuggestionLoad.Visibility = Visibility.Visible; await EmployeeSync.GetAllEmployeesAsnc(EmployeeCharacters, "All"); await LeaveTransactionGetPostPut.GetLeaveTransactionAsnc(LeaveTransactions, "All", "1"); Passwordresetframe.Visibility = Visibility.Collapsed; ProgressRingAutosuggestionLoad.IsActive = false; ProgressRingAutosuggestionLoad.Visibility = Visibility.Collapsed; }
protected async override void OnNavigatedTo(NavigationEventArgs e) { string LeaveType = (string)e.Parameter; string empId = ""; var localObjectStorageHelper = new LocalObjectStorageHelper(); // Read and Save with simple objects string keySimpleObject = "47"; if (localObjectStorageHelper.KeyExists(keySimpleObject)) { empId = localObjectStorageHelper.Read <string>(keySimpleObject); } await LeaveTransactionGetPostPut.GetLeaveTransactionAsnc(LeaveTransactions, empId, LeaveType); }
private async void AcceptButton_Click(object sender, RoutedEventArgs e) { try { var parent = (sender as Button).Parent; ProgressRing AcceptProgressRing = parent.GetChildrenOfType <ProgressRing>().First(x => x.Name == "AcceptProgressRing"); AcceptProgressRing.IsActive = true; AcceptProgressRing.Visibility = Visibility.Visible; (sender as Button).IsEnabled = false; var SelectedSender = (FrameworkElement)sender; var SelectedItem = (Leavetransaction)SelectedSender.DataContext; //Update the data working code string condition = SelectedItem._id.Oid.ToString(); string empid = SelectedItem.EmpId.ToString(); string setValue = String.Format("{{\"$set\":{{\"LeaveStatus\":\"{0}\",\"ApprovedBy\":\"{1}\",\"ApprovedDate\":\"{2}\",\"ApprovedTime\":\"{3}\"}}}}", "2", empid, DateTimeToDateIndian.GetDateFromDateTime(DateTime.Now.ToString("G")), DateTime.Now.ToString("hh:mm tt")); await LeaveTransactionGetPostPut.LeaveTransactionPutAsync(condition, setValue); var messageDialog = new MessageDialog("Accepted"); await messageDialog.ShowAsync(); AcceptProgressRing.IsActive = false; AcceptProgressRing.Visibility = Visibility.Collapsed; (sender as Button).IsEnabled = true; await LeaveTransactionGetPostPut.GetLeaveTransactionAsnc(LeaveTransactions, empid, "1"); } catch { var messageDialog = new MessageDialog("not accepted !Error "); await messageDialog.ShowAsync(); var parent = (sender as Button).Parent; ProgressRing AcceptProgressRing = parent.GetChildrenOfType <ProgressRing>().First(x => x.Name == "AcceptProgressRing"); AcceptProgressRing.IsActive = false; AcceptProgressRing.Visibility = Visibility.Collapsed; (sender as Button).IsEnabled = true; } }
private async void AutoSugBoxEmps_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { if (String.IsNullOrEmpty(sender.Text)) { await EmployeeSync.GetAllEmployeesAsnc(EmployeeCharacters, "All"); await LeaveTransactionGetPostPut.GetLeaveTransactionAsnc(LeaveTransactions, "All", "1"); Passwordresetframe.Visibility = Visibility.Collapsed; } else { String after = sender.Text.Substring(0, 1).ToUpper() + sender.Text.Substring(1); var autoSuggestbox = (AutoSuggestBox)sender; var Suggestions = EmployeeCharacters.Where(p => p.EmpFirstName.StartsWith(after)).Select(p => p.EmpFirstName).ToList(); autoSuggestbox.ItemsSource = Suggestions; } }
private async void ButtonCancel_Click(object sender, RoutedEventArgs e) { try { var parent = (sender as Button).Parent; ProgressRing CancelProgressRing = parent.GetChildrenOfType <ProgressRing>().First(x => x.Name == "CancelProgressRing"); CancelProgressRing.IsActive = true; CancelProgressRing.Visibility = Visibility.Visible; (sender as Button).IsEnabled = false; var SelectedSender = (FrameworkElement)sender; var SelectedItem = (Leavetransaction)SelectedSender.DataContext; //Update the data working code string condition = SelectedItem._id.Oid.ToString(); string empid = SelectedItem.EmpId.ToString(); string setValue = String.Format("{{\"$set\":{{\"LeaveStatus\":\"{0}\"}}}}", "-1"); await LeaveTransactionGetPostPut.LeaveTransactionPutAsync(condition, setValue); var messageDialog = new MessageDialog("Canceled"); await messageDialog.ShowAsync(); CancelProgressRing.IsActive = false; CancelProgressRing.Visibility = Visibility.Collapsed; (sender as Button).IsEnabled = true; await LeaveTransactionGetPostPut.GetLeaveTransactionAsnc(LeaveTransactions, empid, "1"); } catch { var messageDialog = new MessageDialog("Not canceled !Error "); await messageDialog.ShowAsync(); var parent = (sender as Button).Parent; ProgressRing CancelProgressRing = parent.GetChildrenOfType <ProgressRing>().First(x => x.Name == "CancelProgressRing"); CancelProgressRing.IsActive = false; CancelProgressRing.Visibility = Visibility.Collapsed; (sender as Button).IsEnabled = true; } }
private async void AllEmployeeListView_ItemClick(object sender, ItemClickEventArgs e) { await LeaveTransactionGetPostPut.GetLeaveTransactionAsnc(LeaveTransactions, "All", "1"); }