예제 #1
0
        private void UserClickedOnPlay(object sender, EventArgs e)
        {
            configure_firebase();

            Song_Form song_form = (Song_Form)sender;
            Song      s         = song_form.Song;
            int       i         = 0;
            int       counter   = 0;

            foreach (Control control in flowLayoutPanel1.Controls)
            {
                if (control.GetType() == typeof(Song_Form))
                {
                    Song_Form sf = (Song_Form)control;
                    if (sf == song_form)
                    {
                        int    cnt  = i + 1;
                        string path = @"Downloaded Songs\" + sf.Song.Name + ".mp3";
                        File.Delete(path);
                        flowLayoutPanel1.Controls.Remove(sf);
                        client.Delete(@"Song/" + cnt);

                        updateAll(i + 1);
                    }

                    i++;
                }
            }
        }
        private bool RemoveSomethingInternal <T>(int ID)
        {
            DeleteResponse deleteResponse = _firebaseClient.Delete($"{typeof(T).Name}s/{ID}");

            if (deleteResponse.Success)
            {
                FirebaseResponse response = _firebaseClient.Get($"{typeof(T).Name}s/{typeof(T).Name}sNumeration");
                var numberOfSomething     = response.ResultAs <Numeration>();

                for (int i = ID + 1; i <= numberOfSomething.Number; i++)
                {
                    response = _firebaseClient.Get($"{typeof(T).Name}s/{i}");
                    var result = response.ResultAs <T>();
                    typeof(T).GetProperty("ID").SetValue(result, i - 1);
                    _firebaseClient.Set($"{typeof(T).Name}s/{i-1}", result);
                    deleteResponse = _firebaseClient.Delete($"{typeof(T).Name}s/{i}");
                }

                numberOfSomething.Number--;
                _firebaseClient.Set($"{typeof(T).Name}s/{typeof(T).Name}sNumeration", new Numeration {
                    Number = numberOfSomething.Number
                });
            }
            return(deleteResponse.Success);
        }
        public bool RemoveCustomer(int customerID)
        {
            if (GetCustomerByID(customerID) == null)
            {
                Console.WriteLine("Customer not exist");
            }

            if (GetAllOrdersByCustomerID(customerID) != null)
            {
                Console.WriteLine("Customer can't be removed");
            }

            FirebaseResponse response = firebaseClient.Delete($"Customers/Cust{customerID}");
            Customer         result   = response.ResultAs <Customer>();


            if (result != null)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
예제 #4
0
        private void button2_Click(object sender, EventArgs e)
        {
            string sel1 = this.comboBox1.GetItemText(this.comboBox1.SelectedItem);

            if (sel1.Equals("Approver"))
            {
                bunifuMaterialTextbox1.Enabled = true;

                FirebaseResponse resp1 = client.Get("User/Approver/" + bunifuMaterialTextbox1.Text);

                Class1 cl1 = resp1.ResultAs <Class1>();


                if (bunifuMaterialTextbox1.Text == cl1.id)
                {
                    FirebaseResponse resp = client.Delete("User/Approver/" + bunifuMaterialTextbox1.Text);
                    MessageBox.Show("Delete Successfully");
                }
                else
                {
                    MessageBox.Show("Fail");
                }
            }
            else if (sel1.Equals("Organization"))
            {
                bunifuMaterialTextbox1.Enabled = true;

                FirebaseResponse resp1 = client.Get("User/Organization/" + bunifuMaterialTextbox1.Text);
                orgregis         cl1   = resp1.ResultAs <orgregis>();
                if (bunifuMaterialTextbox1.Text == cl1.id)
                {
                    string get1 = cl1.org_name;
                    string get2 = cl1.org_type;

                    FirebaseResponse resp = client.Delete("User/Organization/" + bunifuMaterialTextbox1.Text);
                    MessageBox.Show("Delete Successfully");
                }
                else
                {
                    MessageBox.Show("Fail");
                }
            }
            else if (sel1.Equals("Venue"))
            {
                bunifuMaterialTextbox1.Enabled = true;
                FirebaseResponse resp1 = client.Get("User/Venue/" + bunifuMaterialTextbox1.Text);
                venregis         cl1   = resp1.ResultAs <venregis>();
                if (bunifuMaterialTextbox1.Text == cl1.id)
                {
                    string           get1 = cl1.org_type;
                    FirebaseResponse resp = client.Delete("User/Venue/" + bunifuMaterialTextbox1.Text);
                    MessageBox.Show("Delete Successfully");
                }
                else
                {
                    MessageBox.Show("Fail");
                }
            }
        }
예제 #5
0
        public void Delete_data()
        {
            client = new FirebaseClient(config);
            var response  = client.Delete("MAYA");
            var response2 = client.Delete("MAYB");

            MessageBox.Show("Xóa dữ liệu thành công!");
        }
예제 #6
0
        public ActionResult Eliminar(string id)
        {
            client = new FireSharp.FirebaseClient(config);
            FirebaseResponse response   = client.Delete("Usuario/" + id);
            FirebaseResponse responseN2 = client.Delete("Psicologo/" + id);

            return(RedirectToAction("AccesoPsicologo"));
        }
예제 #7
0
        public bool RemoveCustomer(int customerId)
        {
            DeleteResponse response = firebaseClient.Delete($"Customer/{customerId}");

            Console.WriteLine("Data Removed from Customer table: " + customerId);

            return(true);
        }
예제 #8
0
        public bool RemoveCustomer(int customerId)
        {
            List <Order> orderlist = GetAllOrdersByCustomerId(customerId);

            if (orderlist.Count == 0)
            {
                DeleteResponse response = firebaseClient.Delete($"Customers/{customerId}");
                return(true);
            }
            else
            {
                Console.WriteLine("Customer has orders");
                return(false);
            }
        }
 public void deleteRegistro(Guid guid)
 {
     try
     {
         FirebaseResponse response = client.Delete(PATH_FIREBASE + guid);
         MessageBox.Show("O registro foi excluido com sucesso.", "Exclusão concluída", MessageBoxButtons.OK);
     }
     catch (Exception e)
     {
         MensagemModel mensagem = new MensagemModel("Erro ao Excluir registro", "Não foi possível excluir o registro, possivelmente devido à problemas de conexão com a internet, tente novamente mais tarde.");
         LogModel      log      = new LogModel(mensagem.Titulo, e.Message, e.StackTrace, DateTime.Now);
         LogController.logarErro(log);
         MessageBox.Show(mensagem.Corpo, mensagem.Titulo, MessageBoxButtons.OK);
     }
 }
예제 #10
0
        // delete data from firebase
        private async void button2_Click(object sender, EventArgs e)
        {
            var set = client.Delete("Information/" + textBox1.Text);

            MessageBox.Show("Data ID" + textBox1.Text + " Deleted");
            export();
        }
예제 #11
0
        private void DeleteBtn_Click(object sender, EventArgs e)
        {
            var result = client.Delete("StudentList/" + rollTbox.Text);

            MessageBox.Show("Data has been deleted.");
            PopulateDataGrid();
        }
        public bool RemoveCustomer(int customerId)
        {
            if (GetAllOredersByCustomerId(customerId) != null)
            {
                return(false);                                               //If this customer
            }
            //has orders-
            //dont remove customer.
            FirebaseResponse response = firebaseClient.Delete($"Customer/{customerId}");

            if (response.Body.Contains($"Customer/{customerId}") == true)
            {
                return(false);
            }
            return(true);
        }
예제 #13
0
        private void btndelete_Click(object sender, EventArgs e)
        {
            var set = client.Delete(@"Information/" + emplyID.Text);

            // MessageBox.Show("Deleted Sucessfully");
            export();
        }
예제 #14
0
        public ActionResult DeleteTalent(string TalentCode)
        {
            client = new FireSharp.FirebaseClient(config);
            FirebaseResponse response = client.Delete("Talents/" + TalentCode);

            return(Redirect("http://18.139.166.95/CSC_Ben"));
        }
        private async void Button_Click(object sender, RoutedEventArgs e)
        {
            patvirtintiButton.IsEnabled = false;
            Loading();
            if (randomCode == EmailBox.Text)
            {
                vartotojasSaved.Epastas = newEmail;
                await client.UpdateAsync("Paskyros/" + keySaved, vartotojasSaved);

                string newKey = String.Join("", Encoding.ASCII.GetBytes(vartotojasSaved.Epastas));
                await client.UpdateAsync("Paskyros/" + newKey, vartotojasSaved);

                client.Delete("Paskyros/" + keySaved);


                //perjungiame į prisijungimo langą
                var loginForm = new Prisijungimas();
                loginForm.generalEventText.Content    = "El. paštas pakeistas, galite prisijungti!";
                loginForm.generalEventText.Foreground = Brushes.Green;
                loginForm.generalEventText.Visibility = Visibility.Visible;
                loginForm.Show();
                Close();
            }
            else
            {
                Unloading();
                generalEventText.Content    = "Neteisingas kodas!";
                generalEventText.Foreground = Brushes.Red;
                generalEventText.Visibility = Visibility.Visible;
                patvirtintiButton.IsEnabled = true;
            }
        }
예제 #16
0
        public ActionResult EliminarServicio(string CitaID, string PsicologoID)
        {
            client = new FireSharp.FirebaseClient(config);
            FirebaseResponse response = client.Delete("Cita/" + CitaID);

            return(RedirectToAction("EnlistarServicios", "Cita", new { id = PsicologoID }));
        }
        public void RestoreMappingReadModel <TReadModel>(string readModelId, List <ReadModelUpdateFailure> failedUpdates)
            where TReadModel : class, IFirebaseMappingReadModel, new()
        {
            var readModelDescription = _readModelDescriptionProvider.GetReadModelDescription <TReadModel>().RootNodeName.Value;
            var readmodelBackup      = GetLatestBackupForReadModel <TReadModel>(readModelDescription, readModelId);
            var path = $"{readModelDescription}/{readModelId}";

            try
            {
                if (readmodelBackup == null || readmodelBackup.Children == null || readmodelBackup.Children.Count == 0)
                {
                    _firebaseClient.Delete(path);
                }
                else
                {
                    _firebaseClient.Set(path, readmodelBackup.Children);
                }

                MarkFailedUpdatesAsFixed(failedUpdates);
            }
            catch (Exception)
            {
                MarkFailedUpdatesAsTriedAgain(failedUpdates);
            }
        }
예제 #18
0
        public ActionResult Delete(string id)
        {
            client = new FireSharp.FirebaseClient(config);
            FirebaseResponse response = client.Delete("Store/" + id);

            return(RedirectToAction("Index"));
        }
예제 #19
0
        public ActionResult Delete(string id)
        {
            client = new FireSharp.FirebaseClient(config);
            FirebaseResponse response = client.Delete("Products/" + id);

            //System.Diagnostics.Debug.WriteLine(response.Body);
            return(RedirectToAction("Index"));
        }
예제 #20
0
 public void ACTFKeysDelete(ACTFKeyss aCTFKeyss)
 {
     client = new FireSharp.FirebaseClient(config);
     if (client != null)
     {
         string path = "ACTFKeys/" + aCTFKeyss.id.ToString();
         client.Delete(path);
     }
 }
예제 #21
0
 public void ActivoDelete(Activos activos)
 {
     client = new FireSharp.FirebaseClient(config);
     if (client != null)
     {
         string path = "Activos/" + activos.id.ToString();
         client.Delete(path);
     }
 }
예제 #22
0
        private void btnEliminar_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("¿Está seguro que desea eliminar el registro seleccionado?", "Confirmación", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
            {
                return;
            }

            var set = client.Delete(@"empleados/" + txtId.Text);
        }
예제 #23
0
        private void Initialise(IFirebaseClient client)
        {
            FirebaseResponse responseClearGame =
                client.Delete("game");

            lobby = new Lobby();

            FirebaseResponse responseInitLobby =
                client.Set <Lobby>("game/lobby", lobby);
        }
예제 #24
0
        public void Delete()
        {
            _firebaseRequestManagerMock.Setup(firebaseRequestManager => firebaseRequestManager.Delete("todos"))
            .Returns(_expectedResponse);

            DeleteResponse response = _firebaseClient.Delete("todos");

            Assert.NotNull(response);
            Assert.AreEqual(response.Success, true);
        }
예제 #25
0
        public ActionResult Delete(int id)
        {
            FirebaseResponse transactionResponse = client.Delete("Transaction/" + id);

            if (transactionResponse.Body != "null")
            {
                Transaction deleteTransaction = transactionResponse.ResultAs <Transaction>();
            }
            return(new NoContentResult());
        }
        public void Setup()
        {
            IFirebaseConfig config = new FirebaseConfig
            {
                AuthSecret = FIREBASE_SECRET,
                BasePath   = BASE_PATH
            };

            _client = new FirebaseClient(config); //Uses RestSharp JsonSerializer as default
            _client.Delete("todos");
        }
예제 #27
0
        private void deletebtn_Click(object sender, EventArgs e)
        {
            string iidtodelete = selecteditem.iid;
            var    deletor     = client.Delete("Items/" + iidtodelete);

            MessageBox.Show("deleted");

            searchloader();

            deletelabel.Text = "Select  the item to delete ";
        }
예제 #28
0
        static private void Delete()
        {
            var data = new Data
            {
                ID   = "1",
                Name = "AUSTIN"
            };

            FirebaseResponse response = firebaseClient.Delete("Customer/1");

            Console.WriteLine("Data deleted " + data.ID);
        }
예제 #29
0
        public void Delete()
        {
            _client.Push("todos/push", new Todo
            {
                name     = "Execute PUSH4GET",
                priority = 2
            });

            var response = _client.Delete("todos/push");

            Assert.NotNull(response);
        }
예제 #30
0
        public People RemovePeople(string key)
        {
            People data = null;

            if (GetByIDPeople(key) != null)
            {
                var response = client.Delete($"people/{key}");
                data = new People();
                data = response?.ResultAs <People>();
            }
            return(data);
        }