public void AddIceCream(string obj)
        {
            bool found = CurrentModel.MyBl.CheckIceCream(CurrentModel.MyIC.Id, CurrentModel.MyIC.ShopId);

            if (found)
            {
                System.Windows.MessageBox.Show("Warning !!  IceCream  with same ID already exists !!", "Warning", MessageBoxButton.OK, MessageBoxImage.Exclamation);
            }
            else
            {
                if (Image != null)
                {
                    CurrentModel.MyIC.images.Add(Image);
                }
                else
                {
                    CurrentModel.MyIC.images.Add("../Image/font_ice_cream.jpg");
                }
                //  CurrentModel.MyIC.images.Add(Image);
                CurrentModel.MyIC.Calories = double.Parse(addIceCreamUC.Fats.Text);
                CurrentModel.MyIC.Proteins = double.Parse(addIceCreamUC.Proteins.Text);
                CurrentModel.MyIC.Energy   = double.Parse(addIceCreamUC.Energy.Text);
                CurrentModel.MyIC.UpdateData();
                CurrentModel.AddIceCream();
                System.Windows.MessageBox.Show("Great !! You have add Ice Cream  !!", "Welcome", MessageBoxButton.OK, MessageBoxImage.Exclamation);
            }
        }
        public void GetName()
        {
            DeliveryMen myman = CurrentModel.getDman(Index);

            MyName = myman.name;
            myUC.dmanFname.Text = MyName;
        }
        public async void KMeans()
        {
            myUC.progress.IsIndeterminate = true;

            MessageBox.Show("Configuring Distribution", "Configuration", MessageBoxButton.OK, MessageBoxImage.Information);


            mylistaddress = await CurrentModel.KMeans(food, drug);

            Index = 0;
            HelpDisplayMap(Index);

            if (mylistaddress != null)
            {
                myUC.next.IsEnabled = true;
                myUC.prev.IsEnabled = false;
                myUC.ok.IsEnabled   = true;
                DisNB           = (Index + 1).ToString();
                myUC.disnb.Text = DisNB;

                GetName();
            }
            else
            {
                myUC.next.IsEnabled = true;
                myUC.prev.IsEnabled = false;
                myUC.ok.IsEnabled   = true;
                MyName = string.Empty;
                DisNB  = string.Empty;
            }


            myUC.progress.IsIndeterminate = false;
        }
Exemple #4
0
        private void Del_comment_OnClick(object sender, RoutedEventArgs e)
        {
            int line_no = ((sender as FrameworkElement).DataContext as SalesLineShortEntry).LineNo;

            CurrentModel.DeleteSalesLine(line_no);
            CurrentModel.Refresh();
        }
        public TableVM()
        {
            carriagesVM   = new CarriagesVM();
            citiesVM      = new CitiesVM();
            locomotivesVM = new LocomotivesVM();
            routesVM      = new RoutesVM();
            schedulesVM   = new SchedulesVM();
            ticketsVM     = new TicketsVM();
            trainsVM      = new TrainsVM();
            usersVM       = new UsersVM();

            CurrentModel = schedulesVM;

            RequestCommand = new RelayCommand(o =>
            {
                CurrentModel.Request();
            });

            AddCommand = new RelayCommand(o =>
            {
                CurrentModel.AddEdit(true);
            });

            EditCommand = new RelayCommand(o =>
            {
                CurrentModel.AddEdit(false);
            });

            DeleteCommand = new RelayCommand(o =>
            {
                CurrentModel.Delete();
            });
        }
