Exemplo n.º 1
0
        private CheckResults ValidarCampos()
        {
            CheckResults check      = CheckResults.Failed;
            CheckFields  checfields = new CheckFields();

            if (CheckEmptyFields() == CheckResults.Failed)
            {
                MessageBox.Show("Existen Campos sin llenar");
                check = CheckResults.Failed;
            }
            else if (checfields.ValidarRFC(textBoxRFC.Text) == CheckFields.ResultadosValidación.RfcInvalido)
            {
                MessageBox.Show("RFC ingresado es inválido");
                check = CheckResults.Failed;
            }
            else if (checfields.ValidarNúmero(textBoxTelefono.Text) == CheckFields.ResultadosValidación.NúmeroInválido)
            {
                MessageBox.Show("el numero de telefono que ingresó no es valido");
                check = CheckResults.Failed;
            }
            else if (checfields.ValidarCorreo(textBoxCorreo.Text) == CheckFields.ResultadosValidación.Correoinválido)
            {
                MessageBox.Show("El correo ingresado no es valido");
                check = CheckResults.Failed;
            }
            else
            {
                check = CheckResults.Passed;
            }

            return(check);
        }
Exemplo n.º 2
0
        private AddResult CheckObjectProfesor(Profesor profesor)
        {
            CheckFields validarCampos = new CheckFields();
            AddResult   result        = AddResult.UnknowFail;

            if (profesor.IdProfesor == String.Empty ||

                profesor.NombresProfesor == String.Empty ||
                profesor.ApellidoPaternoProfesor == String.Empty ||
                profesor.ApellidoMaternoProfesor == String.Empty ||
                profesor.UsuarioProfesor == String.Empty ||
                profesor.ContraseñaProfesor == String.Empty ||
                profesor.FechaRegistroProfesor == String.Empty ||
                profesor.FechaBajaProfesor == String.Empty)
            {
                throw new FormatException("Existen campos vacíos ");
            }
            else
            if (validarCampos.ValidarNumeropersonal(profesor.IdProfesor) == CheckFields.ResultadosValidación.NúmeroInválido)
            {
                throw new FormatException("Numero invalido " + profesor.IdProfesor);
            }
            if (validarCampos.ValidarNombres(profesor.NombresProfesor) == CheckFields.ResultadosValidación.NombresInvalidos)
            {
                throw new FormatException("Nombre Invalido " + profesor.NombresProfesor);
            }
            else

            {
                result = AddResult.Success;
            }
            return(result);
        }
Exemplo n.º 3
0
        private AddResult CheckObjectOrganizacion(OrganizacionVinculada organizacion)
        {
            CheckFields instancevalidarCampos = new CheckFields();
            AddResult   instanceresult        = AddResult.UnknowFail;

            if (organizacion.IdOrganizacion == String.Empty ||
                organizacion.NombreEmpresa == String.Empty ||
                organizacion.Sector == String.Empty ||
                organizacion.UsuarioDirecto == String.Empty ||
                organizacion.UsuarioIndirecto == String.Empty ||
                organizacion.CorreoElectronico == String.Empty ||
                organizacion.Telefono == String.Empty ||
                organizacion.Estado == String.Empty ||
                organizacion.Ciudad == String.Empty ||
                organizacion.Direccion == String.Empty)
            {
                throw new FormatException("Existen campos vacíos ");
            }
            else
            if (instancevalidarCampos.ValidarMatricula(organizacion.IdOrganizacion) == CheckFields.ResultadosValidación.MatriculaInvalida)
            {
                throw new FormatException("ID invalida " + organizacion.IdOrganizacion);
            }
            else
            if (instancevalidarCampos.ValidarNombres(organizacion.NombreEmpresa) == CheckFields.ResultadosValidación.NombresInvalidos)
            {
                throw new FormatException("Nombre inválido " + organizacion.NombreEmpresa);
            }
            else
            {
                instanceresult = AddResult.Success;
            }
            return(instanceresult);
        }
