Exemplo n.º 1
0
        protected void Button1Click(object sender, DirectEventArgs e)
        {
            SpacialDataSet sd = new SpacialDataSet();

            sd.vehicule   = vehicule.Text;
            sd.dateDepart = DateTime.Parse(dateDepart.Text) + TimeSpan.Parse(HD.Text);
            sd.dateArivee = DateTime.Parse(dateArivee.Text) + TimeSpan.Parse(HA.Text);
            if (pm.Checked == true)
            {
                SqlGeometry sqlG = SqlGeometry.Parse(trajet.Text);
                sd.trajet = DbGeometry.FromBinary(sqlG.STAsBinary().Buffer);
            }
            else if (pm.Checked == false)
            {
                SqlGeometry sqlG = SqlGeometry.Parse(trajet.Text);
                sd.trajet = DbGeometry.FromBinary(sqlG.STAsBinary().Buffer);
            }
            sd.active = (bool?)SqlBoolean.Parse(active.Text);
            db        = new demoDB();
            db.SpacialDataSets.Add(sd);
            db.SaveChanges();
            X.Msg.Alert("INFO", "l'opération a été effectuée avec succès").Show();
            ResetInputs();
            Store1.Reload();
            X.Call("resetMap");
        }
Exemplo n.º 2
0
        protected void deleteRow(object sender, DirectEventArgs e)
        {
            db = new demoDB();
            string         varID = e.ExtraParams["Id"];
            var            ID    = int.Parse(varID);
            SpacialDataSet sd    = (from i in db.SpacialDataSets where i.Id == ID select i).SingleOrDefault();

            sd.active = false;
            db.SaveChanges();
            //ChargeGridPanel();
            Store1.Reload();
        }
Exemplo n.º 3
0
        protected void RowSelect(object sender, DirectEventArgs e)
        {
            string         varID = e.ExtraParams["Id"];
            SpacialDataSet sd    = SpacialDataSet.GetSpacialDataSet(int.Parse(varID));

            frmInfo.SetValues(new
            {
                sd.vehicule,
                sd.dateDepart,
                sd.dateArivee,

                V =
                    trajet.Text = sd.trajet.AsText()
            });
            X.Call("getTrajetFromDb");
        }