Ejemplo n.º 1
0
        public static bool updateUser2(TBL_USUARIO _infoUsuario)
        {
            try
            {
                bool resul = false;
                dc = new CD_HelpDeskDataContext();
                _infoUsuario.usu_add = DateTime.Now;

                dc.ExecuteCommand("UPDATE [dbo].[TBL_USUARIO] " +
                                  "SET [usu_correo] = {0} " +
                                  " ,[usu_password] = {1} " +
                                  ",[usu_apellidos] = {2} " +
                                  ",[usu_nombres] = {3} " +
                                  ",[usu_add] = {4} " +
                                  ",[rol_id] = {5} " +
                                  "WHERE [usu_id]={6} ", new object[]
                {
                    _infoUsuario.usu_correo,
                    _infoUsuario.usu_password,
                    _infoUsuario.usu_apellidos,
                    _infoUsuario.usu_nombres,
                    _infoUsuario.usu_add,
                    _infoUsuario.rol_id,
                    _infoUsuario.usu_id
                });


                //envia el comando dml al contexto
                dc.Refresh(RefreshMode.OverwriteCurrentValues, dc.TBL_USUARIO);

                resul = true;
                return(resul);
            }
            catch (Exception ex)
            {
                throw new ArgumentException("Error al consultar los usuarios " + ex.Message);
            }
        }