Пример #1
0
        private void procesirajButton_Click(object sender, EventArgs e)
        {
            if (this.ValidateChildren())
            {
                Izlazi izlaz = new Izlazi();

                izlaz.NarudzbaID  = narudzba.NarudzbaID;
                izlaz.IznosSaPDV  = (decimal)narudzba.Iznos;
                izlaz.IznosBezPDV = (decimal)narudzba.Iznos / (decimal)1.17;
                izlaz.SkladisteID = Convert.ToInt32(skladistaList.SelectedValue);
                izlaz.KorisnikID  = Global.prijavljeniKorisnik.KorisnikID;
                esp_Narudzbe_SelectAktivne_Result temp = narudzba;
                HttpResponseMessage response           = serviceNarudzbe.PostActionResponse("ProcesirajNarudzbu", izlaz);

                if (response.IsSuccessStatusCode)
                {
                    MessageBox.Show(Global.GetMessage("order_succ"), "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    //this.Close();

                    Reports.Frm_Racun f = new Reports.Frm_Racun();
                    f.narudzba = narudzba;
                    f.Show();
                }
                else
                {
                    MessageBox.Show("Error: " + response.StatusCode + Environment.NewLine + "Message: " + response.ReasonPhrase);
                }
            }
        }
Пример #2
0
 public OrderDetails(esp_Narudzbe_SelectAktivne_Result narudzba)
 {
     InitializeComponent();
     this.AutoValidate = AutoValidate.Disable;
     if (narudzba != null)
     {
         this.narudzba = narudzba;
     }
 }
Пример #3
0
        public DetailsForm(esp_Narudzbe_SelectAktivne_Result narudzba)
        {
            InitializeComponent();
            GMapProviders.GoogleMap.ApiKey = @"AIzaSyCiLq7oFsOeQAhlmf6KxhsIAwDUDbJ-W0M";

            if (narudzba != null)
            {
                this.narudzba = narudzba;
            }

            _points = new List <PointLatLng>();
            HttpResponseMessage response2 = narudzbeServices.GetResponseID(narudzba.NarudzbaID);

            if (response2.IsSuccessStatusCode)
            {
                AktivnaNarudzba = response2.Content.ReadAsAsync <Narudzbe>().Result;
                HttpResponseMessage response1 = skladisteService.GetResponseID(AktivnaNarudzba.SkladisteID);
                if (response1.IsSuccessStatusCode)
                {
                    NarucenoSkladiste = response1.Content.ReadAsAsync <Skladista>().Result;
                    _points.Add(new PointLatLng(Convert.ToDouble(NarucenoSkladiste.Longitude),
                                                Convert.ToDouble(NarucenoSkladiste.Latitude)));
                    _points.Add(new PointLatLng(Convert.ToDouble(AktivnaNarudzba.Latitude),
                                                Convert.ToDouble(AktivnaNarudzba.Longitude)));
                }
            }



            map.DragButton  = MouseButtons.Left;
            map.MapProvider = GMapProviders.GoogleMap;
            map.Position    = new PointLatLng(Convert.ToDouble(NarucenoSkladiste.Longitude), Convert.ToDouble(NarucenoSkladiste.Latitude));
            map.MinZoom     = 3;
            map.MaxZoom     = 95;
            map.Zoom        = 15;
            HttpResponseMessage response  = skladisteService.GetResponse();
            List <Skladista>    skladiste = response.Content.ReadAsAsync <List <Skladista> >().Result;

            if (response.IsSuccessStatusCode)
            {
                marrkers = new GMapOverlay("Markeri");

                foreach (var x in skladiste)
                {
                    if (x.SkladisteID == NarucenoSkladiste.SkladisteID)
                    {
                        PointLatLng   novi2   = new PointLatLng(Convert.ToDouble(_points[0].Lat), Convert.ToDouble(_points[0].Lng));
                        GMarkerGoogle marker2 = new GMarkerGoogle(novi2, GMarkerGoogleType.red_pushpin);
                        marker2.ToolTipText = $"Odabrano Skladiste: , \n " +
                                              $"Longitude: {_points[0].Lat}, \n " +
                                              $"Latitude: {_points[0].Lng},  ";
                        var tooltip2 = new GMapToolTip(marker2);
                        tooltip2.Fill       = new SolidBrush(Color.LightGoldenrodYellow);
                        tooltip2.Foreground = new SolidBrush(Color.Black);
                        tooltip2.Offset     = new Point(50, -25);
                        tooltip2.Stroke     = new Pen(new SolidBrush(Color.Black));

                        marker2.ToolTip = tooltip2;
                        marrkers.Markers.Add(marker2);
                    }
                    else
                    {
                        PointLatLng   novi   = new PointLatLng(Convert.ToDouble(x.Longitude), Convert.ToDouble(x.Latitude));
                        GMarkerGoogle marker = new GMarkerGoogle(novi, GMarkerGoogleType.blue_dot);
                        marker.ToolTipText = $"Naziv skladišta: {x.Adresa}, \n " +
                                             $"Longitude: {x.Latitude}, \n " +
                                             $"Latitude: {x.Longitude},  ";
                        var tooltip = new GMapToolTip(marker);
                        tooltip.Fill       = new SolidBrush(Color.DarkBlue);
                        tooltip.Foreground = new SolidBrush(Color.White);
                        tooltip.Offset     = new Point(40, -20);
                        tooltip.Stroke     = new Pen(new SolidBrush(Color.Red));

                        marker.ToolTip = tooltip;

                        marrkers.Markers.Add(marker);
                    }
                }



                PointLatLng   novi3   = new PointLatLng(Convert.ToDouble(_points[1].Lat), Convert.ToDouble(_points[1].Lng));
                GMarkerGoogle marker3 = new GMarkerGoogle(novi3, GMarkerGoogleType.red_pushpin);
                marker3.ToolTipText = $"Korisnik: , \n " +
                                      $"Longitude: {_points[1].Lat}, \n " +
                                      $"Latitude: {_points[1].Lng},  ";
                var tooltip3 = new GMapToolTip(marker3);
                tooltip3.Fill       = new SolidBrush(Color.LightGoldenrodYellow);
                tooltip3.Foreground = new SolidBrush(Color.Black);
                tooltip3.Offset     = new Point(50, -25);
                tooltip3.Stroke     = new Pen(new SolidBrush(Color.Black));


                marker3.ToolTip = tooltip3;

                marrkers.Markers.Add(marker3);



                map.Overlays.Add(marrkers);
            }
            else
            {
            }
        }
Пример #4
0
 public DetailsForm(esp_Narudzbe_SelectAktivne_Result narudzba)
 {
     InitializeComponent();
     this.narudzba = narudzba;
 }