コード例 #1
0
ファイル: ContactoBL.cs プロジェクト: Proyectos-FX-TI/Prueba
        public int Actualizar(Contacto contacto, ref string msj)
        {
            int result = 0;

            msj = string.Empty;
            try
            {
                if (contacto.id_contacto == 0 | !contacto.estatus | contacto.id_cliente == 0)
                {
                    msj = "No se puede actualizar el contacto.";
                }
                else if (string.IsNullOrEmpty(contacto.nombre) |
                         string.IsNullOrEmpty(contacto.apellido_p) |
                         string.IsNullOrEmpty(contacto.apellido_m) |
                         string.IsNullOrEmpty(contacto.tel) |
                         string.IsNullOrEmpty(contacto.direccion) |
                         string.IsNullOrEmpty(contacto.puesto))
                {
                    msj = "Faltan datos por capturar.";
                }
                else
                {
                    result = contactoDAL.SaveContacto(contacto);
                }
            }
            catch (Exception ex)
            {
                msj = ex.Message;
            }
            return(result);
        }