public async void Delete_Estimate() { if (SelectedEstimate.EstimateID != null && SelectedEstimate.EstimateID != 0) { MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show("Are you sure delete this estimate " + SelectedEstimate.EstimateNo + "?", "Delete Confirmation", System.Windows.MessageBoxButton.YesNo); if (messageBoxResult == MessageBoxResult.Yes) { var id = SelectedEstimate.EstimateID; HttpClient client = new HttpClient(); client.DefaultRequestHeaders.Accept.Add( new MediaTypeWithQualityHeaderValue("application/json")); client.BaseAddress = new Uri(GlobalData.gblApiAdress); HttpResponseMessage response = client.GetAsync("api/EstimateAPI/DeleteEstimate?id=" + id + "").Result; if (response.StatusCode.ToString() == "OK") { ModalService.NavigateTo(new Estimate(), delegate(bool returnValue) { }); MessageBox.Show("Estimate Deleted Successfully"); } } else { Cancel_Estimate(); } } else { MessageBox.Show("Select Customer"); } }
async public Task RefreshAsync() { IWuEndpoint endpoint; if (TryGetEndpoint(out endpoint)) { try { await endpoint.RefreshSettingsAsync(); var updates = await UpdateDescriptionViewModel.GetAvailableUpdatesAsync(endpoint, ModalService); lock (_dataLock) { _autoSelectUpdates = endpoint.Settings.AutoSelectUpdates; _autoAcceptEula = endpoint.Settings.AutoAcceptEulas; Updates = updates; Hostname = endpoint.FQDN; } OnPropertyChanged(nameof(Hostname)); OnPropertyChanged(nameof(Updates)); OnPropertyChanged(nameof(AutoSelectUpdates)); OnPropertyChanged(nameof(AutoAcceptEulas)); } catch (Exception e) { ModalService.ShowMessageBox("Could not retrieve data: " + e.Message, Hostname, MessageType.Error); } } else { ModalService.ShowMessageBox("The service is not longer available.", Hostname, MessageType.Error); } }
public async void Delete_Catagory() { if (SelectedCatagory.CATAGORY_ID != null && SelectedCatagory.CATAGORY_ID != 0) { MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show("Are you sure Delete this Catagory " + SelectedCatagory.CATAGORY_NAME + "?", "Delete Confirmation", System.Windows.MessageBoxButton.YesNo); if (messageBoxResult == MessageBoxResult.Yes) { var id = SelectedCatagory.CATAGORY_ID; HttpClient client = new HttpClient(); client.DefaultRequestHeaders.Accept.Add( new MediaTypeWithQualityHeaderValue("application/json")); client.BaseAddress = new Uri(GlobalData.gblApiAdress); HttpResponseMessage response = client.GetAsync("api/CatagoryAPI/DeleteCatagory?id=" + SelectedCatagory.CATAGORY_ID + "").Result; if (response.StatusCode.ToString() == "OK") { MessageBox.Show("Catagory Delete Successfully"); ModalService.NavigateTo(new CategoryList(), delegate(bool returnValue) { }); } } else { Cancel_Catagory(); } } else { MessageBox.Show("Select Catagory"); } }
void app_OnEndGameEnd(GeniusTetrisPlayer arg1, string arg2) { //Sorted player by their score CollectionViewSource sortedCollection = new CollectionViewSource(); ObservableCollection <ScorePlayer> allplayers = new ObservableCollection <ScorePlayer>(app.GameMembersList.Select(x => ScorePlayer.FromPlayer(x))); app.CurrentPlayer.Score = app.CurrentGame.Score; var Me = ScorePlayer.FromPlayer(app.CurrentPlayer); Me.IsYou = true; allplayers.Add(Me); foreach (var teamGrp in allplayers.GroupBy(x => x.TeamName)) { var teamScore = teamGrp.Sum(x => x.Score); foreach (var player in teamGrp) { player.TeamScore = teamScore; } } sortedCollection.Source = allplayers; var grp = new PropertyGroupDescription("TeamName"); sortedCollection.GroupDescriptions.Add(grp); sortedCollection.SortDescriptions.Add(new SortDescription("Score", ListSortDirection.Descending)); ScoresDlgUC dlg = new ScoresDlgUC(); dlg.DataContext = sortedCollection; ModalService.ShowModal(dlg); }
public async void Delete_Product() { if (selectCustomer.CUSTOMER_ID != null && selectCustomer.CUSTOMER_ID != 0) { MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show("Are you sure Delete this Product " + selectCustomer.CUSTOMER_ID + "?", "Delete Confirmation", System.Windows.MessageBoxButton.YesNo); if (messageBoxResult == MessageBoxResult.Yes) { var id = selectCustomer.CUSTOMER_ID; HttpClient client = new HttpClient(); client.DefaultRequestHeaders.Accept.Add( new MediaTypeWithQualityHeaderValue("application/json")); client.BaseAddress = new Uri(GlobalData.gblApiAdress); HttpResponseMessage response = client.GetAsync("api/ProductAPI/DeleteProduct?id=" + selectCustomer.CUSTOMER_ID + "").Result; if (response.StatusCode.ToString() == "OK") { MessageBox.Show("Customer Deleted Successfully"); //GetDeliveryAddress(comp); ModalService.NavigateTo(new CustomerList(), delegate(bool returnValue) { }); } } else { Cancel_Customer(); } } else { MessageBox.Show("Select Customer.."); } }
protected void Hide() { if (CloseOnOnverlayClick) { ModalService.Hide(); } }
void app_OnStartGameNow(GeniusTetrisPlayer obj) { ModalService.CloseModal(); this.board.GameOver = Visibility.Collapsed; app.CurrentGame.Start(); this.board.Focus(); }
public ModalReference(Guid modalInstanceId, RenderFragment modalInstance, ModalService modalService) { Id = modalInstanceId; ModalInstance = modalInstance; _closed = HandleClosed; _modalService = modalService; }
public async void Add_Catagory() { if (SelectedCatagory.CATAGORY_NAME == "" || SelectedCatagory.CATAGORY_NAME == null) { MessageBox.Show("Catagory Name is missing"); } else { HttpClient client = new HttpClient(); client.BaseAddress = new Uri(GlobalData.gblApiAdress); SelectedCatagory.COMPANY_ID = Convert.ToInt32(App.Current.Properties["Company_Id"].ToString()); client.DefaultRequestHeaders.Accept.Add( new MediaTypeWithQualityHeaderValue("application/json")); client.Timeout = new TimeSpan(500000000000); var response = await client.PostAsJsonAsync("api/CatagoryAPI/CatagoryAdd/", SelectedCatagory); if (response.StatusCode.ToString() == "OK") { MessageBox.Show("Catagory insert Successfully"); Cancel_Catagory(); ModalService.NavigateTo(new CategoryList(), delegate(bool returnValue) { }); //GetCatagory(SelectedCatagory.COMPANY_ID); //Window_CatagoryList.CatGridRef.ItemsSource = null; // Main.ListGridRef.ClearValue(); //Window_CatagoryList.CatGridRef.ItemsSource = _ListGrid_Catagory.ToList(); } } }
//protected async Task PreventDraggable() //{ // await TablerService.SetElementProperty(dragContainer, "draggable", false); //} //protected async Task SetDraggable() //{ // await TablerService.SetElementProperty(dragContainer, "draggable", true); //} protected void OnKeyDown(KeyboardEventArgs e) { if (e.Key == "Escape" && ModalModel.Options.CloseOnEsc) { ModalService.Close(); } }
public async void Delete_Designation() { if (selectDesignation.DESIGNATION_ID != null && selectDesignation.DESIGNATION_ID != 0) { MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show("Are you sure Delete this Designation " + selectDesignation.DESIGNATION_NAME + "?", "Delete Confirmation", System.Windows.MessageBoxButton.YesNo); if (messageBoxResult == MessageBoxResult.Yes) { var id = selectDesignation.DESIGNATION_ID; HttpClient client = new HttpClient(); client.DefaultRequestHeaders.Accept.Add( new MediaTypeWithQualityHeaderValue("application/json")); client.BaseAddress = new Uri(GlobalData.gblApiAdress); HttpResponseMessage response = client.GetAsync("api/DesignationListAPI/DeleteDesignation?id=" + id + "").Result; if (response.StatusCode.ToString() == "OK") { MessageBox.Show("Designation Delete Successfully"); ModalService.NavigateTo(new DesignationList(), delegate(bool returnValue) { }); } } else { Cancel_Designation(); } } else { MessageBox.Show("Select Designation"); } }
protected void OnClickOutside(MouseEventArgs e) { if (ModalModel.Options.CloseOnClickOutside) { ModalService.Close(); } }
private async Task ShowCreateStickyNote() { var options = new ModalDialogOptions { Style = "modal-base", BackgroundClickToClose = false }; ModalDialogResult modalResult = await ModalService.ShowDialogAsync <AddStickyNote>("Create a sticky note", options); var result = modalResult.ReturnParameters; if (!modalResult.Success) { return; } var note = result.Get <StickyNote>("StickyNoteModel"); var userNotes = LocalStorage.GetItem <UserStickyNotes>($"{AppState.UserName}-StickyNotes"); if (userNotes == null || userNotes?.StickyNotes?.Count == 0) { AppState.UserStickyNotes ??= new UserStickyNotes { UserName = AppState.UserName }; AppState.UserStickyNotes.StickyNotes ??= new List <StickyNote>(); } else { AppState.UserStickyNotes = userNotes; } AppState.UserStickyNotes.StickyNotes.Add(note); _selectOption = "Sticky"; LocalStorage.SetItem($"{AppState.UserName}-StickyNotes", AppState.UserStickyNotes); AppState.StickyNote = note; }
public async void Update_Godown() { if (SelectedGosown.GODOWN_NAME == "" || SelectedGosown.GODOWN_NAME == null) { MessageBox.Show("GODOWN NAME is missing"); return; } else if (SelectedGosown.GOSOWN_DESCRIPTION == "" || SelectedGosown.GOSOWN_DESCRIPTION == null) { MessageBox.Show("GODOWN DESCRIPTION is missing"); return; } else { HttpClient client = new HttpClient(); client.BaseAddress = new Uri(GlobalData.gblApiAdress); SelectedGosown.COMPANY_ID = Convert.ToInt32(App.Current.Properties["Company_Id"].ToString()); client.DefaultRequestHeaders.Accept.Add( new MediaTypeWithQualityHeaderValue("application/json")); client.Timeout = new TimeSpan(500000000000); var response = await client.PostAsJsonAsync("api/GodownAPI/GodownAdd/", SelectedGosown); if (response.StatusCode.ToString() == "OK") { MessageBox.Show("Godown Updated Successfully"); Cancel_Godown(); ModalService.NavigateTo(new GodownList(), delegate(bool returnValue) { }); } } }
private async Task OpenMetadataDetailsModalTemplate(Metadata metadata) { var templateOptions = new ViewModels.MetadataDetailsViewModel { Metadata = metadata }; var modalConfig = new ModalOptions(); modalConfig.Title = "Metadata Preview"; modalConfig.Width = "90%"; modalConfig.DestroyOnClose = true; modalConfig.OnCancel = async(e) => { await metadataDetailsModalRef.CloseAsync(); }; modalConfig.OnOk = async(e) => { await metadataDetailsModalRef.CloseAsync(); }; modalConfig.AfterClose = () => { InvokeAsync(StateHasChanged); return(Task.CompletedTask); }; metadataDetailsModalRef = await ModalService .CreateModalAsync <MetadataDetailsModal, ViewModels.MetadataDetailsViewModel>( modalConfig, templateOptions); }
protected void UpdateCodeSnippet(string snippet) { var parameters = new ModalDialogParameters(); CodeSnippet = snippet; parameters.Add("CodeSnippet", snippet); ModalService.Close(true, parameters); }
public void RecvItemList() { clear(); var color = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFFF0000")); WelComePage.RecItemReff.Background = color; ModalService.NavigateTo(new ReceiveItems(), delegate(bool returnValue) { }); }
void NoClick(object sender, RoutedEventArgs e) { ModalService.CloseModal(); if (_CancelClick != null) { _CancelClick(this, e); } }
void YesClick(object sender, RoutedEventArgs e) { ModalService.CloseModal(); if (_OkClick != null) { _OkClick(this, e); } }
public void AddSuppPyment() { clear(); var color = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFFF0000")); WelComePage.SubpayReff.Background = color; ModalService.NavigateTo(new SuppPayList(), delegate(bool returnValue) { }); }
public void RecvPayment_Click() { clear(); var color = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFFF0000")); WelComePage.payrecivedReff.Background = color; ModalService.NavigateTo(new ReceivePayment(), delegate(bool returnValue) { }); }
public void StockLedger_List() { clear(); var color = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFFF0000")); WelComePage.stockLegerReff.Background = color; ModalService.NavigateTo(new StockLedgerList(), delegate(bool returnValue) { }); }
public void Employee_List() { clear(); var color = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFFF0000")); WelComePage.Employee1Reff.Background = color; ModalService.NavigateTo(new Employee(), delegate(bool returnValue) { }); }
public void TransferCashList() { clear(); var color = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFFF0000")); WelComePage.transfercashReff.Background = color; ModalService.NavigateTo(new TransferCashList(), delegate(bool returnValue) { }); }
protected void SelectChallenge(Challenge challenge) { var parameters = new ModalDialogParameters(); SelectedChallenge = challenge; parameters.Add("SelectedChallenge", challenge); ModalService.Close(true, parameters); }
public void Location_Click() { clear(); var color = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFFF0000")); WelComePage.BussLocationReff.Background = color; ModalService.NavigateTo(new BussinessLocationList(), delegate(bool returnValue) { }); }
private void HandleBackgroundClick() { if (ComponentDisableBackgroundCancel) { return; } ModalService.Cancel(); }
public void InvoiceList_Click() { clear(); var color = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFFF0000")); WelComePage.InvoiceReff.Background = color; ModalService.NavigateTo(new Invoice(), delegate(bool returnValue) { }); }
protected override async Task <Contact> ValidSubmitAsync() { Contact result = await base.ValidSubmitAsync(); ModalService.Close(ModalResult.Ok(result)); return(result); }
public void Daily_Sales() { clear(); var color = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFFF0000")); WelComePage.dailySalesReff.Background = color; ModalService.NavigateTo(new DailySales(), delegate(bool returnValue) { }); }