Exemple #1
0
 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);
            }
        }
Exemple #3
0
 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");
     }
 }
Exemple #4
0
        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..");
     }
 }
Exemple #6
0
 protected void Hide()
 {
     if (CloseOnOnverlayClick)
     {
         ModalService.Hide();
     }
 }
Exemple #7
0
 void app_OnStartGameNow(GeniusTetrisPlayer obj)
 {
     ModalService.CloseModal();
     this.board.GameOver = Visibility.Collapsed;
     app.CurrentGame.Start();
     this.board.Focus();
 }
Exemple #8
0
 public ModalReference(Guid modalInstanceId, RenderFragment modalInstance, ModalService modalService)
 {
     Id            = modalInstanceId;
     ModalInstance = modalInstance;
     _closed       = HandleClosed;
     _modalService = modalService;
 }
Exemple #9
0
        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();
                }
            }
        }
Exemple #10
0
        //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");
     }
 }
Exemple #12
0
 protected void OnClickOutside(MouseEventArgs e)
 {
     if (ModalModel.Options.CloseOnClickOutside)
     {
         ModalService.Close();
     }
 }
Exemple #13
0
        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;
        }
Exemple #14
0
        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);
        }
Exemple #17
0
        public void RecvItemList()
        {
            clear();
            var color = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFFF0000"));

            WelComePage.RecItemReff.Background = color;
            ModalService.NavigateTo(new ReceiveItems(), delegate(bool returnValue) { });
        }
Exemple #18
0
 void NoClick(object sender, RoutedEventArgs e)
 {
     ModalService.CloseModal();
     if (_CancelClick != null)
     {
         _CancelClick(this, e);
     }
 }
Exemple #19
0
 void YesClick(object sender, RoutedEventArgs e)
 {
     ModalService.CloseModal();
     if (_OkClick != null)
     {
         _OkClick(this, e);
     }
 }
Exemple #20
0
        public void AddSuppPyment()
        {
            clear();
            var color = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFFF0000"));

            WelComePage.SubpayReff.Background = color;
            ModalService.NavigateTo(new SuppPayList(), delegate(bool returnValue) { });
        }
Exemple #21
0
        public void RecvPayment_Click()
        {
            clear();
            var color = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFFF0000"));

            WelComePage.payrecivedReff.Background = color;
            ModalService.NavigateTo(new ReceivePayment(), delegate(bool returnValue) { });
        }
Exemple #22
0
        public void StockLedger_List()
        {
            clear();
            var color = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFFF0000"));

            WelComePage.stockLegerReff.Background = color;
            ModalService.NavigateTo(new StockLedgerList(), delegate(bool returnValue) { });
        }
Exemple #23
0
        public void Employee_List()
        {
            clear();
            var color = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFFF0000"));

            WelComePage.Employee1Reff.Background = color;
            ModalService.NavigateTo(new Employee(), delegate(bool returnValue) { });
        }
Exemple #24
0
        public void TransferCashList()
        {
            clear();
            var color = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFFF0000"));

            WelComePage.transfercashReff.Background = color;
            ModalService.NavigateTo(new TransferCashList(), delegate(bool returnValue) { });
        }
Exemple #25
0
        protected void SelectChallenge(Challenge challenge)
        {
            var parameters = new ModalDialogParameters();

            SelectedChallenge = challenge;
            parameters.Add("SelectedChallenge", challenge);
            ModalService.Close(true, parameters);
        }
Exemple #26
0
        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();
 }
Exemple #28
0
        public void InvoiceList_Click()
        {
            clear();
            var color = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFFF0000"));

            WelComePage.InvoiceReff.Background = color;
            ModalService.NavigateTo(new Invoice(), delegate(bool returnValue) { });
        }
Exemple #29
0
        protected override async Task <Contact> ValidSubmitAsync()
        {
            Contact result = await base.ValidSubmitAsync();

            ModalService.Close(ModalResult.Ok(result));

            return(result);
        }
Exemple #30
0
        public void Daily_Sales()
        {
            clear();
            var color = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFFF0000"));

            WelComePage.dailySalesReff.Background = color;
            ModalService.NavigateTo(new DailySales(), delegate(bool returnValue) { });
        }