Exemplo n.º 4
0
        private AddResult CheckObjectMensaje(Mensaje mensaje)
        {
            CheckFields validarCampos = new CheckFields();
            AddResult   result        = AddResult.UnknowFail;

            if (mensaje.Receptor == String.Empty ||

                mensaje.Emisor == String.Empty ||
                mensaje.Texto == String.Empty)
            {
                throw new FormatException("Existen campos vacíos ");
            }
            else
            if (validarCampos.ValidarNumeropersonal(mensaje.Receptor) == CheckFields.ResultadosValidación.NúmeroVálido || validarCampos.ValidarMatricula(mensaje.Receptor) == CheckFields.ResultadosValidación.MatriculaValida)
            {
                result = AddResult.Success;
            }
            else
            {
                throw new FormatException("Receptor Invalido " + mensaje.Receptor);
            }
            if (validarCampos.ValidarNumeropersonal(mensaje.Emisor) == CheckFields.ResultadosValidación.NúmeroVálido || validarCampos.ValidarMatricula(mensaje.Emisor) == CheckFields.ResultadosValidación.MatriculaValida)
            {
                result = AddResult.Success;
            }
            else
            {
                throw new FormatException("Emisor Invalido " + mensaje.Emisor);
            }


            result = AddResult.Success;

            return(result);
        }
Exemplo n.º 5
0
        private ChecResults CheckField()
        {
            ChecResults check         = ChecResults.Failed;
            CheckFields validarCampos = new CheckFields();

            if (CheckEmptyFields() == ChecResults.Failed)
            {
                MessageBox.Show("Existen campos sin llenar");
                check = ChecResults.Failed;
            }

            else if (validarCampos.ValidarContraseña(passwordboxccontraseña.Password) == CheckFields.ResultadosValidación.ContraseñaInvalida)
            {
                MessageBox.Show("La contraseña es muy débil \n Intenta combinar letras mayúsculas, minúsculas y números");
            }
            else if (validarCampos.ValidaEspacios(textboxUsuario.Text) == CheckFields.ResultadosValidación.UsuarioInvalido)
            {
                MessageBox.Show("No puede haber espacios en blanco");
            }
            else
            {
                check = ChecResults.Passed;
            }
            return(check);
        }
Exemplo n.º 6
0
        private AddResult CheckObjectPracticante(Practicante practicante)
        {
            CheckFields validarCampos = new CheckFields();
            AddResult   result        = AddResult.UnknowFail;

            if (practicante.MatriculaPracticante == String.Empty ||
                practicante.NombresPracticante == String.Empty ||
                practicante.ApellidoPaternoPracticante == String.Empty ||
                practicante.ApellidoMaternoPracticante == String.Empty ||
                practicante.PeriodoPracticante == String.Empty)
            {
                throw new FormatException("Existen campos vacíos ");
            }
            else
            if (validarCampos.ValidarMatricula(practicante.MatriculaPracticante) == CheckFields.ResultadosValidación.MatriculaInvalida)
            {
                throw new FormatException("Matricula inválida " + practicante.MatriculaPracticante);
            }
            else
            if (validarCampos.ValidarNombres(practicante.NombresPracticante) == CheckFields.ResultadosValidación.NombresInvalidos)
            {
                throw new FormatException("Nombre inválido " + practicante.NombresPracticante);
            }
            else
            {
                result = AddResult.Success;
            }
            return(result);
        }
Exemplo n.º 7
0
        private AddResult CheckObjectAdministrador(Administrador administrador)
        {
            CheckFields validarCampos = new CheckFields();
            AddResult   result        = AddResult.UnknowFail;

            if (administrador.UsuarioAdministrador == String.Empty ||
                administrador.ContraseñaAdministrador == String.Empty ||
                administrador.NombresAdministrador == String.Empty ||
                administrador.ApellidoPaternoAdministrador == String.Empty ||
                administrador.ApellidoPaternoAdministrador == String.Empty)
            {
                throw new FormatException("Existen campos vacíos ");
            }
            else
            if (validarCampos.ValidarUsuario(administrador.UsuarioAdministrador) == CheckFields.ResultadosValidación.UsuarioInvalido)
            {
                throw new FormatException("Usuario inválido " + administrador.UsuarioAdministrador);
            }
            else
            if (validarCampos.ValidarNombres(administrador.NombresAdministrador) == CheckFields.ResultadosValidación.NombresInvalidos)
            {
                throw new FormatException("Nombre inválido " + administrador.NombresAdministrador);
            }
            else
            {
                result = AddResult.Success;
            }
            return(result);
        }
