Exemple #1
0
 private void dataGridView2_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         int    id   = int.Parse(mascotas.Rows[mascotas.SelectedRows[0].Index].Cells["MascotaID"].Value.ToString());
         string name = mascotas.Rows[mascotas.SelectedRows[0].Index].Cells["Mascota"].Value.ToString();
         CurrentPet.SetCurrentPet(new CurrentPet(id, name, 0, ""));
         handlePetRegister();
         PetNote.Enabled = true;
     }
     catch (Exception ex)
     {
         NotificationsCenter.ShowErrorMessageForException(ex);
     }
 }
Exemple #2
0
        private void DangerPetIndicator_OnChange(object sender, EventArgs e)
        {
            try
            {
                var petRegister = new PetRegister(CurrentClient.GetID(), CurrentPet.GetID().Value, DangerPetIndicator.Checked ? "Mascota marcada como peligrosa" : "Mascota marcada como no peligrosa", DateTime.Now, "Rojo");
                if (sqlHelper.SavePetRegister(petRegister))
                {
                    NotificationsCenter.ShowSucessMessage("Registro guardado", DangerPetIndicator.Checked ? "Mascota marcada como peligrosa" : "Mascota marcada como no peligrosa");
                }
                else
                {
                    NotificationsCenter.ShowErrorMessage("Error intentando guardar el registro.");
                }

                handlePetRegister();
            }
            catch (Exception exception)
            {
                NotificationsCenter.ShowErrorMessageForException(exception);
            }
        }
Exemple #3
0
        private void petAddRegister_Click(object sender, EventArgs e)
        {
            if (PetNote.Text.Length == 0)
            {
                NotificationsCenter.ShowWarningMessage("Ingrese texto para el registo.");
            }

            try
            {
                var petRegister = new PetRegister(CurrentClient.GetID(), CurrentPet.GetID().Value, PetNote.Text, DateTime.Now, "Verde");
                if (sqlHelper.SavePetRegister(petRegister))
                {
                    NotificationsCenter.ShowSucessMessage("Registro guardado", "Los registros están actualizados en la base de datos.");
                }
                else
                {
                    NotificationsCenter.ShowErrorMessage("Error intentando guardar el registro.");
                }
            }
            catch (Exception exception)
            {
                NotificationsCenter.ShowErrorMessageForException(exception);
            }
        }
Exemple #4
0
 public void ErrorPrinting(Exception exception)
 {
     NotificationsCenter.ShowErrorMessageForException(exception);
     pagar.Enabled = true;
 }