Exemplo n.º 1
0
        public void insertNoSQL()
        {
            //decalre variable to parse
            double lat;
            double lon;

            //parses the textbox variables to double
            lat = double.Parse(txtLatitude.Text);
            lon = double.Parse(txtLongitude.Text);

            //declare forms
            dal     d  = new dal();
            getData gd = new getData
            {
                //sets variables from getData
                username      = txtUsername.Text,
                latitude      = lat,
                longitude     = lon,
                imageUploaded = txtURL.Text,
                lastComment   = txtComment.Text
            };

            //calls Create record from dal using the data set from getData
            d.CreateRecord(gd);
            txtUsername.Text  = txtUsername.Text;
            txtLatitude.Text  = "";
            txtLongitude.Text = "";
            txtURL.Text       = "";
            txtComment.Text   = "";
        }
Exemplo n.º 2
0
        public void Delete_NoSQL_Data()
        {
            //new dal form is called
            dal dl = new dal();
            //strings the data from the datagridview containing the data
            String x = dataGridViewNosql.Rows[0].Cells[0].Value.ToString();

            //DeleteData is executed
            dl.DeleteData(x);
        }
Exemplo n.º 3
0
        public void display_NosqlData()
        {
            //method to collect data from NoSQL database
            getData gd = new getData
            {
                username = txtUsername.Text + ""
            }; // retrieves data containing the username entered
            dal            d    = new dal();
            List <getData> list = d.SearchByData(gd);

            //calls method to generate a list of data from the NoSQL database
            dataGridViewNosql.DataSource = list;
        }