Exemplo n.º 8
0
        private AddResult CheckObjectCoordinador(Coordinador coordinador)
        {
            CheckFields validarCampos = new CheckFields();
            AddResult   result        = AddResult.UnknowFail;

            if (coordinador.NoPersonal == String.Empty ||
                coordinador.NombresCoordinador == String.Empty ||
                coordinador.ApellidoPaternoCoordinador == String.Empty ||
                coordinador.ApellidoMaternoCoordinador == String.Empty ||
                coordinador.UsuarioCoordinador == String.Empty ||
                coordinador.ContraseñaCoordinador == String.Empty ||
                coordinador.CubiculoCoordinador == String.Empty ||
                coordinador.FechaDeBajaCoordinador == String.Empty ||
                coordinador.FechaDeRegistroCoordinador == String.Empty)
            {
                throw new FormatException("Existen campos vacíos ");
            }
            else
            if (validarCampos.ValidarUsuario(coordinador.UsuarioCoordinador) == CheckFields.ResultadosValidación.UsuarioInvalido)
            {
                throw new FormatException("Usuario inválido " + coordinador.UsuarioCoordinador);
            }
            else
            if (validarCampos.ValidarNombres(coordinador.NombresCoordinador) == CheckFields.ResultadosValidación.NombresInvalidos)
            {
                throw new FormatException("Nombre inválido " + coordinador.NombresCoordinador);
            }
            else
            {
                result = AddResult.Success;
            }
            return(result);
        }
Exemplo n.º 9
0
        private bool CheckNoWhereFields(OleDbConnection connection)
        {
            var reader = ADOSQLHelper.ExecuteReader(connection,
                                                    string.IsNullOrEmpty(WhereCaluse) ?
                                                    (
                                                        LocationFields == null ?
                                                        string.Format("Select {0},{1} from {2}", string.Join(",", CheckFields), Key, TableName)
                 : string.Format("Select {0},{1},{2} from {3}", string.Join(",", CheckFields), Key, string.Join(",", LocationFields), TableName)
                                                    )
                : (
                                                        LocationFields == null ?
                                                        string.Format("Select {0},{1} from {2} where {3}", string.Join(",", CheckFields), Key, TableName, WhereCaluse)
                : string.Format("Select {0},{1},{2} from {3} where {4}", string.Join(",", CheckFields), Key, string.Join(",", LocationFields), TableName, WhereCaluse)
                                                        )

                                                    );

            if (reader != null)
            {
                var str  = string.Empty;
                var info = string.Empty;
                while (reader.Read())
                {
                    str = string.Empty;
                    for (var i = 0; i < CheckFields.Count(); i++)
                    {
                        var a = reader[i].ToString().Trim();
                        if (Is_Nullable ^ string.IsNullOrEmpty(a))//异或  Is_NULLable  ture 为空  字段不为空或者 Is_NULLable false 必填 字段为空 矛盾
                        {
                            str += CheckFields[i] + ",";
                        }
                    }
                    if (!string.IsNullOrEmpty(str))
                    {
                        info = string.Format("{0}对应的字段:{1}与要求的{2}不符", reader[CheckFields.Count()], str, Is_Nullable ? "为空" : "必填");
                        _questions.Add(
                            new Question
                        {
                            Code              = "5101",
                            Name              = Name,
                            Project           = CheckProject.图层内属性一致性,
                            TableName         = TableName,
                            BSM               = reader[CheckFields.Count()].ToString(),
                            Description       = info,
                            RelationClassName = RelationName,
                            ShowType          = ShowType.Space,
                            WhereClause       =
                                LocationFields == null ?
                                string.Format("[{0}] ='{1}'", Key, reader[CheckFields.Count()].ToString())
                                : ADOSQLHelper.GetWhereClause(LocationFields, ADOSQLHelper.GetValues(reader, 1 + CheckFields.Length, LocationFields.Length))
                        });
                        Messages.Add(info);
                    }
                }
                QuestionManager.AddRange(_questions);
                return(true);
            }
            return(false);
        }