Exemple #6
0
        public async Task <ActionResult <TreeModel> > CreateThematicTreeAsync([FromBody] NodeModel node)
        {
            //TEMPORARY, JUST TO CHECK THE ENDPOINT IN LIVE
            bool isRootCreation = node == null;

            if (!isRootCreation)
            {
                if (node.Name == null || node.WithChildren.HasValue || !node.ParentId.HasValue)
                {
                    return(BadRequest(@"For the creation of a node, a name and a parentId are necessary
and don't put the field withchildren in the payload, please."));
                }
            }

            if (isRootCreation)
            {
                CurrentModel = new TreeModel(0, "root");
            }
            else
            {
                var nodeParentFound = CurrentModel.FindNode(node.ParentId.Value);
                int position        = node.Position.HasValue ? node.Position.Value : -1;
                _ = new TreeModel(0, node.Name, nodeParentFound, position);
            }
            return(Ok(await Task.FromResult(CurrentModel)));
        }
 public void ShowLoading(string sCaptionKey, string sKeyMessage)
 {
     if (CurrentModel != null)
     {
         CurrentModel.ShowLoading(sCaptionKey, sKeyMessage);
     }
 }
Exemple #8
0
        public override void Refresh()
        {
            SetDataGridWidths();

            tbx_filter.Text = "";
            CurrentModel.Refresh();
        }
        void SetTimeSettingsButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (CurrentModel == null)
                {
                    return;
                }

                if (UseUTC)
                {
                    CurrentModel.SetTime((TimeZoneInfo)CurrentTimeZone);
                }
                else
                {
                    var date = SelectedDate;

                    var split = SelectedTime.Split(':');

                    var time = new DateTime(date.Year, date.Month, date.Day, int.Parse(split[0]), int.Parse(split[1]),
                                            int.Parse(split[2]));

                    CurrentModel.SetTimeManually(time);
                }
            }
            catch (Exception exception)
            {
                Log.Write("Invalid time format: " + exception.Message);
                System.Windows.MessageBox.Show("Invalid time format (HH:MM:SS)");
            }
        }
Exemple #10
0
 private async void BtnSave_OnClick(object sender, RoutedEventArgs e)
 {
     if (
         await
         App.Current.CurrentMainWindow.ShowMessageAsync("გსურთ შენახვა?", "",
                                                        MessageDialogStyle.AffirmativeAndNegative) != MessageDialogResult.Negative)
     {
         try
         {
             CurrentModel.CreateOrder();
             //if( CurrentModel.IsNew)
             //    await App.Current.CurrentMainWindow.ShowMessageAsync("ახალი ორდერი შეიქმნა წარმატებით!", "");
             if (CurrentModel.Order.Sell_toCustomerNo == App.Current.PosSetting.Settings_GenCustomerCode)
             {
                 OpenNewOrder();
             }
             else
             {
                 NavigateToControl(PrevUserControl);
             }
         }
         catch (Exception ex)
         {
             App.Current.ShowErrorDialog("შეცდომა შენახვისას!", ex.Message);
         }
     }
 }
Exemple #11
0
 public override void Refresh()
 {
     CurrentModel.Refresh();
     Keyboard.Focus(tbx_bar_code);
     tbx_bar_code.Text = "";
     tbx_bar_code.Focus();
     //FocusManager.SetFocusedElement(this, tbx_bar_code);
 }
 void StopCaptureVideoButton_Click(object sender, RoutedEventArgs e)
 {
     if (CurrentModel == null)
     {
         return;
     }
     CurrentModel.StopCaptionVideo();
 }
        public async void HelpDisplayMap(int index)
        {
            myUC.map.Children.Clear();
            ad = new List <Address>();

            if (mylistaddress != null)
            {
                int i = 0;
                foreach (Client client in mylistaddress[index])
                {
                    if (client != null && client.address != null)
                    {
                        MessageBox.Show("New Address : " + client.address.street + " " + client.address.city);
                        ad.Add(client.address);
                        listclient.Add(client);
                        Boolean flag = false;
                        while (!flag)
                        {
                            try
                            {
                                //    MessageBox.Show("while");
                                string streetname = client.address.street + " " + client.address.city;
                                //if (streetname.Contains("TelAviv"))
                                //    streetname = streetname.Replace("TelAviv", "Tel Aviv");

                                var x = await CurrentModel.SearchAddress(streetname);

                                var jo1 = JArray.Parse(x.ToString());


                                longlat = new List <string>();
                                longlat.Add(jo1[0]["lon"].ToString());
                                longlat.Add(jo1[0]["lat"].ToString());

                                flag = true;
                            }
                            catch (Exception e)
                            {
                                continue;
                            }
                        }
                        i++;

                        Pushpin pinbis = new Pushpin {
                            Location = client.location, Background = new SolidColorBrush(Colors.Yellow)
                        };



                        myUC.map.Children.Add(pinbis);
                    }
                }
                myUC.listado.ItemsSource = ad;
            }


            MessageBox.Show("Distribution automatic successfuly done", "Success", MessageBoxButton.OK, MessageBoxImage.Information);
        }
