예제 #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");
        }
예제 #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();
        }
예제 #3
0
        protected void ChargeGridPanel()
        {
            db = new demoDB();
            int  x = 1;
            bool y = Convert.ToBoolean(x);

            var data = (from sd in db.SpacialDataSets
                        where sd.active == y
                        select sd);

            Store1.DataSource = data;
            Store1.DataBind();
        }
예제 #4
0
 public static SpacialDataSet GetSpacialDataSet(int id, demoDB db)
 {
     return(db.SpacialDataSets.Single(e => e.Id == id));
 }
예제 #5
0
        public static SpacialDataSet GetSpacialDataSet(int id)
        {
            demoDB db = new demoDB();

            return(GetSpacialDataSet(id, db));
        }