Exemplo n.º 10
0
        private void buttonApply_Click(object sender, EventArgs e)
        {
            if (CheckFields.CheckIfFieldsIsNotEmpty(this))
            {
                var row = adminMain.dataGridView.CurrentCell.OwningRow;
                // rowEmail is here so that there's no error about LINQ
                // not being able to convert it to LINQ expression
                // please don't remove it

                if (CheckFields.IsValidEmail(textBoxEmailAddress.Text))
                {
                    using (var session = new Session1Entities())
                    {
                        var rowEmail  = row.Cells["EmailAddress"].Value.ToString();
                        var rowSearch = session.Users.Where(u => u.Email == textBoxEmailAddress.Text).FirstOrDefault();
                        if (rowSearch == null || rowEmail == textBoxEmailAddress.Text)
                        {
                            // id is here so that there's no error about LINQ
                            // not being able to convert it to LINQ expression
                            // please don't remove it
                            var id      = int.Parse(row.Cells["ID"].Value.ToString());
                            var rowEdit = session.Users.Where(u => u.ID == id).FirstOrDefault();
                            rowEdit.Email     = textBoxEmailAddress.Text;
                            rowEdit.FirstName = textBoxFirstName.Text;
                            rowEdit.LastName  = textBoxLastName.Text;
                            rowEdit.OfficeID  = int.Parse(comboBoxOffice.SelectedValue.ToString());
                            rowEdit.RoleID    = radioButtonAdministrator.Checked ? 1 : 2;

                            try
                            {
                                session.SaveChanges();
                                adminMain.SetDatagridView();
                                Close();
                            }
                            catch (DbEntityValidationException ex)
                            {
                                var errorMessages    = ex.EntityValidationErrors.SelectMany(x => x.ValidationErrors).Select(x => x.ErrorMessage);
                                var fullErrorMessage = string.Join("\n", errorMessages);
                                var exceptionMessage = $"Error : {fullErrorMessage}";
                                MessageBox.Show(exceptionMessage);
                            }
                        }
                        else
                        {
                            MessageBox.Show("Email Address has already been taken.");
                        }
                    }
                }
                else
                {
                    MessageBox.Show("Please enter a valid email.");
                }
            }
            else
            {
                MessageBox.Show("Please don't leave any fields empty.");
            }
        }
Exemplo n.º 11
0
 private void buttonSave_Click(object sender, EventArgs e)
 {
     if (CheckFields.CheckIfFieldsIsNotEmpty(this))
     {
         var email = textBoxEmail.Text;
         if (CheckFields.IsValidEmail(email))
         {
             using (var session = new Session1Entities())
             {
                 if (session.Users.Where(u => u.Email == email).FirstOrDefault() == null)
                 {
                     var newUser = new User()
                     {
                         ID        = Utilities.GetLastUserID() + 1,
                         Email     = textBoxEmail.Text,
                         FirstName = textBoxFirstName.Text,
                         LastName  = textBoxLastName.Text,
                         OfficeID  = int.Parse(comboBoxOffice.SelectedValue.ToString()),
                         Birthdate = dateTimePickerBirthdate.Value,
                         Password  = Hash.MakeMd5(textBoxPassword.Text),
                         RoleID    = 2,
                         Active    = true
                     };
                     session.Users.Add(newUser);
                     try
                     {
                         session.SaveChanges();
                         adminMainForm.SetDatagridView();
                         ClearFields.ClearTextBoxes(this);
                         dateTimePickerBirthdate.ResetText();
                     }
                     catch (DbEntityValidationException ex)
                     {
                         var errorMessages    = ex.EntityValidationErrors.SelectMany(x => x.ValidationErrors).Select(x => x.ErrorMessage);
                         var fullErrorMessage = string.Join("\n", errorMessages);
                         var exceptionMessage = $"Error : {fullErrorMessage}";
                         MessageBox.Show(exceptionMessage);
                     }
                 }
                 else
                 {
                     MessageBox.Show("Please enter another email :\nThat email is already used by another user");
                 }
             }
         }
         else
         {
             MessageBox.Show("Please Enter a valid email.");
         }
     }
     else
     {
         MessageBox.Show("Please fill all of the fields first.");
     }
 }
Exemplo n.º 12
0
        private AddResult CheckObjectDocumento(DocumentoPracticas documento)
        {
            CheckFields validarCampos = new CheckFields();
            AddResult   result        = AddResult.UnknowFail;

            if (documento.RutaDocumento == String.Empty)
            {
                throw new FormatException("Existen campos vacíos ");
            }
            else
            {
                result = AddResult.Success;
            }
            return(result);
        }