Exemple #14
0
        private void ModelFunctionCallback(IntPtr oVariables, IntPtr par, IntPtr oResult)
        {
            int numBoundaries = SelectForm.NumSelectedBoundaries;
            int numParameters = SelectForm.NumSelectedParameters;

            if (numBoundaries > 0)
            {
                var oBoundary = new double[numBoundaries];
                Marshal.Copy(par, oBoundary, 0, numBoundaries);
                int[] oSelectedBoundary = SelectForm.SelectedBoundarySpecies;
                for (int i = 0; i < numBoundaries; i++)
                {
                    Simulator.setBoundarySpeciesByIndex(oSelectedBoundary[i],
                                                        (double.IsNaN(oBoundary[i])
                                                             ? oSelectedBoundary[i]
                                                             : oBoundary[i]));
                }
            }

            if (numParameters > 0)
            {
                var oParameters = new double[numParameters];
                Marshal.Copy(par, oParameters, numBoundaries, numParameters);
                int[] oSelectedParameters = SelectForm.SelectedParameters;
                for (int i = 0; i < numParameters; i++)
                {
                    Simulator.setGlobalParameterByIndex(oSelectedParameters[i],
                                                        (double.IsNaN(oParameters[i])
                                                             ? oSelectedParameters[i]
                                                             : oParameters[i]));
                }
            }


            var variableTemp = new double[CurrentModel.y.Length];

            Marshal.Copy(oVariables, variableTemp, 0, Math.Min(CurrentModel.y.Length, nDim));

            bool containsNaN = ContainsNaN(variableTemp);

            if (!containsNaN)
            {
                CurrentModel.y = variableTemp;
            }

            //Console.WriteLine("Eval");
            //PrintArray(CurrentModel.y, Console.Out);

            CurrentModel.convertToAmounts();
            CurrentModel.evalModel(CurrentModel.time, CurrentModel.y);
            //Simulator.oneStep(0.0, 0.01);

            Marshal.Copy(CurrentModel.dydt, 0, oResult, Math.Min(CurrentModel.dydt.Length, nDim));


            //PrintArray(CurrentModel.y, Console.Out);
            //PrintArray(CurrentModel.dydt, Console.Out);
        }
Exemple #15
0
        private async void BtnAddNewRow_OnClick(object sender, RoutedEventArgs e)
        {
            var dt     = CurrentModel.GetNewRow();
            var dialog = (BaseMetroDialog)this.Resources["PayementDetail"];

            dialog.Title       = "გადახდის დამატება";
            dialog.DataContext = new PaymentDetailViewModel(dt, CurrentModel.ClientBalance);
            await App.Current.CurrentMainWindow.ShowMetroDialogAsync(dialog);
        }
