/***************************************************/

        public virtual bool Delete(string filter = "", string config = "")
        {
            if (DeleteFunctions.ContainsKey(filter))
            {
                return(DeleteFunctions[filter](filter, config));
            }
            else
            {
                return(false);
            }
        }
Exemple #2
0
        public static void TesteDeleteDepartamento(string sigla)
        {
            Departamento d = new Departamento();

            d = DeleteFunctions.DeleteDepartamento(sigla);
            Console.WriteLine("Departamento " + d.Sigla + "\t" + d.Descricao + "deleted");
        }
Exemple #3
0
        // Delete UC
        public static int D3()
        {
            Console.WriteLine("Delete Unidade Curricular");
            Console.Write("Sigla? = ");
            var sigla = Console.ReadLine();

            Console.Write("Ano Letivo? = ");
            var data              = Console.ReadLine();
            UnidadeCurricular uc  = new UnidadeCurricular();
            UnidadeCurricular ans = new UnidadeCurricular();

            uc._ID.Sigla = sigla;
            uc._ID.Data  = DateTime.Parse(data);
            ans          = DeleteFunctions.DeleteUnidadeCurricular(uc);
            if (ans == null)
            {
                Console.WriteLine("Seccao {0} was deleted.", sigla);

                return(0);
            }
            else
            {
                Console.WriteLine("An error has ocurred. Unidade Curricular wasn't deleted.");
                return(-1);
            }
        }
Exemple #4
0
        /// <summary>
        /// Button Click that allows user to delete a user from the database. Calls the delete funciton
        ///for demographics and asks for confirmation before deleteing.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void bDelete_Click(object sender, EventArgs e)
        {
            DialogResult confirmation = new DialogResult();

            confirmation = MessageBox.Show("WARNING: You are about to delete Patient Information. Click OK to continue", "ATTENTION: PLEASE READ", MessageBoxButtons.OKCancel);
            if (confirmation == DialogResult.OK)
            {
                DialogResult confirmation2 = new DialogResult();
                confirmation2 = MessageBox.Show("Warning: Are you sure you wish to delete this Patients Information?", "ATTENTION PLEASE READ", MessageBoxButtons.YesNo);
                if (confirmation2 == DialogResult.Yes)
                {
                    int deletedRows = DeleteFunctions.DeletePatient(Int32.Parse(PatientId));
                    MessageBox.Show("Patient Information Deleted");
                    parentHub.backgroundWorker2.RunWorkerAsync();
                    this.Close();
                }
                else if (confirmation2 == DialogResult.No)
                {
                    MessageBox.Show("Patient NOT Deleted", "", MessageBoxButtons.OK);
                }
            }
            else if (confirmation == DialogResult.Cancel)
            {
                MessageBox.Show("Patient NOT Deleted", "", MessageBoxButtons.OK);
            }
        }
Exemple #5
0
        public static void DeleteSeccao(string sigla)
        {
            Seccao s = new Seccao();

            s.Sigla = sigla;
            s       = DeleteFunctions.DeleteSeccao(s);
            Console.WriteLine("Seccao " + s.Sigla + "\t" + "deleted");
        }
Exemple #6
0
        public static void TesteDeleteUC(string sigla, DateTime date)
        {
            UnidadeCurricular s = new UnidadeCurricular();

            s._ID.Sigla = sigla;
            s._ID.Data  = date;
            s           = DeleteFunctions.DeleteUnidadeCurricular(s);
            Console.WriteLine("Unidade Curricular " + s._ID.Sigla + "\t" + "deleted");
        }
Exemple #7
0
        // Delete Departamento
        public static int D1()
        {
            Console.WriteLine("Delete Departamento");
            Console.Write("Sigla? = ");
            var          sigla = Console.ReadLine();
            Departamento ans;

            ans = DeleteFunctions.DeleteDepartamento(sigla);
            if (ans == null)
            {
                Console.WriteLine("Departamento {0} was deleted.", sigla);

                return(0);
            }
            else
            {
                Console.WriteLine("An error has ocurred. Departamento wasn't deleted.");
                return(-1);
            }
        }
Exemple #8
0
        // Delete Seccao
        public static int D2()
        {
            Console.WriteLine("Delete Seccao");
            Console.Write("Sigla? = ");
            var    sigla = Console.ReadLine();
            Seccao s     = new Seccao();

            s.Sigla = sigla;
            s       = DeleteFunctions.DeleteSeccao(s);
            if (s == null)
            {
                Console.WriteLine("Seccao {0} was deleted.", sigla);

                return(0);
            }
            else
            {
                Console.WriteLine("An error has ocurred. Seccao wasn't deleted.");
                return(-1);
            }
        }