Exemplo n.º 13
0
        public bool Check(OleDbConnection connection)
        {
            var reader = ADOSQLHelper.ExecuteReader(connection, _SQL);

            if (reader == null)
            {
                return(false);
            }

            while (reader.Read())
            {
                var keyValue = reader[0].ToString().Trim();
                if (string.IsNullOrEmpty(keyValue) == false)
                {
                    var temp = new List <string>();
                    for (var i = 0; i < CheckFields.Count(); i++)
                    {
                        var a = reader[i + 1].ToString().Trim();
                        if (string.IsNullOrEmpty(RegexString) == false && Is_Nullable == false)
                        {
                            if (Regex.IsMatch(a, RegexString) == false)
                            {
                                temp.Add(CheckFields[i]);
                            }
                        }
                        else
                        {
                            if (Is_Nullable ^ string.IsNullOrEmpty(a))
                            {
                                temp.Add(CheckFields[i]);
                            }
                        }
                    }
                    if (temp.Count > 0)
                    {
                        Messages2.Add(new Models.VillageMessage
                        {
                            Value       = keyValue,
                            Description = string.Format("【{0} = {1}】对应的字段【{2}】值不符合【{3}】", Key, keyValue, string.Join(",", temp.ToArray()), Name),
                            WhereClause = string.Format("[{0}] = '{1}'", Key, keyValue)
                        });
                    }
                }
            }
            return(true);
        }
Exemplo n.º 14
0
        private AddResult CheckObjectProyecto(Proyecto proyecto)
        {
            CheckFields validarCampos  = new CheckFields();
            AddResult   instanceresult = AddResult.UnknowFail;

            if (proyecto.IdProyecto == String.Empty ||
                proyecto.Responsabilidades == String.Empty ||
                proyecto.Actividad == String.Empty ||
                proyecto.Duracion == String.Empty ||
                proyecto.NombreProyecto == String.Empty ||
                proyecto.Descripcion == String.Empty ||
                proyecto.Objetivogeneral == String.Empty ||
                proyecto.ObjetivoMediato == String.Empty ||
                proyecto.CargoEncargado == String.Empty ||
                proyecto.EmailEncargado == String.Empty ||
                proyecto.NombreEncargado == String.Empty ||
                proyecto.Metodologia == String.Empty ||
                proyecto.Recursos == String.Empty ||
                proyecto.OrganizacionVinculada == null ||
                proyecto.Coordinador == null)
            {
                throw new FormatException("Existen campos vacíos ");
            }
            else
            if (validarCampos.ValidarMatricula(proyecto.IdProyecto) == CheckFields.ResultadosValidación.MatriculaInvalida)
            {
                throw new FormatException("id de proyecto invalido " + proyecto.IdProyecto);
            }
            else
            if (validarCampos.ValidarNombres(proyecto.NombreProyecto) == CheckFields.ResultadosValidación.NombresInvalidos)
            {
                throw new FormatException("Nombre inválido " + proyecto.NombreProyecto);
            }
            else
            {
                instanceresult = AddResult.Success;
            }
            return(instanceresult);
        }
Exemplo n.º 15
0
        private AddResult CheckObjectPractica(Practica practica)
        {
            CheckFields checkFields = new CheckFields();
            AddResult   addResult   = AddResult.UnknowFail;

            if (practica.NombrePractica == String.Empty ||
                practica.NombreOrgVincPractica == String.Empty ||
                practica.NumEspaciosPractica == 0 ||
                practica.PeriodoPractica == String.Empty)
            {
                throw new FormatException("Existen campos vacíos ");
            }
            if (checkFields.ValidarNombres(practica.NombrePractica) == CheckFields.ResultadosValidación.NombresInvalidos)
            {
                throw new FormatException("Nombre inválido " + practica.NombrePractica);
            }
            else
            {
                addResult = AddResult.Success;
            }
            return(addResult);
        }
Exemplo n.º 16
0
        public bool Check(OleDbConnection connection)
        {
            var sb = new StringBuilder(CheckFields[0]);

            for (var i = 1; i < CheckFields.Count(); i++)
            {
                sb.AppendFormat(",{0}", CheckFields[i]);
            }
            var reader = ADOSQLHelper.ExecuteReader(connection, string.Format("Select {0},{1} from {2} where {3}", sb.ToString(), Key, TableName, WhereCaluse));

            if (reader != null)
            {
                var str  = string.Empty;
                var info = string.Empty;
                while (reader.Read())
                {
                    str = string.Empty;
                    for (var i = 0; i < CheckFields.Count(); i++)
                    {
                        if (Is_Nullable ^ string.IsNullOrEmpty(reader[i].ToString()))//异或  Is_NULLable  ture 为空  字段不为空或者 Is_NULLable false 必填 字段为空 矛盾
                        {
                            str += CheckFields[i] + ",";
                        }
                    }
                    if (!string.IsNullOrEmpty(str))
                    {
                        info = string.Format("{0}对应的字段:{1}与要求的{2}不符", reader[CheckFields.Count()], str, Is_Nullable ? "为空" : "必填");
                        _questions.Add(new Question {
                            Code = "5101", Name = Name, Project = CheckProject.图层内属性一致性, TableName = TableName, BSM = reader[CheckFields.Count()].ToString(), Description = info
                        });
                        Messages.Add(info);
                    }
                }
                QuestionManager.AddRange(_questions);
                return(true);
            }
            return(false);
        }