Exemple #16
0
 private void BtnSP_OnClick(object sender, RoutedEventArgs e)
 {
     CurrentModel.SetOrderType(OrderTypes.SP);
     CurrentModel.CalcMustVisible = false;
     CurrentModel.UpdateCalcVisibility();
     tbx_filter.SelectAll();
     tbx_filter.Focus();
     ReservesGrid.Items.Refresh();
 }
        public void CloseWindow(CancelEventArgs e)
        {
            MessageBoxResult confirm = CurrentModel.ShowMessageBox(StringResources.captionConfirm, StringResources.msgConfirmQuit, MessageBoxButton.YesNo);

            if (confirm == MessageBoxResult.No)
            {
                e.Cancel = true;
            }
        }
        void ScanStopButton_Click(object sender, RoutedEventArgs e)
        {
            if (CurrentModel == null)
            {
                return;
            }

            CurrentModel.StopMove();
        }
        void SetHomeButton_Click(object sender, RoutedEventArgs e)
        {
            if (CurrentModel == null)
            {
                return;
            }

            CurrentModel.SetHome();
        }
        void CaptureImageButton_Click(object sender, RoutedEventArgs e)
        {
            if (CurrentModel == null)
            {
                return;
            }

            CurrentModel.TakeSnapshot(CapturePath);
        }
        void ControlStop(object sender, MouseButtonEventArgs e)
        {
            if (CurrentModel == null)
            {
                return;
            }

            CurrentModel.StopMove();
        }
Exemple #22
0
        protected virtual IEnumerable <TextFile> ProcessEntityTypes(TemplateFileInfo templateInfo)
        {
            var entityTypes = CurrentModel.GetEntityTypes();

            foreach (OdcmObject entityType in entityTypes)
            {
                yield return(ProcessTemplate(templateInfo, entityType));
            }
        }
        void HomeButton_OnClick(object sender, RoutedEventArgs e)
        {
            if (CurrentModel == null)
            {
                return;
            }

            CurrentModel.GoToHome();
        }
Exemple #24
0
        protected virtual IEnumerable <TextFile> ProcessComplexTypes(TemplateFileInfo templateInfo)
        {
            var complexTypes = CurrentModel.GetComplexTypes();

            foreach (OdcmObject complexType in complexTypes)
            {
                yield return(ProcessTemplate(templateInfo, complexType));
            }
        }
Exemple #25
0
        public async Task <ActionResult <TreeModel> > GetTreeAsync(int nodeId)
        {
            var nodeFound = CurrentModel.FindNode(nodeId);

            if (nodeFound == null)
            {
                return(NotFound());
            }
            return(Ok(await Task.FromResult(nodeFound)));
        }
Exemple #26
0
 public async Task <ActionResult <TreeModel> > DeleteThematicTreeAsync(int nodeId)
 {
     var(newModel, childDetached) = CurrentModel.RemoveBranch(nodeId);
     if (newModel == null && childDetached == null)
     {
         return(NotFound());
     }
     CurrentModel = newModel;
     return(Ok(await Task.FromResult(CurrentModel)));
 }
        void AddPresetButton_Click(object sender, RoutedEventArgs e)
        {
            if (CurrentModel == null)
            {
                return;
            }

            CurrentModel.AddPreset();
            OnPropertyChanged("CurrentModel");
        }
 private void UpdateModelAndTemplates()
 {
     Templates.Clear();
     CurrentModel  = Models.GetCurrent(isForDeck);
     TemplatesJson = CurrentModel.GetNamedArray("tmpls");
     foreach (var t in TemplatesJson)
     {
         uint newOrd = (uint)t.GetObject().GetNamedNumber("ord");
         Templates.Add(new TemplateInformation(t.GetObject().GetNamedString("name"), newOrd));
     }
 }
Exemple #29
0
 private CityTemperature SetUpCityTemp(CurrentModel result)
 {
     return(new CityTemperature()
     {
         City = result.Name,
         Latitude = result.Coord.Lat.ToString(),
         Longitude = result.Coord.Lon.ToString(),
         DateTime = DateTime.Now,
         Temperature = result.Main.Temp
     });
 }
 void Start()
 {
     window = GameObject.Find("ControlWPFWindow").GetComponent <ControlWPFWindow>();
     window.ModelLoadedAction += (GameObject CurrentModel) =>
     {
         if (CurrentModel != null)
         {
             blendShapeProxy = CurrentModel.GetComponent <VRMBlendShapeProxy>();
         }
     };
 }