Exemplo n.º 17
0
        static void Main(string[] args)
        {
            string      Email;
            string      Password;
            string      Data;
            string      Phone;
            CheckFields checkFields = new CheckFields();

            do
            {
                Console.WriteLine("Введите Email");
                Email = Console.ReadLine();
                Console.WriteLine("Введите дату");
                Data = Console.ReadLine();
                Console.WriteLine("Введите телефон");
                Phone = Console.ReadLine();
                Console.WriteLine("Введите пароль");
                Password = Console.ReadLine();
            } while (checkFields.IsEmailValid(Email) == false && checkFields.IsDateValid(Data) == false && checkFields.IsPhoneValid(Phone) == false);

            Console.WriteLine("Удачно!");
            Console.ReadKey();
        }
        private AddResult CheckObjectPractica(Practica instancePractica)
        {
            CheckFields instanceCheckFields = new CheckFields();
            AddResult   instanceAddResult   = AddResult.UnknowFail;

            if (instancePractica.NombrePractica == String.Empty ||
                instancePractica.NumOrgVincPractica == 0 ||
                instancePractica.NumPracticantes == 0 ||
                instancePractica.NumProfesores == 0 ||
                instancePractica.NumProyectos == 0 ||
                instancePractica.PeriodoPractica == String.Empty)
            {
                throw new FormatException("Existen campos vacíos ");
            }
            if (instanceCheckFields.ValidarNombreArtefacto(instancePractica.NombrePractica) == CheckFields.ResultadosValidación.NombreArtefactoInvalido)
            {
                throw new FormatException("Nombre inválido " + instancePractica.NombrePractica);
            }
            else
            {
                instanceAddResult = AddResult.Success;
            }
            return(instanceAddResult);
        }
Exemplo n.º 19
0
        private AddResult CheckObjectResponsableDeProyecto(ResponsableDeProyecto responsableDeProyecto)
        {
            CheckFields validarCampos = new CheckFields();
            AddResult   result        = AddResult.UnknowFail;

            if (responsableDeProyecto.CargoResponsable == String.Empty ||
                responsableDeProyecto.CorreoElectronicoResponsable == String.Empty ||
                responsableDeProyecto.NombreResponsable == String.Empty ||
                responsableDeProyecto.ApellidoPaternoResponsable == String.Empty ||
                responsableDeProyecto.ApellidoMaternoResponsable == String.Empty)
            {
                throw new FormatException("Existen campos vacíos ");
            }
            else
            if (validarCampos.ValidarUsuario(responsableDeProyecto.NombreResponsable) == CheckFields.ResultadosValidación.NombresInvalidos)
            {
                throw new FormatException("Nombre inválido " + responsableDeProyecto.NombreResponsable);
            }
            else
            {
                result = AddResult.Success;
            }
            return(result);
        }
Exemplo n.º 20
0
        private AddResult CheckObjectActividad(Actividad instanceActividad)
        {
            CheckFields instanceCheckFields = new CheckFields();
            AddResult   instanceAddResult   = AddResult.UnknowFail;

            if (instanceActividad.IdActividad == String.Empty ||
                instanceActividad.NombreActividad == String.Empty ||
                instanceActividad.DiaEntregaActividad == 0 ||
                instanceActividad.MesEntregaActividad == 0 ||
                instanceActividad.AñoEntregaActividad == String.Empty ||
                instanceActividad.ValorActividad == 0)
            {
                throw new FormatException("Existen campos vacíos ");
            }
            if (instanceCheckFields.ValidarNombreArtefacto(instanceActividad.NombreActividad) == CheckFields.ResultadosValidación.NombreArtefactoInvalido)
            {
                throw new FormatException("Nombre inválido " + instanceActividad.NombreActividad);
            }
            else
            {
                instanceAddResult = AddResult.Success;
            }
            return(instanceAddResult);
        }